Class Table

java.lang.Object
jadex.micro.philosophers.thread.Table

public class Table extends Object
  • Field Details

    • sticks

      protected String[] sticks
      The chop sticks
    • owners

      protected Philosopher[] owners
      The current owners of the sticks (who has stick 1, 2, ...).
    • philosophers

      protected Philosopher[] philosophers
      The philosopher that sit at the table.
    • waitforclicks

      protected boolean waitforclicks
      Wait for times or click events.
  • Constructor Details

    • Table

      public Table(int seats, boolean waitforclicks)
  • Method Details

    • addPhilosopher

      public void addPhilosopher(int no, Philosopher p)
    • getPhilosopher

      public Philosopher getPhilosopher(int no)
    • 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

      public Philosopher getCurrentPhilosopher()
    • getStickOwner

      public Philosopher getStickOwner(int no)
    • isWaitForClicks

      public boolean isWaitForClicks()
    • invertWaitForClicks

      public void invertWaitForClicks()
    • notifyAllPhilosophers

      public void notifyAllPhilosophers()
    • toString

      public String toString()
      Overrides:
      toString in class Object