Rev 334 | Rev 340 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
/*******************************************************************************
* controller.h
*
* Header file for the Controller class.
*
* Copyright 2006, Ira W. Snyder (devel@irasnyder.com)
******************************************************************************/
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include <assert.h>
#include <vector>
#include <limits.h>
#include <math.h>
#include <cstdio>
#include "elevator.h"
class Elevator;
class Controller
{
public:
Controller (int num_floors, int num_elevators);
~Controller ();
void start_all_elevators ();
void stop_all_elevators ();
void pause_all_elevators ();
void unpause_all_elevators ();
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, int in_direction);
std::vector<Elevator*> elevator;
int num_floors;
int num_elevators;
};
#endif // CONTROLLER_H