Subversion Repositories programming

Rev

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

Rev Author Line No. Line
321 ira 1
 
2
#ifndef CONTROLLER_H
3
#define CONTROLLER_H
4
 
5
#include <assert.h>
6
#include <vector>
328 ira 7
#include <limits.h>
8
#include <math.h>
321 ira 9
#include "elevator.h"
10
 
11
class Controller
12
{
13
    public:
14
        Controller (int num_floors, int num_elevators);
15
        ~Controller ();
16
 
329 ira 17
        void request_elevator (int on_floor, int direction);
18
        void disable_elevator (int elevator_number);
19
        void enable_elevator (int elevator_number);
321 ira 20
 
21
    private:
328 ira 22
        bool floor_already_requested (int on_floor);
23
        int find_closest_elevator (int to_floor);
24
 
25
        std::vector<Elevator> elevators;
321 ira 26
        int num_floors;
27
        int num_elevators;
28
};
29
 
30
#endif // CONTROLLER_H
31