class Counter extends Thread {
    
    Museum museum;
    int queue;
    
    Counter(Museum m, int q) {
        museum = m;
        queue = q;
    }
    
    /*
        Decide how many Walkmen are needed for a
        group of visitors and attempt to hire them
        (waiting until successful). The visitors are
        sent off on their own to walk around (by
        starting a new Visitors thread which runs
        independently).
    */
    public void run() {
        while(true){
            int w = 1;
            museum.hire(queue, w);
            new Visitors( museum, w).start();
            
            // wait a bit before the next people arrive
            try{
                sleep(100);
            }catch(InterruptedException e) {}
        } // end while()
        
    }
}