Subversion Repositories programming

Rev

Rev 328 | Rev 331 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed


#ifndef CONTROLLER_H
#define CONTROLLER_H

#include <assert.h>
#include <vector>
#include <limits.h>
#include <math.h>
#include "elevator.h"

class Controller
{
    public:
        Controller (int num_floors, int num_elevators);
        ~Controller ();

        void request_elevator (int on_floor, int direction);
        void disable_elevator (int elevator_number);
        void enable_elevator (int elevator_number);

    private:
        bool floor_already_requested (int on_floor);
        int find_closest_elevator (int to_floor);

        std::vector<Elevator> elevators;
        int num_floors;
        int num_elevators;
};

#endif // CONTROLLER_H