demos.atomicblocks
Class DEScenario

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
      extended by modhelxs.abstractsemantics.ObservableEntity
          extended by modhelxs.abstractsemantics.Block
              extended by modhelxs.state_management.ManagedBlock
                  extended by modhelxs.state_management.TimedManagedBlock<java.lang.Double>
                      extended by demos.atomicblocks.DEScenario
All Implemented Interfaces:
Block, NamedEntity, ObservableEntity

public class DEScenario
extends TimedManagedBlock<java.lang.Double>

A DEScenario plays a scenario on its output pins. The scenario is given in the "scenario" property of the block. The format of the scenario is a string compose of successive scenario steps delimited by semicolumns ';' Each scenario step is formed of the name of the output pin, the equal sign, the type of the data between parenthesis, the value to put on the pin, the @ sign and the date at which the step should be played. For instance "output=(Double)3.14@1.5;" is a scenario step for putting the Double value 3.14 on pin "output" at time 1.5.

Author:
boulange

Nested Class Summary
private  class DEScenario.Step
           
 
Field Summary
private  Attribute<java.lang.Double> base_time_
           
private  Attribute<DEScenario.Step> next_step_
           
private  Parameter<java.lang.Double> repeatAfter
           
private  Parameter<DEScenario.Step> scenario_
           
private static java.util.regex.Pattern step_pattern
           
private  Parameter<java.lang.Boolean> verbose
           
 
Constructor Summary
DEScenario(java.lang.String name, java.lang.Object... properties)
           
 
Method Summary
 void doEndOfSnapshot()
          The endOfSnapshot behavior of the block.
 void doSetup()
          The setup behavior of the block.
 void doUpdate()
          The update behavior of the block.
 
Methods inherited from class modhelxs.state_management.TimedManagedBlock
doPreSetup, doReset, doStartOfSnapshot, emitObservationRequests, getNextObservationTime, getTimeOfRequest, hasObservationRequest, initNextObservationTime, nextObsTimeAttribute, observationClock, setNextObservationTime, tagDifference, tagProduct, tagQuotient, tagSum
 
Methods inherited from class modhelxs.state_management.ManagedBlock
endOfSnapshot, endOfUpdate, initFromProperties, prep, reset, setup, startOfSnapshot, startOfUpdate, update, validate, wasUpdated, wrapup
 
Methods inherited from class modhelxs.abstractsemantics.Block
connect, connectFromInterfaceBlock, connectFromModel, connectFromRegularBlock, getEngine, getInputPins, getMoC, getOutputPins, 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.ObservableEntity
getInterface
 
Methods inherited from interface modhelxs.ecore.NamedEntity
getName, getProperties, setName
 

Field Detail

verbose

private Parameter<java.lang.Boolean> verbose

scenario_

private Parameter<DEScenario.Step> scenario_

repeatAfter

private Parameter<java.lang.Double> repeatAfter

next_step_

private Attribute<DEScenario.Step> next_step_

base_time_

private Attribute<java.lang.Double> base_time_

step_pattern

private static final java.util.regex.Pattern step_pattern
Constructor Detail

DEScenario

public DEScenario(java.lang.String name,
                  java.lang.Object... properties)
Method Detail

doSetup

public void doSetup()
Description copied from class: ManagedBlock
The setup behavior of the block.

Specified by:
doSetup in class ManagedBlock

doUpdate

public void doUpdate()
Description copied from class: ManagedBlock
The update behavior of the block.

Specified by:
doUpdate in class ManagedBlock

doEndOfSnapshot

public void doEndOfSnapshot()
Description copied from class: ManagedBlock
The endOfSnapshot behavior of the block.

Specified by:
doEndOfSnapshot in class ManagedBlock