public class PhilosopherExample extends Agent<PhilosophersAMASExample,TableExample>
Modifier and Type | Class and Description |
---|---|
static class |
PhilosopherExample.State
States philosophers can be in
|
Agent.Phase
amas, criticalities, currentPhase, neighborhood, params
Constructor and Description |
---|
PhilosopherExample(int id,
PhilosophersAMASExample amas,
ForkExample left,
ForkExample right)
Constructor of the philosopher
|
Modifier and Type | Method and Description |
---|---|
protected double |
computeCriticality()
This method must be overridden by the agents.
|
protected void |
onDecideAndAct()
Decide and act These two phases can often be grouped
|
protected void |
onInitialization()
Called before all agents are created
|
protected void |
onPerceive()
This method corresponds to the perception phase of the agents and must be
overridden
|
protected void |
onRenderingInitialization()
Called to initialize the rendering of the agent
|
protected void |
onUpdateRender()
This method should be used to update the representation of the agent for
example in a VUI
|
_computeExecutionOrder, _onBeforeReady, addNeighbor, computeExecutionOrderLayer, destroy, getAmas, getCurrentPhase, getEnvironment, getExecutionOrder, getId, getMostCriticalNeighbor, isSynchronous, onAct, onAgentCycleBegin, onAgentCycleEnd, onDecide, onDraw, onePhaseCycle, onExpose, onInitialize, onReady, onSystemCycleBegin, onSystemCycleEnd, phase1, phase2, run, setAsynchronous, toString
public PhilosopherExample(int id, PhilosophersAMASExample amas, ForkExample left, ForkExample right)
id
- the identifier of the philosopheramas
- the corresponding MASleft
- the left forkright
- the right forkprotected void onInitialization()
Agent
onInitialization
in class Agent<PhilosophersAMASExample,TableExample>
protected void onRenderingInitialization()
Agent
onRenderingInitialization
in class Agent<PhilosophersAMASExample,TableExample>
protected void onPerceive()
Agent
onPerceive
in class Agent<PhilosophersAMASExample,TableExample>
protected void onDecideAndAct()
Agent
onDecideAndAct
in class Agent<PhilosophersAMASExample,TableExample>
protected double computeCriticality()
Agent
computeCriticality
in class Agent<PhilosophersAMASExample,TableExample>
protected void onUpdateRender()
Agent
onUpdateRender
in class Agent<PhilosophersAMASExample,TableExample>