-
Notifications
You must be signed in to change notification settings - Fork 0
/
MetroSim.h
57 lines (43 loc) · 952 Bytes
/
MetroSim.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* MetroSim.h
*
* CS15 project 1 header file declaring class MetroSim
*
* Linh Nguyen (lnguye18)
* Jun 19 2023
*
*/
#ifndef _METROSIM_H_
#define _METROSIM_H_
#include "Passenger.h"
#include "PassengerQueue.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <vector>
using namespace std;
struct Station {
string name_station;
PassengerQueue p_queue;
};
class MetroSim {
public:
MetroSim(string stationFile);
void runTrain(ostream &output, istream &input);
private:
vector<Station> the_station;
vector<PassengerQueue> the_train;
int num_ppl;
int curr_station;
string query;
int p_arrival;
int p_departure;
bool metroEnd;
void read_file(string filename);
void print();
void get_command(ostream &output, istream &input);
void print_inaccurate_command(string command);
void addP();
void moveTrain(ostream &output);
};
#endif