Class VirtualThreadAgentProvider
java.lang.Object
org.episteme.natural.computing.ai.agents.providers.VirtualThreadAgentProvider
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegisters an agent in this environment.voidBroadcasts a message (object payload) to all agents.Finds an agent by its ID.Returns a read-only view of all agents in the environment.voidremoveAgent(Agent agent) Removes an agent from this environment.voidsend(ACLMessage message) Sends a directed ACL message.voidshutdown()Shuts down the environment and all agents.
-
Constructor Details
-
VirtualThreadAgentProvider
public VirtualThreadAgentProvider()
-
-
Method Details
-
addAgent
Description copied from interface:EnvironmentRegisters an agent in this environment.- Specified by:
addAgentin interfaceEnvironment- Parameters:
agent- the agent to add.
-
removeAgent
Description copied from interface:EnvironmentRemoves an agent from this environment.- Specified by:
removeAgentin interfaceEnvironment- Parameters:
agent- the agent to remove.
-
getAgent
Description copied from interface:EnvironmentFinds an agent by its ID.- Specified by:
getAgentin interfaceEnvironment- Parameters:
id- the UUID of the agent.- Returns:
- the Agent if found, null otherwise.
-
getAgents
Description copied from interface:EnvironmentReturns a read-only view of all agents in the environment.- Specified by:
getAgentsin interfaceEnvironment- Returns:
- collection of agents.
-
send
Description copied from interface:EnvironmentSends a directed ACL message.- Specified by:
sendin interfaceEnvironment- Parameters:
message- the ACL message containing sender, receiver, and content.
-
broadcast
Description copied from interface:EnvironmentBroadcasts a message (object payload) to all agents.- Specified by:
broadcastin interfaceEnvironment- 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.
-