modhelxs.abstractsemantics
Class ObservableEntity

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
      extended by modhelxs.abstractsemantics.ObservableEntity
All Implemented Interfaces:
NamedEntity, ObservableEntity
Direct Known Subclasses:
Block, Model

public abstract class ObservableEntity
extends NamedEntity
implements ObservableEntity

Implementation of an observable entity for the abstract semantics of ModHel'X.

Author:
boulange

Field Summary
private  java.util.Map<java.lang.String,Pin> pins_
          Association between names and pins for this entity.
 
Constructor Summary
ObservableEntity(java.lang.String name)
           
ObservableEntity(java.lang.String name, java.lang.Object... properties)
           
 
Method Summary
 Pin addPin(Pin pin)
          Add a pin to this entity.
abstract  Relation connect(Pin mine, Pin other)
          Connect one of my pins to another pin.
abstract  Relation connectFromInterfaceBlock(InterfaceBlock intfBlock, Pin other, Pin mine)
          Connect pin other of InterfaceBlock intfBlock to my pin mine.
abstract  Relation connectFromModel(Model<?> model, Pin other, Pin mine)
          Connect pin other of Model model to my pin mine.
abstract  Relation connectFromRegularBlock(Block block, Pin other, Pin mine)
          Connect pin other of regular Block block to my pin mine.
abstract  void emitObservationRequests()
          Emit observation request for future snapshots by creating ticks on clocks.
abstract  void endOfSnapshot()
          End of the observation round, the observable can update its internal state.
abstract  void endOfUpdate()
          End of a partial update (produce partial outputs to the outer model).
abstract  java.util.Collection<Pin> getInputPins()
          Get the input pins of this entity.
 java.util.Collection<Pin> getInterface()
          Return the interface of this observable.
abstract  ModelOfComputation<?> getMoC()
          Return the model of computation in which this entity is observed.
abstract  java.util.Collection<Pin> getOutputPins()
          Get the output ins of this entity.
 Pin getPin(java.lang.String name)
          Get the pin named name of this entity.
abstract  void prep()
          Initialize the entity.
abstract  void reset()
          Reset the computation of the outputs and next state for the current snapshot.
abstract  void sanityCheck()
          Perform sanity check before setup.
abstract  void setup()
          Prepare for the simulation.
abstract  void startOfSnapshot()
          Start a new snapshot (observation round).
abstract  void startOfUpdate()
          Start a partial update (get partial inputs from the outer model).
abstract  void update()
          Update the interface of the observable: take inputs into account, update outputs.
abstract  boolean validate()
          Validate the computation of the observation.
abstract  void wrapup()
          Cleanup at the end of the simulation.
 
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

pins_

private java.util.Map<java.lang.String,Pin> pins_
Association between names and pins for this entity.

Constructor Detail

ObservableEntity

public ObservableEntity(java.lang.String name)

ObservableEntity

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

getMoC

public abstract ModelOfComputation<?> getMoC()
Return the model of computation in which this entity is observed.


getInterface

public java.util.Collection<Pin> getInterface()
Return the interface of this observable.

Specified by:
getInterface in interface ObservableEntity

addPin

public Pin addPin(Pin pin)
Add a pin to this entity.


getPin

public Pin getPin(java.lang.String name)
Get the pin named name of this entity.


connect

public abstract Relation connect(Pin mine,
                                 Pin other)
Connect one of my pins to another pin.


connectFromModel

public abstract Relation connectFromModel(Model<?> model,
                                          Pin other,
                                          Pin mine)
Connect pin other of Model model to my pin mine.


connectFromRegularBlock

public abstract Relation connectFromRegularBlock(Block block,
                                                 Pin other,
                                                 Pin mine)
Connect pin other of regular Block block to my pin mine.


connectFromInterfaceBlock

public abstract Relation connectFromInterfaceBlock(InterfaceBlock intfBlock,
                                                   Pin other,
                                                   Pin mine)
Connect pin other of InterfaceBlock intfBlock to my pin mine.


getInputPins

public abstract java.util.Collection<Pin> getInputPins()
Get the input pins of this entity.


getOutputPins

public abstract java.util.Collection<Pin> getOutputPins()
Get the output ins of this entity.


prep

public abstract void prep()
Initialize the entity. Called after loading the model, before the simulation starts.


sanityCheck

public abstract void sanityCheck()
Perform sanity check before setup.


setup

public abstract void setup()
Prepare for the simulation. Called after prep, before the first step of the simulation.


startOfSnapshot

public abstract void startOfSnapshot()
Start a new snapshot (observation round).


reset

public abstract void reset()
Reset the computation of the outputs and next state for the current snapshot.


startOfUpdate

public abstract void startOfUpdate()
Start a partial update (get partial inputs from the outer model).


update

public abstract void update()
Update the interface of the observable: take inputs into account, update outputs.


endOfUpdate

public abstract void endOfUpdate()
End of a partial update (produce partial outputs to the outer model).


validate

public abstract boolean validate()
Validate the computation of the observation. Answer true if the observable agrees with the observed values.


endOfSnapshot

public abstract void endOfSnapshot()
End of the observation round, the observable can update its internal state.


emitObservationRequests

public abstract void emitObservationRequests()
Emit observation request for future snapshots by creating ticks on clocks.


wrapup

public abstract void wrapup()
Cleanup at the end of the simulation.