public class SynchronousProtocol extends RigidProtocol
| Modifier and Type | Field and Description |
|---|---|
private boolean |
hasTerminated
This attribute indicates whether this protocol has terminated.
|
private boolean |
isRigid
Indicates whether this protocol is rigid.
|
private int |
numberOfSteps
This attribute indicates the number of steps
to be performed until termination of this protocol.
|
static int |
UNLIMITED_EXECUTION
Indicates an unlimited number of execution steps
of this protocol.
|
| Constructor and Description |
|---|
SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
Creates a new (non-rigid) synchronous protocol for the given multi-agent system
and unlimited number of steps.
|
SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem,
boolean isRigid)
Creates a new synchronous protocol for the given multi-agent system and unlimited number of steps.
|
SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem,
int numberOfSteps)
Creates a new (non-rigid) synchronous protocol for the given multi-agent system and the
given number of steps.
|
SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem,
int numberOfSteps,
boolean isRigid)
Creates a new synchronous 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, setHasPerformedNoOperationaddProtocolListener, getMultiAgentSystem, notifyActionPerformed, notifyTerminated, removeProtocolListener, steppublic static final int UNLIMITED_EXECUTION
private boolean hasTerminated
private int numberOfSteps
private boolean isRigid
public SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem)
multiAgentSystem - a multi-agent system.public SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem, int numberOfSteps)
multiAgentSystem - a multi-agent system.numberOfSteps - the number of steps for this protocol.public SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem, boolean isRigid)
multiAgentSystem - a multi-agent system.isRigid - whether this protocol is rigid.public SynchronousProtocol(MultiAgentSystem<? extends Agent> multiAgentSystem, int numberOfSteps, boolean isRigid)
multiAgentSystem - a multi-agent system.numberOfSteps - the number of steps for this protocol.isRigid - whether this protocol is rigid.protected boolean hasTerminated()
AbstractProtocolhasTerminated in class RigidProtocolprotected java.util.Set<ActionEvent> doStep() throws ProtocolTerminatedException
AbstractProtocoldoStep in class AbstractProtocolProtocolTerminatedException