Class AbstractProtocol

  • All Implemented Interfaces:
    Protocol
    Direct Known Subclasses:
    RigidProtocol

    public abstract class AbstractProtocol
    extends java.lang.Object
    implements Protocol
    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

      Constructors 
      Constructor Description
      AbstractProtocol​(MultiAgentSystem<? extends Agent> multiAgentSystem)
      Creates a new protocol for the given multi-agent system.
    • Method Summary

      Modifier and Type Method Description
      void addProtocolListener​(ProtocolListener listener)
      Adds the given listener to this protocol.
      boolean removeProtocolListener​(ProtocolListener listener)
      Removes the given protocol listener from this protocol.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AbstractProtocol

        public AbstractProtocol​(MultiAgentSystem<? extends Agent> multiAgentSystem)
        Creates a new protocol for the given multi-agent system.
        Parameters:
        multiAgentSystem - a multi-agent system.
    • Method Detail

      • addProtocolListener

        public void addProtocolListener​(ProtocolListener listener)
        Description copied from interface: Protocol
        Adds the given listener to this protocol.
        Specified by:
        addProtocolListener in interface Protocol
        Parameters:
        listener - a protocol listener.
      • removeProtocolListener

        public boolean removeProtocolListener​(ProtocolListener listener)
        Description copied from interface: Protocol
        Removes the given protocol listener from this protocol.
        Specified by:
        removeProtocolListener in interface Protocol
        Parameters:
        listener - a protocol listener.
        Returns:
        "true" if the listener has been removed.