public class RoundRobinProtocol extends RigidProtocol
Modifier and Type | Field and Description |
---|---|
private java.util.List<Agent> |
agentsOrdered
The ordering of the agents.
|
private int |
agentsSkipped
The number of agents that skipped performing an action
within the last round.
|
private int |
currendIdx
The index of the agent who may perform the next action.
|
private boolean |
isRigid
Indicates whether this protocol is rigid.
|
private static org.slf4j.Logger |
log
Logger
|
Constructor and Description |
---|
RoundRobinProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
Creates a new (non-rigid) round robin protocol for the given multi-agent system.
|
RoundRobinProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem,
boolean isRigid)
Creates a new (non-rigid) round robin protocol for the given multi-agent system.
|
Modifier and Type | Method and Description |
---|---|
protected java.util.Set<ActionEvent> |
doStep()
Executes one step of the protocol.
|
protected boolean |
hasTerminated()
This method determines if this protocol has terminated,
i.e.
|
hasPerformedNoOperation, setHasPerformedNoOperation
addProtocolListener, getMultiAgentSystem, notifyActionPerformed, notifyTerminated, removeProtocolListener, step
private static org.slf4j.Logger log
private java.util.List<Agent> agentsOrdered
private int currendIdx
private int agentsSkipped
private boolean isRigid
public RoundRobinProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
multiAgentSystem
- a multi-agent system.public RoundRobinProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem, boolean isRigid)
multiAgentSystem
- a multi-agent system.isRigid
- whether this protocol is rigid.protected boolean hasTerminated()
AbstractProtocol
hasTerminated
in class RigidProtocol
protected java.util.Set<ActionEvent> doStep() throws ProtocolTerminatedException
AbstractProtocol
doStep
in class AbstractProtocol
ProtocolTerminatedException