Projection

A relational or positional structure layered over an AgentModel.Context. Borrowed from Repast Simphony's terminology: a context owns membership (who is in this collection), while projections add structure (where each member is, who's related to whom). A single context can have multiple projections layered on top — an agent can simultaneously have a 2D position and membership in a network without those abstractions interfering.

Concrete projections in Phase 3 v1:

Grid and network projections may be added in a later phase. The interface stays minimal so adding new projection types is purely additive.

Lifecycle: a projection is attached to its context via AgentModel.Context.addProjection. When agents join or leave the context, the context calls onAgentJoined / onAgentLeft on each attached projection so the projection can update its bookkeeping (drop the agent's position, edges, etc.).

Inheritors

Properties

Link copied to clipboard
abstract val name: String

Display name for diagnostics.

Functions

Link copied to clipboard
open fun onAgentJoined(agent: A)

Called by the AgentModel.Context when agent joins. Default no-op — projections that need to do something (e.g., place the agent at a default position) override.

Link copied to clipboard
open fun onAgentLeft(agent: A)

Called by the AgentModel.Context when agent leaves. Default no-op — projections that track per-agent state (positions, edges) typically override to drop their bookkeeping for the departing agent.