Package org.tweetyproject.agents
Class AbstractProtocol
java.lang.Object
org.tweetyproject.agents.AbstractProtocol
- All Implemented Interfaces:
Protocol
- Direct Known Subclasses:
RigidProtocol
A protocol gives instructions in which order agents have to be asked
for actions in a multi-agent system. This class encapsulates
common functionalities of protocols.
- Author:
- Matthias Thimm
-
Constructor Summary
ConstructorsConstructorDescriptionAbstractProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)Creates a new protocol for the given multi-agent system. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddProtocolListener(ProtocolListener listener)Adds the given listener to this protocol.booleanremoveProtocolListener(ProtocolListener listener)Removes the given protocol listener from this protocol.
-
Constructor Details
-
AbstractProtocol
Creates a new protocol for the given multi-agent system.- Parameters:
multiAgentSystem- a multi-agent system.
-
-
Method Details
-
addProtocolListener
Description copied from interface:ProtocolAdds the given listener to this protocol.- Specified by:
addProtocolListenerin interfaceProtocol- Parameters:
listener- a protocol listener.
-
removeProtocolListener
Description copied from interface:ProtocolRemoves the given protocol listener from this protocol.- Specified by:
removeProtocolListenerin interfaceProtocol- Parameters:
listener- a protocol listener.- Returns:
- "true" if the listener has been removed.
-