Package jason.control
Class ExecutionControl
java.lang.Object
jason.control.ExecutionControl
- Direct Known Subclasses:
ExecutionControlGUI
Base class for the user implementation of execution control.
This default implementation synchronise agents execution, i.e., each agent will perform its next reasoning cycle only when all agents have finished its reasoning cycle.
Execution sequence:
- setExecutionControlInfraTier,
- init,
- (receivedFinishedCycle)*,
- stop.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Called when all agents have finished the current cycleint
protected int
returns the maximum number of milliseconds of a cycleint
getNbAgs()
Returns the number of agents in the MAS (used to test the end of a cycle)void
This method is called when setExecutionControlInfraTier was already calledboolean
void
receiveFinishedCycle
(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 agentsvoid
setRunningCycle
(boolean rc) protected void
void
stop()
This method is called when MAS execution is being finishedprotected boolean
testEndCycle
(Set<String> finishedAgs) Returns true when a new cycle can start, it normally holds when all agents are in the finishedAgs set.toString()
void
Updates the number of agents in the MAS, this default implementation, considers all agents in the MAS as actors .
-
Field Details
-
infraControl
-
logger
-
-
Constructor Details
-
ExecutionControl
public ExecutionControl()
-
-
Method Details
-
getCycleTimeout
protected int getCycleTimeout()returns the maximum number of milliseconds of a cycle -
startNewCycle
protected void startNewCycle() -
updateNumberOfAgents
public void updateNumberOfAgents()Updates the number of agents in the MAS, this default implementation, considers all agents in the MAS as actors . -
getNbAgs
public int getNbAgs()Returns the number of agents in the MAS (used to test the end of a cycle) -
setNbAgs
public void setNbAgs(int n) Set the number of agents -
receiveFinishedCycle
Called when the agent agName has finished its reasoning cycle. breakpoint is true in case the agent selected one plan with "breakpoint" annotation. -
testEndCycle
Returns true when a new cycle can start, it normally holds when all agents are in the finishedAgs set.- Parameters:
finishedAgs
- the set of agents' name that already finished the current cycle
-
setExecutionControlInfraTier
-
getExecutionControlInfraTier
-
init
This method is called when setExecutionControlInfraTier was already called -
stop
public void stop()This method is called when MAS execution is being finished -
allAgsFinished
protected void allAgsFinished()Called when all agents have finished the current cycle -
isRunning
public boolean isRunning() -
getCycleNumber
public int getCycleNumber() -
setRunningCycle
public void setRunningCycle(boolean rc) -
toString
-