Class VirtualThreadAgentProvider

java.lang.Object
org.episteme.natural.computing.ai.agents.providers.VirtualThreadAgentProvider
All Implemented Interfaces:
Environment

public class VirtualThreadAgentProvider extends Object implements Environment
An Environment implementation that runs each agent on a Virtual Thread (Project Loom).

This provider enables massive-scale multi-agent systems (e.g., >100k agents) by decoupling agents from OS threads.

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

    • VirtualThreadAgentProvider

      public VirtualThreadAgentProvider()
  • Method Details

    • addAgent

      public void addAgent(Agent agent)
      Description copied from interface: Environment
      Registers an agent in this environment.
      Specified by:
      addAgent in interface Environment
      Parameters:
      agent - the agent to add.
    • removeAgent

      public void removeAgent(Agent agent)
      Description copied from interface: Environment
      Removes an agent from this environment.
      Specified by:
      removeAgent in interface Environment
      Parameters:
      agent - the agent to remove.
    • getAgent

      public Agent getAgent(UUID id)
      Description copied from interface: Environment
      Finds an agent by its ID.
      Specified by:
      getAgent in interface Environment
      Parameters:
      id - the UUID of the agent.
      Returns:
      the Agent if found, null otherwise.
    • getAgents

      public Collection<Agent> getAgents()
      Description copied from interface: Environment
      Returns a read-only view of all agents in the environment.
      Specified by:
      getAgents in interface Environment
      Returns:
      collection of agents.
    • send

      public void send(ACLMessage message)
      Description copied from interface: Environment
      Sends a directed ACL message.
      Specified by:
      send in interface Environment
      Parameters:
      message - the ACL message containing sender, receiver, and content.
    • broadcast

      public void broadcast(Agent sender, Object message)
      Description copied from interface: Environment
      Broadcasts a message (object payload) to all agents.
      Specified by:
      broadcast in interface Environment
      Parameters:
      sender - the sender agent (can be null for system messages).
      message - the content.
    • shutdown

      public void shutdown()
      Shuts down the environment and all agents.