Package net.sf.tweety.agents
Class RigidProtocol
- java.lang.Object
-
- net.sf.tweety.agents.AbstractProtocol
-
- net.sf.tweety.agents.RigidProtocol
-
- All Implemented Interfaces:
Protocol
- 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.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<Agent,java.lang.Boolean>
hasPerformedNoOperation
Keeps track of whether an agent has performed a NO_OPERATION;
-
Constructor Summary
Constructors Constructor Description RigidProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
Creates a new rigid protocol for the given multi-agent system.
-
Method Summary
Modifier and Type Method Description protected boolean
hasPerformedNoOperation(Agent a)
Checks whether the given agent has already performed a NO_OPERATION.protected boolean
hasTerminated()
This method determines if this protocol has terminated, i.e.protected void
setHasPerformedNoOperation(Agent a)
Sets that the given agent has performed a NO_OPERATION.-
Methods inherited from class net.sf.tweety.agents.AbstractProtocol
addProtocolListener, doStep, getMultiAgentSystem, notifyActionPerformed, notifyTerminated, removeProtocolListener, step
-
-
-
-
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.- Parameters:
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 classAbstractProtocol
- Returns:
- "true" if this protocol system has terminated.
-
hasPerformedNoOperation
protected boolean hasPerformedNoOperation(Agent a)
Checks whether the given agent has already performed a NO_OPERATION.- Parameters:
a
- an agent.- Returns:
- "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.- Parameters:
a
- an agent.
-
-