-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIMMC_main_model.cpp
51 lines (44 loc) · 1.61 KB
/
IMMC_main_model.cpp
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
//
// Created by Garv Shah on 12/3/2022.
//
#include <fstream>
#include <iostream>
//#include "models/IMMC_random_model_testing.cpp"
//#include "models/IMMC_boarding_by_section_testing.cpp"
//#include "models/IMMC_boarding_by_seat_testing.cpp"
//#include "models/IMMC_boarding_by_seat_people_not_following_order_testing.cpp"
//#include "models/IMMC_boarding_by_section_people_not_following_order_testing.cpp"
//#include "models/IMMC_back_to_front_testing.cpp"
//#include "models/IMMC_steffen_model_testing.cpp"
//#include "models/IMMC_random_model_30_capacity.cpp"
//#include "models/IMMC_random_model_50_capacity.cpp"
//#include "models/IMMC_random_model_70_capacity.cpp"
//#include "models/IMMC_back_to_front_30_capacity.cpp"
//#include "models/IMMC_back_to_front_50_capacity.cpp"
#include "models/IMMC_back_to_front_70_capacity.cpp"
//Change which file above is included to test different models
using namespace std;
int main()
{
random_device rd;
default_random_engine rng(rd());
ofstream outputFile;
outputFile.open("data_output.txt");
outputFile << "Time" << endl;
for (int i = 0; i < 1000; i++)
{
int time = runModel(rng);
printf("%d\n", time);
outputFile << time << endl;
}
outputFile.close();
try {
std::__fs::filesystem::rename("data_output.txt", "../data_output.csv");
std::ifstream src("../data_output.csv", std::ios::binary);
std::ofstream dst("../model_outputs/" + csv, std::ios::binary);
dst << src.rdbuf();
} catch (std::__fs::filesystem::filesystem_error& e) {
std::cout << e.what() << '\n';
}
return 0;
}