Package jadex.micro.philosophers.thread
Class Table
java.lang.Object
jadex.micro.philosophers.thread.Table
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Philosopher[]The current owners of the sticks (who has stick 1, 2, ...).protected Philosopher[]The philosopher that sit at the table.protected String[]The chop sticksprotected booleanWait for times or click events. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPhilosopher(int no, Philosopher p) voidgetLeftStick(int no) getPhilosopher(int no) voidgetRightStick(int no) voidgetStick(int no) Implement megetStickOwner(int no) voidbooleanvoidvoidreleaseLeftStick(int no) voidreleaseRightStick(int no) voidreleaseStick(int no) Implement metoString()
-
Field Details
-
sticks
The chop sticks -
owners
The current owners of the sticks (who has stick 1, 2, ...). -
philosophers
The philosopher that sit at the table. -
waitforclicks
protected boolean waitforclicksWait for times or click events.
-
-
Constructor Details
-
Table
public Table(int seats, boolean waitforclicks)
-
-
Method Details
-
addPhilosopher
-
getPhilosopher
-
getLeftStick
public void getLeftStick(int no) -
getRightStick
public void getRightStick(int no) -
getStick
public void getStick(int no) Implement me -
releaseLeftStick
public void releaseLeftStick(int no) -
releaseRightStick
public void releaseRightStick(int no) -
releaseStick
public void releaseStick(int no) Implement me -
getCurrentPhilosopher
-
getStickOwner
-
isWaitForClicks
public boolean isWaitForClicks() -
invertWaitForClicks
public void invertWaitForClicks() -
notifyAllPhilosophers
public void notifyAllPhilosophers() -
toString
-