Interface Agent
- All Superinterfaces:
Runnable
- All Known Implementing Classes:
BDIAgent, FlockingAgent
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 Summary
Modifier and TypeMethodDescriptionvoidaddBehavior(Behavior behavior) Adds a behavior to this agent.Helper to get the current environment this agent is in.getId()Returns the unique identifier of this agent.getName()Returns the name of this agent.voidInteracts with another agent.voidreceive(ACLMessage message) Receives a message from the environment.voidremoveBehavior(Behavior behavior) Removes a behavior from this agent.voidrun()The main execution cycle of the agent.voidsetEnvironment(Environment environment) Sets the environment for this agent.
-
Method Details
-
getId
-
getName
-
addBehavior
Adds a behavior to this agent. Behaviors define the agent's actions and responses.- Parameters:
behavior- the behavior to add.
-
removeBehavior
Removes a behavior from this agent.- Parameters:
behavior- the behavior to remove.
-
run
-
getEnvironment
Environment getEnvironment()Helper to get the current environment this agent is in.- Returns:
- the environment or null if not registered.
-
setEnvironment
Sets the environment for this agent. Called by the environment upon registration.- Parameters:
environment- the environment wrapper.
-
receive
Receives a message from the environment.- Parameters:
message- the ACL message to process.
-
interact
Interacts with another agent.- Parameters:
other- the agent to interact with.
-