demos.atomicblocks
Class EventFeeder

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.EventFeeder
All Implemented Interfaces:
Block, NamedEntity, ObservableEntity

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

An EventFeeder can be used to feed events into a simulation from external sources like a GUI. To feed an event into the simulation, call the feed(pin, value) method of the feeder. An EventFeeder has a driving clock that will trigger a snapshot when an event is fed.

Author:
boulange

Field Summary
private  EventFeederClock clock_
           
private  java.util.HashMap<Pin,java.lang.Object> snap_values_
           
private  java.util.HashMap<Pin,java.lang.Object> values_
           
 
Constructor Summary
EventFeeder(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 doStartOfSnapshot()
          The start of snapshot behavior of the block.
 void doUpdate()
          The update behavior of the block.
 void feed(Pin p, java.lang.Object v)
           
 
Methods inherited from class modhelxs.state_management.TimedManagedBlock
doPreSetup, doReset, 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

values_

private java.util.HashMap<Pin,java.lang.Object> values_

snap_values_

private java.util.HashMap<Pin,java.lang.Object> snap_values_

clock_

private EventFeederClock clock_
Constructor Detail

EventFeeder

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

doStartOfSnapshot

public void doStartOfSnapshot()
Description copied from class: ManagedBlock
The start of snapshot behavior of the block.

Overrides:
doStartOfSnapshot in class TimedManagedBlock<java.lang.Double>

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

feed

public void feed(Pin p,
                 java.lang.Object v)