Subversion Repositories programming

Rev

Rev 321 | Rev 329 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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