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 boolean
Wait for times or click events. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPhilosopher
(int no, Philosopher p) void
getLeftStick
(int no) getPhilosopher
(int no) void
getRightStick
(int no) void
getStick
(int no) Implement megetStickOwner
(int no) void
boolean
void
void
releaseLeftStick
(int no) void
releaseRightStick
(int no) void
releaseStick
(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
-