Class Agent

java.lang.Object
modelarium.ModelElement
modelarium.agents.Agent
All Implemented Interfaces:
DeepCopyable<ModelElement>

public class Agent extends ModelElement
Represents an agent in the agent-based model.

An agent is a simulation entity with a unique name and a collection of attributes that define its behaviour and internal state. The agent's `run()` method delegates to its attribute set, allowing attribute-driven logic to control execution.

  • Constructor Details

    • Agent

      public Agent(String name, AttributeSetCollection attributeSets)
      Constructs an agent with the given name and attribute set collection.
      Parameters:
      name - the unique name of the agent
      attributeSets - the attribute set defining the agent's internal state and behaviour
  • Method Details

    • run

      public void run()
      Executes one simulation step for this agent by invoking the `run()` method of its attribute set collection.

      This method is called once per tick during the model execution.

      Specified by:
      run in class ModelElement
    • deepCopy

      public Agent deepCopy()