|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodhelxs.abstractsemantics.NamedEntity
modhelxs.abstractsemantics.ModelOfComputation<T>
modhelxs.abstractsemantics.ModelOfComputationImpl<Unit>
modhelxs.mocs.sdf.SDFMoC
public class SDFMoC
| Nested Class Summary | |
|---|---|
private class |
SDFMoC.RelationState
|
| Field Summary | |
|---|---|
private Block |
current_block_
|
static java.lang.String |
INITTOKENS_PROPERTY
Name of the property of pin that do not depend instantaneously on the behavior of their block. |
private java.util.List<Pin> |
model_inputs_
List of model pins that are connected to block inputs |
private java.util.List<Pin> |
model_outputs_
List of block pins that are connected to model outputs |
static java.lang.String |
PINRATE_PROPERTY
|
private java.util.Iterator<Block> |
schedule_
|
private java.util.List<Block> |
scheduled_blocks_
Schedule of the blocks (sorted in topological order and appearing as many times as they must be updated). |
private Clock<Unit> |
sdf_clock_
The observation clock of SDF. |
| Constructor Summary | |
|---|---|
SDFMoC(java.lang.String name)
|
|
| Method Summary | |
|---|---|
private static void |
addRelationStateToPinMap(java.util.HashMap<Pin,java.util.List<SDFMoC.RelationState>> map,
Pin p,
SDFMoC.RelationState rs)
|
boolean |
canGoFurther(BlockStructure s)
Tell if it is possible to compute more information. |
void |
emitObservationRequests(BlockStructure s)
Place ticks on clocks to request to be observed in future snapshots. |
void |
endOfUpdate(BlockStructure s)
Called at the end of an update of an inner block (produce partial outputs for the upper model). |
private static int |
gcd(int a,
int b)
|
Clock<Unit> |
getClock()
Get the observation clock of this MoC. |
Unit |
getCurrentTime()
Get the current time of this MoC. |
static int |
getNumberOfInitialTokens(Pin p)
Get number of initial tokens on pin p. |
static int |
getPinRate(Pin p)
Get production/consumption rate for pin p. |
static boolean |
hasInitialTokens(Pin p)
Tell if pin p has initial tokens. |
void |
propagate(BlockStructure s)
Propagate new information produced by the update of a block. |
private static void |
propagateFromPin(Pin p)
|
void |
reset(BlockStructure s)
Reset for a new computation of the current snapshot (called at least once at the beginning of the snapshot). |
void |
schedule(BlockStructure s)
Choose a block to be updated. |
static void |
setNumberOfInitialTokens(Pin p,
int n)
Set number of initial tokens on pin p. |
static void |
setPinRate(Pin p,
int rate)
Set production/consumption rate for pin p. |
void |
setup(BlockStructure s)
Setup for simulation. |
void |
startOfUpdate(BlockStructure s)
Called at the beginning of an update of an inner block (get partial inputs from the upper model). |
void |
update(BlockStructure s)
Update a block. |
| Methods inherited from class modhelxs.abstractsemantics.ModelOfComputationImpl |
|---|
createToken, duplicateToken, endOfSnapshot, getTokenValue, prep, setTokenValue, startOfSnapshot, validate, wrapup |
| Methods inherited from class modhelxs.abstractsemantics.NamedEntity |
|---|
getName, getProperties, getProperty, hasProperty, removeProperty, setName, setProperties, setProperty, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface modhelxs.ecore.NamedEntity |
|---|
getName, getProperties, setName |
| Field Detail |
|---|
public static final java.lang.String INITTOKENS_PROPERTY
public static final java.lang.String PINRATE_PROPERTY
private Clock<Unit> sdf_clock_
private java.util.List<Block> scheduled_blocks_
private java.util.Iterator<Block> schedule_
private Block current_block_
private java.util.List<Pin> model_inputs_
private java.util.List<Pin> model_outputs_
| Constructor Detail |
|---|
public SDFMoC(java.lang.String name)
| Method Detail |
|---|
public Clock<Unit> getClock()
ModelOfComputation
getClock in class ModelOfComputation<Unit>public Unit getCurrentTime()
ModelOfComputation
getCurrentTime in class ModelOfComputation<Unit>public static boolean hasInitialTokens(Pin p)
p has initial tokens.
public static int getNumberOfInitialTokens(Pin p)
p.
public static void setNumberOfInitialTokens(Pin p,
int n)
p.
public static int getPinRate(Pin p)
p.
public static void setPinRate(Pin p,
int rate)
p.
private static void addRelationStateToPinMap(java.util.HashMap<Pin,java.util.List<SDFMoC.RelationState>> map,
Pin p,
SDFMoC.RelationState rs)
private static int gcd(int a,
int b)
public void setup(BlockStructure s)
ModelOfComputationprep, before the first snapshot.
setup in class ModelOfComputationImpl<Unit>s - the block structure of the model driven by this MoCpublic void reset(BlockStructure s)
ModelOfComputation
reset in class ModelOfComputationImpl<Unit>public void schedule(BlockStructure s)
ModelOfComputation
schedule in class ModelOfComputation<Unit>public void update(BlockStructure s)
ModelOfComputation
update in class ModelOfComputation<Unit>private static void propagateFromPin(Pin p)
public void propagate(BlockStructure s)
ModelOfComputation
propagate in class ModelOfComputation<Unit>public boolean canGoFurther(BlockStructure s)
ModelOfComputation
canGoFurther in class ModelOfComputation<Unit>public void emitObservationRequests(BlockStructure s)
ModelOfComputation
emitObservationRequests in class ModelOfComputationImpl<Unit>public void startOfUpdate(BlockStructure s)
ModelOfComputation
startOfUpdate in class ModelOfComputation<Unit>public void endOfUpdate(BlockStructure s)
ModelOfComputation
endOfUpdate in class ModelOfComputation<Unit>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||