modhelxs.abstractsemantics
Class Engine

java.lang.Object
  extended by modhelxs.abstractsemantics.NamedEntity
      extended by modhelxs.abstractsemantics.Engine
All Implemented Interfaces:
NamedEntity

public class Engine
extends NamedEntity

The execution engine of ModHel'X, which drives the abstract semantics of models and blocks.


Field Summary
private  java.util.List<ClockOperation<?>> clockOperations_
          List of clock operations to perform after a non validation.
static java.lang.String EngineLogger
          The logger used for logging actions related to the execution of models.
private  Model<?> rootModel_
          The root model of this engine.
private  Clock<java.lang.Integer> snapshot_clock_
          The clock that triggers the snapshots of the root model.
private  ClockSet solver_
          The clock solver used by this engine.
private  Clock<Unit> stop_clock_
          A clock used to tell the engine to stop.
 
Constructor Summary
Engine(java.lang.String name, Model<?> root)
          Build a new execution engine, with name name, and root model root.
 
Method Summary
 void addClockOperation(ClockOperation<?> op)
          Add a clock operation to perform before the next iteration when the snapshot is not validated.
private  void computeSnapshot(ClockSetMark raw_bck)
          Compute a snapshot.
private  boolean findDrivingClocks()
          Find which driving clocks can trigger a snapshot, and return whether we are still running or not.
 Clock<java.lang.Integer> getSnapshotClock()
          Get the "snapshot" clock of this execution engine.
 ClockSet getSolver()
          Get the clock solver of this execution engine.
 Clock<Unit> getStopClock()
          Get the "stop" clock of this execution engine.
 void run()
          Run the simulation.
 void stopAfter(int n)
          Stop simulation after n snapshots.
private  void waitForDrivingClocks()
          Wait for one of the driving clocks to tick.
 
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
 

Field Detail

EngineLogger

public static final java.lang.String EngineLogger
The logger used for logging actions related to the execution of models.

See Also:
Constant Field Values

rootModel_

private Model<?> rootModel_
The root model of this engine.


solver_

private ClockSet solver_
The clock solver used by this engine.


snapshot_clock_

private Clock<java.lang.Integer> snapshot_clock_
The clock that triggers the snapshots of the root model. If this clock has no tick, the simulation stops.


stop_clock_

private Clock<Unit> stop_clock_
A clock used to tell the engine to stop. If this clock has a "now" tick, the simulation stops.


clockOperations_

private java.util.List<ClockOperation<?>> clockOperations_
List of clock operations to perform after a non validation.

Constructor Detail

Engine

public Engine(java.lang.String name,
              Model<?> root)
Build a new execution engine, with name name, and root model root.

Method Detail

getSolver

public ClockSet getSolver()
Get the clock solver of this execution engine.


getStopClock

public Clock<Unit> getStopClock()
Get the "stop" clock of this execution engine.


getSnapshotClock

public Clock<java.lang.Integer> getSnapshotClock()
Get the "snapshot" clock of this execution engine.


stopAfter

public void stopAfter(int n)
Stop simulation after n snapshots.


addClockOperation

public void addClockOperation(ClockOperation<?> op)
Add a clock operation to perform before the next iteration when the snapshot is not validated.


findDrivingClocks

private boolean findDrivingClocks()
Find which driving clocks can trigger a snapshot, and return whether we are still running or not.


waitForDrivingClocks

private void waitForDrivingClocks()
Wait for one of the driving clocks to tick.


computeSnapshot

private void computeSnapshot(ClockSetMark raw_bck)
Compute a snapshot. raw_bck contains the state of the ClockSet before solving for the snapshot.


run

public void run()
Run the simulation.