Interface Environment

All Known Implementing Classes:
VirtualThreadAgentProvider

public interface Environment
The environment in which agents live and interact.

It acts as a container, service registry, and communication medium.

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

    Modifier and Type
    Method
    Description
    void
    addAgent(Agent agent)
    Registers an agent in this environment.
    void
    broadcast(Agent sender, Object message)
    Broadcasts a message (object payload) to all agents.
    Finds an agent by its ID.
    Returns a read-only view of all agents in the environment.
    void
    Removes an agent from this environment.
    void
    send(ACLMessage message)
    Sends a directed ACL message.
  • Method Details

    • addAgent

      void addAgent(Agent agent)
      Registers an agent in this environment.
      Parameters:
      agent - the agent to add.
    • removeAgent

      void removeAgent(Agent agent)
      Removes an agent from this environment.
      Parameters:
      agent - the agent to remove.
    • getAgent

      Agent getAgent(UUID id)
      Finds an agent by its ID.
      Parameters:
      id - the UUID of the agent.
      Returns:
      the Agent if found, null otherwise.
    • getAgents

      Collection<Agent> getAgents()
      Returns a read-only view of all agents in the environment.
      Returns:
      collection of agents.
    • broadcast

      void broadcast(Agent sender, Object message)
      Broadcasts a message (object payload) to all agents.
      Parameters:
      sender - the sender agent (can be null for system messages).
      message - the content.
    • send

      void send(ACLMessage message)
      Sends a directed ACL message.
      Parameters:
      message - the ACL message containing sender, receiver, and content.