📄 runway.h
字号:
#ifndef _RUNWAY_H_
#define _RUNWAY_H_
#include "Extended_queue.h"
#include "Plane.h"
#include <iostream>
using namespace std;
enum Runway_activity {idle, land, fly};
class Runway {
public:
Runway(int limit);
Error_code can_land(const Plane ¤t);
Error_code can_depart(const Plane ¤t);
Runway_activity canland(int time, Plane &moving);
Runway_activity canfly(int time, Plane &moving);
void shut_down(int time) const;
private:
Extended_queue landing;
Extended_queue takeoff;
int queue_limit;
int num_land_requests; // number of planes asking to land
int num_takeoff_requests; // number of planes asking to take off
int num_landings; // number of planes that have landed
int num_takeoffs; // number of planes that have taken off
int num_land_accepted; // number of planes queued to land
int num_takeoff_accepted; // number of planes queued to take off
int num_land_refused; // number of landing planes refused
int num_takeoff_refused; // number of departing planes refused
int land_wait; // total time of planes waiting to land
int takeoff_wait; // total time of planes waiting to take off
int idle_time; // total time runway is idle
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -