⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 airportsimulation.h

📁 金元平版数据结构 实验答案 有关飞机场内容的实验
💻 H
字号:
// airPortSimulation.h: interface for the airPortSimulation class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_AIRPORTSIMULATION_H__09465257_9ECF_42AF_8018_1BFEB3C8ADD1__INCLUDED_)
#define AFX_AIRPORTSIMULATION_H__09465257_9ECF_42AF_8018_1BFEB3C8ADD1__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <cstdlib>
#include <ctime>
#include <cmath>
#include <iostream>
using namespace std;
#include "minPQ.h"

struct plane
{
	int id;
	int tm;	// arrive time
	int rt;	// remained gas which has been converted to flying time
};

enum action {ARRIVE, DEPART};
class airPortSimulation  
{
public:
	void runSimulation();
	airPortSimulation();
	virtual ~airPortSimulation();

private:
	void conclude();
	void idle();
	void fly(plane& p);
	bool land(plane& p);
	void refuse(plane& p, action kind);
	plane* newPlane(plane& p, action kind);
	int poissionRandom(double& expectValue);
	void randomize();
	minHeap<plane> landing;
	minHeap<plane> takeoff;
	double expectArrive;
	double expectDepart;
	int currentTime;
	int endTime;
	int idleTime;
	int landWait;
	int takeOffWait;
	int nLand;
	int nPlanes;
	int nRefuse;
	int nTakeOff;
	int nCrash;
};

#endif // !defined(AFX_AIRPORTSIMULATION_H__09465257_9ECF_42AF_8018_1BFEB3C8ADD1__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -