aivika-0.4: A multi-paradigm simulation library

Stabilityexperimental
MaintainerDavid Sorokin <david.sorokin@gmail.com>
Safe HaskellNone

Simulation.Aivika.Dynamics.Agent

Description

Tested with: GHC 7.0.3

This module introduces an agent-based modeling.

Synopsis

Documentation

data Agent Source

Represents an agent.

Instances

data AgentState Source

Represents the agent state.

Instances

newAgent :: EventQueue -> Simulation AgentSource

Create an agent bound with the specified event queue.

newState :: Agent -> Simulation AgentStateSource

Create a new state.

agentQueue :: Agent -> EventQueueSource

Return the bound event queue.

agentState :: Agent -> Dynamics (Maybe AgentState)Source

Return the selected downmost active state.

agentStateChanged :: Agent -> Signal (Maybe AgentState)Source

Return a signal that notifies about every change of the state.

agentStateChanged_ :: Agent -> Signal ()Source

Return a signal that notifies about every change of the state.

activateState :: AgentState -> Dynamics ()Source

Select the next downmost active state.

initState :: AgentState -> Dynamics ()Source

Activate the child state during the direct activation of the parent state. This call is ignored in other cases.

stateAgent :: AgentState -> AgentSource

Return the corresponded agent.

stateParent :: AgentState -> Maybe AgentStateSource

Return the parent state or Nothing.

addTimeout :: AgentState -> Double -> Dynamics () -> Dynamics ()Source

Add to the state a timeout handler that will be actuated in the specified time period, while the state remains active.

addTimer :: AgentState -> Dynamics Double -> Dynamics () -> Dynamics ()Source

Add to the state a timer handler that will be actuated in the specified time period and then repeated again many times, while the state remains active.

stateActivation :: AgentState -> Dynamics () -> Simulation ()Source

Set the activation computation for the specified state.

stateDeactivation :: AgentState -> Dynamics () -> Simulation ()Source

Set the deactivation computation for the specified state.