public void registerPickupRequest(int floorNum, bool direction)
        {
            ElevatorRequest toRegister   = new ElevatorRequest(floorNum, direction);
            int             numElevators = elevators.Count;

            if (numElevators == 0)
            {
                return;
            }

            int offset = 0;

            if (numElevators > 1)
            {
                offset = m_random.Next(numElevators);
            }
            Elevator elevator = elevators[offset];

            elevator.registerRequest(toRegister);
            m_openRequests.Add(toRegister);
        }
Beispiel #2
0
 public void ProcessRequest(ElevatorRequest openRequest)
 {
     m_driver.addGoal(openRequest);
 }
Beispiel #3
0
 // The primary entry point to influence the elevator:
 //   external buttons (on floors and on the elevator panel)
 //   call RegisterRequest to call the elevator, go to a floor, etc.
 public void registerRequest(ElevatorRequest request)
 {
     m_requests.Add(request);
     m_driver.addGoal(request);
 }