class Visitors extends Thread {

  Visitors (Museum m, int w) {
    museum = m;
    groupSize = w;
  }

  public void run () {

    // The group walks around on its own for 50 time units.
    // You may need to alter this figure to suit your computer.
    // They then replace all their Walkmen and leave.
    // The thread dies with them.
    try {sleep((int) (Math.random()*1000)+1);}
          catch(InterruptedException e) {}
    museum.replace(groupSize);
  }

  Museum museum;
  int groupSize;
}
