AgentLike

interface AgentLike(source)

The minimal contract a Statechart needs from its owner. Both AgentModel.Agent and AgentResource implement this interface, so a statechart can govern either kind of actor without the statechart runtime having to know which it is.

Statechart action handlers receive an AgentLike reference rather than a concrete type. When a handler needs to read or mutate owner-specific state (a worker agent's task queue, a forklift's battery level), cast to the concrete type at the call site.

Inheritors

Properties

Link copied to clipboard
abstract val currentTime: Double

The current simulation time. Provided here so action handlers can log or compute durations without having to reach for the owner's outer model element.

Link copied to clipboard

Default mailbox for receiving AgentMessage traffic. Routes through the enclosing AgentModel's shared message bus.

Link copied to clipboard
abstract val name: String

Display name, used for diagnostic logging by the statechart runtime and example code.

Link copied to clipboard

Optional statechart governing this agent's reactive behavior. Default null for AgentLike implementations that don't provide a statechart abstraction. The concrete agent types (AgentModel.Agent, AgentModel.PermanentAgent, AgentResource) each override this with their own backing field.