aivika-5.1: A multi-method simulation library

Copyright Copyright (c) 2009-2017 David Sorokin BSD3 David Sorokin experimental None Haskell2010

Simulation.Aivika.Agent

Description

Tested with: GHC 8.0.1

This module introduces basic entities for the agent-based modeling.

Synopsis

# Documentation

data Agent Source #

Represents an agent.

Instances

 Source # Methods(==) :: Agent -> Agent -> Bool #(/=) :: Agent -> Agent -> Bool #

Represents the agent state.

Instances

 Source # Methods

Create an agent.

Create a new state.

Create a child state.

Return the selected active state.

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

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

Select the state. The activation and selection are repeated while there is the transition state defined by setStateTransition.

Return the corresponded agent.

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.

Set the activation computation for the specified state.

Set the deactivation computation for the specified state.

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.