public class ExecutionControl
extends java.lang.Object
This default implementation synchronise the agents execution, i.e., each agent will perform its next reasoning cycle only when all agents have finished its reasoning cycle.
Execution sequence:
Modifier and Type | Field and Description |
---|---|
protected ExecutionControlInfraTier |
infraControl |
protected static java.util.logging.Logger |
logger |
Constructor and Description |
---|
ExecutionControl() |
Modifier and Type | Method and Description |
---|---|
protected void |
allAgsFinished()
Called when all agents have finished the current cycle
|
int |
getCycleNumber() |
protected int |
getCycleTimeout()
returns the maximum number of milliseconds of a cycle
|
ExecutionControlInfraTier |
getExecutionControlInfraTier() |
int |
getNbAgs()
Returns the number of agents in the MAS (used to test the end of a cycle)
|
void |
init(java.lang.String[] args)
This method is called when setExecutionControlInfraTier was already called
|
boolean |
isRunning() |
void |
receiveFinishedCycle(java.lang.String agName,
boolean breakpoint,
int cycle)
Called when the agent agName has finished its reasoning cycle.
|
void |
setExecutionControlInfraTier(ExecutionControlInfraTier jasonControl) |
void |
setNbAgs(int n)
Set the number of agents
|
void |
setRunningCycle(boolean rc) |
protected void |
startNewCycle() |
void |
stop()
This method is called when MAS execution is being finished
|
protected boolean |
testEndCycle(java.util.Set<java.lang.String> finishedAgs)
Returns true when a new cycle can start, it normally
holds when all agents are in the finishedAgs set.
|
java.lang.String |
toString() |
void |
updateNumberOfAgents()
Updates the number of agents in the MAS, this default
implementation, considers all agents in the MAS as actors .
|
protected ExecutionControlInfraTier infraControl
protected static java.util.logging.Logger logger
protected int getCycleTimeout()
protected void startNewCycle()
public void updateNumberOfAgents()
public int getNbAgs()
public void setNbAgs(int n)
public void receiveFinishedCycle(java.lang.String agName, boolean breakpoint, int cycle)
protected boolean testEndCycle(java.util.Set<java.lang.String> finishedAgs)
finishedAgs
- the set of agents' name that already finished the current cyclepublic void setExecutionControlInfraTier(ExecutionControlInfraTier jasonControl)
public ExecutionControlInfraTier getExecutionControlInfraTier()
public void init(java.lang.String[] args)
public void stop()
protected void allAgsFinished()
public boolean isRunning()
public int getCycleNumber()
public void setRunningCycle(boolean rc)
public java.lang.String toString()
toString
in class java.lang.Object