hasim-0.1.2: Process-Based Discrete Event Simulation library

Portabilityunportable
Stabilityexperimental
Maintainerjochem@functor.nl

Control.Hasim.Simulation

Contents

Description

This module defines the Simulation monad, with functions to create processes and set actions.

Synopsis

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.

Process creation

mkAnonProcess :: SimMonad (Proc pkt ())Source

Make an anonymous process.

mkProcessSource

Arguments

:: 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

setActionSource

Arguments

:: 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.