E
- The environment the agent is connected to.public class AsyncAgent<E extends Environment> extends Agent<AsyncAmas<E>,E> implements Schedulable
Agent.Phase
amas, criticalities, currentPhase, neighborhood, params
DEFAULT_SLEEP
Constructor and Description |
---|
AsyncAgent(E environment,
int sleep,
java.lang.Object... params)
Create an async agent
|
Modifier and Type | Method and Description |
---|---|
protected int |
_computeExecutionOrder()
Compute the execution order from the layer and a random value.
|
void |
cycle()
A cycle of the schedulable system
|
void |
destroy()
Remove the agent from the system
|
E |
getEnvironment()
Getter for the environment
|
void |
onSchedulingStarts()
This method is called when the scheduler starts
|
void |
onSchedulingStops()
This method is called when the scheduler stops (by stopCondition or explicit
stop)
|
boolean |
stopCondition()
Check if the schedulable must be stopped by the scheduler.
|
_onBeforeReady, addNeighbor, computeCriticality, computeExecutionOrderLayer, getAmas, getCurrentPhase, getExecutionOrder, getId, getMostCriticalNeighbor, onAct, onAgentCycleBegin, onAgentCycleEnd, onDecide, onDecideAndAct, onDraw, onExpose, onInitialization, onInitialize, onPerceive, onReady, onRenderingInitialization, onSystemCycleBegin, onSystemCycleEnd, onUpdateRender, phase1, phase2, run, toString
public AsyncAgent(E environment, int sleep, java.lang.Object... params)
environment
- The environment of the agentsleep
- The time in milliseconds the agent has to wait between each cycleparams
- Optional parameterspublic void cycle()
Schedulable
cycle
in interface Schedulable
public void destroy()
Agent
destroy
in class Agent<AsyncAmas<E extends Environment>,E extends Environment>
public void onSchedulingStarts()
Schedulable
onSchedulingStarts
in interface Schedulable
public void onSchedulingStops()
Schedulable
onSchedulingStops
in interface Schedulable
public boolean stopCondition()
Schedulable
stopCondition
in interface Schedulable
protected int _computeExecutionOrder()
Agent
_computeExecutionOrder
in class Agent<AsyncAmas<E extends Environment>,E extends Environment>
public E getEnvironment()
Agent
getEnvironment
in class Agent<AsyncAmas<E extends Environment>,E extends Environment>