Class RigidProtocol

  • All Implemented Interfaces:
    Direct Known Subclasses:
    RoundRobinProtocol, SynchronousProtocol

    public abstract class RigidProtocol
    extends AbstractProtocol
    This class models a rigid protocol, i.e. a protocol where, if at any time an agent performs a "NO_OPERATION" he cannot perform any other action thereafter.
    Matthias Thimm
    • Field Detail

      • hasPerformedNoOperation

        private java.util.Map<Agent,​java.lang.Boolean> hasPerformedNoOperation
        Keeps track of whether an agent has performed a NO_OPERATION;
    • Constructor Detail

      • RigidProtocol

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

      • hasTerminated

        protected boolean hasTerminated()
        Description copied from class: AbstractProtocol
        This method determines if this protocol has terminated, i.e. whether no further actions are possible.
        Specified by:
        hasTerminated in class AbstractProtocol
        "true" if this protocol system has terminated.
      • hasPerformedNoOperation

        protected boolean hasPerformedNoOperation​(Agent a)
        Checks whether the given agent has already performed a NO_OPERATION.
        a - an agent.
        "true" iff the given agent has already performed a NO_OPERATION.
      • setHasPerformedNoOperation

        protected void setHasPerformedNoOperation​(Agent a)
        Sets that the given agent has performed a NO_OPERATION.
        a - an agent.