|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmodhelxs.abstractsemantics.NamedEntity
modhelxs.abstractsemantics.ObservableEntity
modhelxs.abstractsemantics.Model<T>
public class Model<T extends java.lang.Comparable<? super T>>
A Model describes a behavior by the combination of the behavior of the blocks of a structure according to a model of computation.
| Field Summary | |
|---|---|
private Engine |
engine_
The execution engine in charge of the execution of this model (cached value). |
private java.util.Set<Pin> |
inputpins_
|
private ModelOfComputation<T> |
moc_
The model of computation of this model. |
private java.util.Set<Pin> |
outputpins_
|
private InterfaceBlock |
parent_
The interface block this model belongs to (if any, null otherwise). |
private BlockStructure |
structure_
The structure that holds the blocks of this model. |
| Constructor Summary | |
|---|---|
Model(java.lang.String name,
ModelOfComputation<T> moc,
BlockStructure s,
java.lang.Object... properties)
Build a new model. |
|
Model(java.lang.String name,
ModelOfComputation<T> moc,
java.lang.Object... properties)
Build a model, automatically creating the corresponding block structure. |
|
| Method Summary | ||
|---|---|---|
|
add(B b)
Add a block to this model. |
|
Relation |
connect(Pin mine,
Pin other)
Connect one of my pins to another pin. |
|
Relation |
connectFromInterfaceBlock(InterfaceBlock intfBlock,
Pin other,
Pin mine)
Connect pin other of InterfaceBlock intfBlock to my pin mine. |
|
Relation |
connectFromModel(Model<?> model,
Pin other,
Pin mine)
Connect pin other of Model model to my pin mine. |
|
Relation |
connectFromRegularBlock(Block block,
Pin other,
Pin mine)
Connect pin other of regular Block block to my pin mine. |
|
Relation |
createRelation(Pin source,
Pin target)
Connect two pins in this model. |
|
void |
emitObservationRequests()
Emit observation request for future snapshots by creating ticks on clocks. |
|
void |
endOfSnapshot()
End of the observation round, the observable can update its internal state. |
|
void |
endOfUpdate()
End of a partial update (produce partial outputs to the outer model). |
|
Engine |
getEngine()
Get the execution engine which is in charge of executing this model. |
|
java.util.Collection<Pin> |
getInputPins()
Get the input pins of this entity. |
|
ModelOfComputation<T> |
getMoC()
Return the model of computation in which this entity is observed. |
|
java.util.Collection<Pin> |
getOutputPins()
Get the output ins of this entity. |
|
InterfaceBlock |
getParent()
|
|
BlockStructure |
getStructure()
|
|
void |
prep()
Initialize the entity. |
|
void |
reset()
Reset the computation of the outputs and next state for the current snapshot. |
|
void |
sanityCheck()
Perform sanity check before setup. |
|
void |
setEngine(Engine e)
|
|
void |
setParent(InterfaceBlock b)
Set the interface block that contains this model. |
|
void |
setup()
Prepare for the simulation. |
|
void |
startOfSnapshot()
Start a new snapshot (observation round). |
|
void |
startOfUpdate()
Start a partial update (get partial inputs from the outer model). |
|
void |
update()
Update the interface of the observable: take inputs into account, update outputs. |
|
boolean |
validate()
Validate the computation of the observation. |
|
void |
wrapup()
Cleanup at the end of the simulation. |
|
| Methods inherited from class modhelxs.abstractsemantics.ObservableEntity |
|---|
addPin, getInterface, getPin |
| 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.ObservableEntity |
|---|
getInterface |
| Methods inherited from interface modhelxs.ecore.NamedEntity |
|---|
getName, getProperties, setName |
| Field Detail |
|---|
private ModelOfComputation<T extends java.lang.Comparable<? super T>> moc_
private BlockStructure structure_
private InterfaceBlock parent_
private Engine engine_
private java.util.Set<Pin> inputpins_
private java.util.Set<Pin> outputpins_
| Constructor Detail |
|---|
public Model(java.lang.String name,
ModelOfComputation<T> moc,
BlockStructure s,
java.lang.Object... properties)
name - name of the modelmoc - model of computation of the models - block structure of the model
public Model(java.lang.String name,
ModelOfComputation<T> moc,
java.lang.Object... properties)
| Method Detail |
|---|
public <B extends Block> B add(B b)
public Relation createRelation(Pin source,
Pin target)
public Relation connect(Pin mine,
Pin other)
connect in class ObservableEntity
public Relation connectFromModel(Model<?> model,
Pin other,
Pin mine)
other of Model model to my pin mine.
connectFromModel in class ObservableEntity
public Relation connectFromRegularBlock(Block block,
Pin other,
Pin mine)
other of regular Block block to my pin mine.
connectFromRegularBlock in class ObservableEntity
public Relation connectFromInterfaceBlock(InterfaceBlock intfBlock,
Pin other,
Pin mine)
other of InterfaceBlock intfBlock to my pin mine.
connectFromInterfaceBlock in class ObservableEntitypublic void setParent(InterfaceBlock b)
public InterfaceBlock getParent()
getParent in interface Modelpublic Engine getEngine()
public void setEngine(Engine e)
public ModelOfComputation<T> getMoC()
ObservableEntity
getMoC in interface ModelgetMoC in class ObservableEntitypublic BlockStructure getStructure()
getStructure in interface Modelpublic void prep()
ObservableEntity
prep in class ObservableEntitypublic void sanityCheck()
ObservableEntity
sanityCheck in class ObservableEntitypublic void setup()
ObservableEntity
setup in class ObservableEntitypublic void startOfSnapshot()
ObservableEntity
startOfSnapshot in class ObservableEntitypublic void reset()
ObservableEntity
reset in class ObservableEntitypublic void update()
ObservableEntity
update in class ObservableEntitypublic boolean validate()
ObservableEntity
validate in class ObservableEntitypublic void endOfSnapshot()
ObservableEntity
endOfSnapshot in class ObservableEntitypublic void emitObservationRequests()
ObservableEntity
emitObservationRequests in class ObservableEntitypublic void wrapup()
ObservableEntity
wrapup in class ObservableEntitypublic void startOfUpdate()
ObservableEntity
startOfUpdate in class ObservableEntitypublic void endOfUpdate()
ObservableEntity
endOfUpdate in class ObservableEntitypublic java.util.Collection<Pin> getInputPins()
ObservableEntity
getInputPins in class ObservableEntitypublic java.util.Collection<Pin> getOutputPins()
ObservableEntity
getOutputPins in class ObservableEntity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||