Interface Agent

All Superinterfaces:
Runnable
All Known Implementing Classes:
BDIAgent, FlockingAgent

public interface Agent extends Runnable
Represents an autonomous entity capable of perceiving its environment and acting upon it.

Agents are the core building blocks of multi-agent systems. They encapsulate state and behavior, and interact with other agents through the Environment.

Since:
2.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • getId

      UUID getId()
      Returns the unique identifier of this agent.
      Returns:
      the agent's UUID.
    • getName

      String getName()
      Returns the name of this agent.
      Returns:
      the agent's name.
    • addBehavior

      void addBehavior(Behavior behavior)
      Adds a behavior to this agent. Behaviors define the agent's actions and responses.
      Parameters:
      behavior - the behavior to add.
    • removeBehavior

      void removeBehavior(Behavior behavior)
      Removes a behavior from this agent.
      Parameters:
      behavior - the behavior to remove.
    • run

      void run()
      The main execution cycle of the agent. Usually invoked by the agent container or scheduler.
      Specified by:
      run in interface Runnable
    • getEnvironment

      Environment getEnvironment()
      Helper to get the current environment this agent is in.
      Returns:
      the environment or null if not registered.
    • setEnvironment

      void setEnvironment(Environment environment)
      Sets the environment for this agent. Called by the environment upon registration.
      Parameters:
      environment - the environment wrapper.
    • receive

      void receive(ACLMessage message)
      Receives a message from the environment.
      Parameters:
      message - the ACL message to process.
    • interact

      void interact(Agent other)
      Interacts with another agent.
      Parameters:
      other - the agent to interact with.