hasim-0.1: Process-Based Discrete Event Simulation librarySource codeContentsIndex
Data types
Process creation
Simulation creation
This module defines the Simulation monad, with functions to create processes and set actions.
data Simulation
type SimMonad a = StateT SimState IO a
unSim :: Simulation -> [Process]
mkAnonProcess :: SimMonad (Proc pkt ())
mkProcess :: String -> st -> SimMonad (Proc pkt st)
setAction :: Proc pkt st -> Action pkt st () -> SimMonad ()
createSimulation :: SimMonad () -> IO Simulation
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.
=> StringThe name of the new process.
-> stThe 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 stThe 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.
Produced by Haddock version 2.3.0