public class PhilosopherExample extends Agent<PhilosophersAMASExample,TableExample>
| Modifier and Type | Class and Description |
|---|---|
static class |
PhilosopherExample.State
States philosophers can be in
|
Agent.Phaseamas, 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, toStringpublic 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()
AgentonInitialization in class Agent<PhilosophersAMASExample,TableExample>protected void onRenderingInitialization()
AgentonRenderingInitialization in class Agent<PhilosophersAMASExample,TableExample>protected void onPerceive()
AgentonPerceive in class Agent<PhilosophersAMASExample,TableExample>protected void onDecideAndAct()
AgentonDecideAndAct in class Agent<PhilosophersAMASExample,TableExample>protected double computeCriticality()
AgentcomputeCriticality in class Agent<PhilosophersAMASExample,TableExample>protected void onUpdateRender()
AgentonUpdateRender in class Agent<PhilosophersAMASExample,TableExample>