|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jason.control.ExecutionControl
public class ExecutionControl
Base class for the user implementation of execution control.
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:
Field Summary | |
---|---|
protected ExecutionControlInfraTier |
infraControl
|
protected static java.util.logging.Logger |
logger
|
Constructor Summary | |
---|---|
ExecutionControl()
|
Method Summary | |
---|---|
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 . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected ExecutionControlInfraTier infraControl
protected static java.util.logging.Logger logger
Constructor Detail |
---|
public ExecutionControl()
Method Detail |
---|
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |