|
||||||||||
| 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.Block
modhelxs.abstractsemantics.InterfaceBlock
modhelxs.state_management.ManagedInterfaceBlock
modhelxs.state_management.TimedManagedInterfaceBlock<java.lang.Double,java.lang.Double>
demos.semantic_adaptation.DE_SDF_LinInterpolator
public class DE_SDF_LinInterpolator
This is a special interface block (IB) between DE and SDF that can react to threshold crossing on the outputs of its internal SDF model. For each output with a "threshold" property, the IB compares the current and previous values produces by the internal model to the threshold. If the threshold was crossed from below to above, an event with value +1 is produced. If the threshold was crossed from above to below, an event with value -1 is produced. If the output also has a "precision" property, it gives the precision required on the date of the event. So, if the threshold was crossed, and the time elapsed between the linearly estimated crossing time t and the current time is greater than the precision, the snapshot is not validated, and a tick is added to the control clock of the IB to make the next update occur at t. Since the snapshot has not been validated, this next update will occur during the same snapshot. This means that the DE time will change. Since we cannot update the SDF model at any time, the IB computes the current value of the outputs by linear interpolation between the previous and current values, without updating the internal SDF model.
| Field Summary | |
|---|---|
private TransientValue<java.lang.Boolean> |
backtrack_
Should we backtrack in time to interpolate an output? |
private MapAttribute<Pin,java.lang.Object> |
inputPinValue_
Current value of each input pin. |
private TransientValue<java.lang.Double> |
interpolation_time_
Time at which the upper bounds in interpolationTable_ were reached. |
private TransientMap<Pin,java.lang.Object> |
interpolationTable_
Upper bound of the value of the output pins of the internal model in an interpolation step. |
private Attribute<java.lang.Double> |
last_update_time_
The last update time of this interface block, including interpolation updates. |
private MapAttribute<Pin,java.lang.Object> |
outputPinValue_
Current value of each output pin. |
private Parameter<java.lang.Double> |
update_period_
The update period of the internal SDF model. |
| Constructor Summary | |
|---|---|
DE_SDF_LinInterpolator(java.lang.String name,
Model<Unit> internalModel,
java.lang.Object... properties)
|
|
| Method Summary | |
|---|---|
void |
adaptIn()
Adapt data, time and control from the outer model to the inner one. |
void |
adaptOut()
Adapt data, time and control from the inner model to the outer one. |
void |
doEndOfSnapshot()
The endOfSnapshot behavior of the interface block. |
void |
doGhostUpdate()
The update behavior of the interface block when the internal model is not updated. |
void |
doPostUpdate()
The update behavior of the interface block after updating the internal model. |
void |
doPreUpdate()
The update behavior of the interface block before updating the internal model. |
void |
doSetup()
The setup behavior of the block. |
boolean |
validate()
Validate the computation of the observation. |
| Methods inherited from class modhelxs.state_management.ManagedInterfaceBlock |
|---|
endOfSnapshot, endOfUpdate, initFromProperties, internalWasUpdated, reset, setup, startOfSnapshot, startOfUpdate, update, wasUpdated |
| Methods inherited from class modhelxs.abstractsemantics.InterfaceBlock |
|---|
connect, connectFromModel, createAdaptationRelation, getAdaptation, getInputPins, getInternalModel, getOutputPins, prep, wrapup |
| Methods inherited from class modhelxs.abstractsemantics.Block |
|---|
connectFromInterfaceBlock, connectFromRegularBlock, getEngine, getMoC, getParent, getSolver, sanityCheck, setParent |
| 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.Block |
|---|
getParent |
| Methods inherited from interface modhelxs.ecore.ObservableEntity |
|---|
getInterface |
| Methods inherited from interface modhelxs.ecore.NamedEntity |
|---|
getName, getProperties, setName |
| Field Detail |
|---|
private MapAttribute<Pin,java.lang.Object> inputPinValue_
private MapAttribute<Pin,java.lang.Object> outputPinValue_
private TransientValue<java.lang.Boolean> backtrack_
private TransientMap<Pin,java.lang.Object> interpolationTable_
private TransientValue<java.lang.Double> interpolation_time_
private Parameter<java.lang.Double> update_period_
private Attribute<java.lang.Double> last_update_time_
| Constructor Detail |
|---|
public DE_SDF_LinInterpolator(java.lang.String name,
Model<Unit> internalModel,
java.lang.Object... properties)
| Method Detail |
|---|
public void doSetup()
ManagedInterfaceBlock
doSetup in class ManagedInterfaceBlockpublic void adaptIn()
InterfaceBlock
adaptIn in class InterfaceBlockpublic void doPreUpdate()
ManagedInterfaceBlock
doPreUpdate in class ManagedInterfaceBlockpublic void doPostUpdate()
ManagedInterfaceBlock
doPostUpdate in class ManagedInterfaceBlockpublic void doGhostUpdate()
ManagedInterfaceBlock
doGhostUpdate in class ManagedInterfaceBlockpublic void adaptOut()
InterfaceBlock
adaptOut in class InterfaceBlockpublic boolean validate()
ObservableEntity
validate in class InterfaceBlockpublic void doEndOfSnapshot()
ManagedInterfaceBlock
doEndOfSnapshot in class ManagedInterfaceBlock
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||