![]() |
lingua-franca 0.10.1
Lingua Franca code generator
|
(EXPERIMENTAL) Explores the state space of an LF program. More...
Public Member Functions | |
| void | addInitialEvents (ReactorInstance reactor) |
| Recursively add the first events to the event queue. | |
| void | explore (Tag horizon, boolean findLoop) |
| Explore the state space and populate the state space diagram until the specified horizon (i.e. | |
| StateSpaceExplorer (ReactorInstance main) | |
Public Attributes | |
| StateSpaceDiagram | diagram = new StateSpaceDiagram() |
| EventQueue | eventQ = new EventQueue() |
| Instantiate a global event queue. | |
| boolean | loopFound = false |
| ReactorInstance | main |
| The main reactor instance based on which the state space is explored. | |
(EXPERIMENTAL) Explores the state space of an LF program.
Use with caution since this is experimental code.
| org.lflang.analyses.statespace.StateSpaceExplorer.StateSpaceExplorer | ( | ReactorInstance | main | ) |
| void org.lflang.analyses.statespace.StateSpaceExplorer.addInitialEvents | ( | ReactorInstance | reactor | ) |
Recursively add the first events to the event queue.
| void org.lflang.analyses.statespace.StateSpaceExplorer.explore | ( | Tag | horizon, |
| boolean | findLoop ) |
Explore the state space and populate the state space diagram until the specified horizon (i.e.
the end tag) is reached OR until the event queue is empty.
As an optimization, if findLoop is true, the algorithm tries to find a loop in the state space during exploration. If a loop is found (i.e. a previously encountered state is reached again) during exploration, the function returns early.
TODOs: 1. Handle action with 0 minimum delay.
Note: This is experimental code which is to be refactored in a future PR. Use with caution.
| StateSpaceDiagram org.lflang.analyses.statespace.StateSpaceExplorer.diagram = new StateSpaceDiagram() |
| EventQueue org.lflang.analyses.statespace.StateSpaceExplorer.eventQ = new EventQueue() |
Instantiate a global event queue.
We will use this event queue to symbolically simulate the logical timeline. This simulation is also valid for runtime implementations that are federated or relax global barrier synchronization, since an LF program defines a unique logical timeline (assuming all reactions behave consistently throughout the execution).
| boolean org.lflang.analyses.statespace.StateSpaceExplorer.loopFound = false |
| ReactorInstance org.lflang.analyses.statespace.StateSpaceExplorer.main |
The main reactor instance based on which the state space is explored.