Simcraft Docs

abm Agent-Based Components

Agent-based modelling on the shared discrete-event kernel. Agents are stateful individuals whose statechart transitions schedule events on the kernel clock, so agent behaviour interleaves exactly with discrete-event and system-dynamics components.

Generated from spec/libraries/abm.library.json · library version 0.1.0 · OSDL 0.1

abm.population PopulationAgents#

A collection of agents sharing one agent definition (attributes plus a statechart). Agents may message each other over the population's network topology. A depart action sends an agent out of the population as a discrete-event entity through an out port; when that entity later arrives at an in port, the agent re-enters and its arrive-triggered transitions fire. Per-state agent counts are observable as <id>.inState.<stateId> in outputs and expressions.

Ports

PortDirectionDescription
out out Agents departing the population as entities, triggered by a depart action in the agent statechart.
in in multiple Entities arriving here re-enter the population as their original agents, firing arrive triggers.

Parameters

ParamTypeDescription
size scalarValue Number of agents created at simulation start. default 0
agentrequired object The agent definition shared by every agent in this population.
network object Connectivity used by send actions addressed to connected.

Observable state

StateTypeDescription
count integer Agents currently resident in the population (departed agents are excluded until they return).
held integer Departed agents whose entities are still buffered at the population's out port, waiting for the downstream component to accept them.
inState integer Agents currently in a given statechart state, published per state as inState.<stateId>.

Emitted events

EventDescription
agent.transitioned Emitted whenever an agent changes statechart state.
message.sent Emitted whenever an agent sends a message.
log.message Emitted whenever an agent writes to the log action.
entity.created Emitted when an agent departs through a connection as an entity.