| Stability | experimental |
|---|---|
| Maintainer | David Sorokin <david.sorokin@gmail.com> |
| Safe Haskell | Safe-Inferred |
Simulation.Aivika.Agent
Description
Tested with: GHC 7.8.3
This module introduces basic entities for the agent-based modeling.
- data Agent
- data AgentState
- newAgent :: Simulation Agent
- newState :: Agent -> Simulation AgentState
- newSubstate :: AgentState -> Simulation AgentState
- selectedState :: Agent -> Event (Maybe AgentState)
- selectedStateChanged :: Agent -> Signal (Maybe AgentState)
- selectedStateChanged_ :: Agent -> Signal ()
- selectState :: AgentState -> Event ()
- stateAgent :: AgentState -> Agent
- stateParent :: AgentState -> Maybe AgentState
- addTimeout :: AgentState -> Double -> Event () -> Event ()
- addTimer :: AgentState -> Event Double -> Event () -> Event ()
- setStateActivation :: AgentState -> Event () -> Simulation ()
- setStateDeactivation :: AgentState -> Event () -> Simulation ()
- setStateTransition :: AgentState -> Event (Maybe AgentState) -> Simulation ()
Documentation
newAgent :: Simulation AgentSource
Create an agent.
newState :: Agent -> Simulation AgentStateSource
Create a new state.
newSubstate :: AgentState -> Simulation AgentStateSource
Create a child state.
selectedState :: Agent -> Event (Maybe AgentState)Source
Return the selected active state.
selectedStateChanged :: Agent -> Signal (Maybe AgentState)Source
Return a signal that notifies about every change of the selected state.
selectedStateChanged_ :: Agent -> Signal ()Source
Return a signal that notifies about every change of the selected state.
selectState :: AgentState -> Event ()Source
Select the state. The activation and selection are repeated while
there is the transition state defined by setStateTransition.
stateAgent :: AgentState -> AgentSource
Return the corresponded agent.
stateParent :: AgentState -> Maybe AgentStateSource
Return the parent state or Nothing.
addTimeout :: AgentState -> Double -> Event () -> Event ()Source
Add to the state a timeout handler that will be actuated in the specified time period if the state will remain active.
addTimer :: AgentState -> Event Double -> Event () -> Event ()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.
setStateActivation :: AgentState -> Event () -> Simulation ()Source
Set the activation computation for the specified state.
setStateDeactivation :: AgentState -> Event () -> Simulation ()Source
Set the deactivation computation for the specified state.
setStateTransition :: AgentState -> Event (Maybe AgentState) -> Simulation ()Source
Set the transition state which will be next and which is used only
when selecting the state directly with help of selectState.
If the state was activated intermediately, when selecting
another state, then this computation is not used.