Portability | unportable |
---|---|
Stability | experimental |
Maintainer | jochem@functor.nl |
This module defines the Simulation monad, with functions to create processes and set actions.
Data types
data Simulation Source
Data type representing a simulation.
type SimMonad a = StateT SimState IO aSource
The simulation monad called SimMonad
. In this
monad you can define a simulation to be run.
unSim :: Simulation -> [Process]Source
Process creation
mkAnonProcess :: SimMonad (Proc pkt ())Source
Make an anonymous process.
:: String | The name of the new process. |
-> st | The initial state of the process. |
-> SimMonad (Proc pkt st) |
Make a process with a name. This name will be used in logging and error messages
:: Proc pkt st | The process of which the action should be set |
-> Action pkt st () | The action to be set |
-> SimMonad () |
Set the action of the process.
Simulation creation
createSimulation :: SimMonad () -> IO SimulationSource
Create a simulation from a SimMonad (a simulation definition).
If the simulation is invalid, error
will be called.