-
Notifications
You must be signed in to change notification settings - Fork 1
/
run.cpp
60 lines (49 loc) · 1.9 KB
/
run.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
52
53
54
55
56
57
58
59
60
/*
run.cpp
Catsim source code
Copyright (C) 2012-2013 naghtarr
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "tests/testrunner.h"
#include "define/cadef.h"
#include "command_line.h"
int main(int ac, char* av[])
{
// runtests();
command_line cl;
int code = cl.parser(ac, av);
if (code == 1)
return 0;
int iterations = cl.iterations;
road_network_data_ptr network_data = road_network_json_reader::read(cl.input_path);
road_network_model_ptr network_model(new roadnetwork_model());
network_model->build_network(network_data);
simulation_model_ptr sim_model(new simulation_model(iterations));
statistics_model_ptr stat_model(new statistics_model(cl.output_path));
stat_model->set_data_accumulation_time(cadef::stat_accumulation_time);
stat_model->add_data_param(ROAD_DENSITY);
stat_model->add_data_param(SPEED);
stat_model->add_data_param(FLOW);
stat_model->add_data_param(VEHICLES);
stat_model->add_data_param(PASSAGE_TIME);
stat_model->add_data_param(ROAD_QUEUE);
stat_model->add_stat_param(MIN);
stat_model->add_stat_param(MAX);
stat_model->add_stat_param(SUM);
stat_model->add_stat_param(MEAN);
stat_model->add_stat_param(MEDIAN);
stat_model->add_stat_param(DEVIATION);
stat_model->add_stat_param(VARIANCE);
stat_model->add_stat_param(KURTOSIS);
sim_model->launch_simulation(network_model, stat_model);
return 0;
}