Package jadex.micro.philosophers.agents
Class PhilosophAgent
java.lang.Object
jadex.micro.philosophers.agents.PhilosophAgent
- All Implemented Interfaces:
IPhilosopherService
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddoSleep(long time) protected voidprotected voidfoundTable(ITableService table) jadex.future.IFuture<Integer>jadex.future.IFuture<Integer>getNo()jadex.future.IFuture<PhilosopherState>getState()voidnotifyPhilosopher(long time) voidrun()voidsetState(PhilosopherState state)
-
Field Details
-
agent
protected jadex.core.IComponent agent -
state
-
r
-
no
protected int no -
t
-
eatcnt
protected int eatcnt -
wait
-
-
Constructor Details
-
PhilosophAgent
public PhilosophAgent(int no)
-
-
Method Details
-
foundTable
-
run
public void run() -
getState
- Specified by:
getStatein interfaceIPhilosopherService
-
setState
-
getEatCnt
- Specified by:
getEatCntin interfaceIPhilosopherService
-
getNo
- Specified by:
getNoin interfaceIPhilosopherService
-
doSleepRandom
protected void doSleepRandom() -
doSleep
protected void doSleep(long time) -
notifyPhilosopher
public void notifyPhilosopher(long time) - Specified by:
notifyPhilosopherin interfaceIPhilosopherService
-