Subversion Repositories programming

Rev

Rev 329 | Rev 332 | 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
 
331 ira 11
class Elevator;
12
 
321 ira 13
class Controller
14
{
15
    public:
16
        Controller (int num_floors, int num_elevators);
17
        ~Controller ();
18
 
331 ira 19
        void start_all_elevators ();
20
        void stop_all_elevators ();
21
        void pause_all_elevators ();
22
        void unpause_all_elevators ();
23
 
329 ira 24
        void request_elevator (int on_floor, int direction);
25
        void disable_elevator (int elevator_number);
26
        void enable_elevator (int elevator_number);
321 ira 27
 
28
    private:
328 ira 29
        bool floor_already_requested (int on_floor);
30
        int find_closest_elevator (int to_floor);
31
 
32
        std::vector<Elevator> elevators;
321 ira 33
        int num_floors;
34
        int num_elevators;
35
};
36
 
37
#endif // CONTROLLER_H
38