Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vss modeling #47

Merged
merged 134 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
134 commits
Select commit Hold shift + click to select a range
5a1e433
Merge pull request #46 from cda-tum/main
sengels-tum Sep 18, 2023
ae5e603
fix accidental git merge
sengels-tum Sep 18, 2023
a8479f4
add only stop at vss option to vss model
sengels-tum Sep 21, 2023
448a6c2
add functions for only stop at vss support
sengels-tum Sep 21, 2023
bba6bb9
linter warning
sengels-tum Sep 22, 2023
6b80aac
bugfix non breakable edges were considered
sengels-tum Sep 25, 2023
4c0e426
add b_front/rear cuts
sengels-tum Sep 25, 2023
dca9177
fix linter warnings
sengels-tum Sep 26, 2023
359bf05
do not create unused variables
sengels-tum Sep 26, 2023
7e07e33
add only stop at border variables
sengels-tum Sep 26, 2023
4e62bd0
add helper for allowed stops
sengels-tum Sep 26, 2023
2bb1ee6
update test case
sengels-tum Sep 26, 2023
dc6179a
linter warning
sengels-tum Sep 26, 2023
2dd5869
add test cases to be fulfilled
sengels-tum Sep 26, 2023
b1ff936
update gurobi eps globally
sengels-tum Sep 26, 2023
f1f15e5
general only stop at boundary constraints
sengels-tum Sep 26, 2023
aada625
finish stop at boundary for free route, todo bugfix infeasibility
sengels-tum Sep 26, 2023
1fda84e
duplicate constraint names
sengels-tum Sep 27, 2023
39b91bf
linter warnings
sengels-tum Sep 27, 2023
7f9479e
linter warning
sengels-tum Sep 27, 2023
7060e3c
bugfix
sengels-tum Sep 27, 2023
f986ddb
fix rounding
sengels-tum Sep 27, 2023
0ded54c
update test cases
sengels-tum Sep 27, 2023
205c9ce
fix variable names
sengels-tum Sep 27, 2023
3ee2193
fix naming
sengels-tum Sep 27, 2023
3ec5b36
rounding issue M too large
sengels-tum Sep 27, 2023
8ed0a82
update rounding precision
sengels-tum Sep 28, 2023
c38ddfa
update timeouts
sengels-tum Sep 28, 2023
99d9714
implement fixed routes
sengels-tum Sep 28, 2023
9b92ca3
minor changes due to numerics
sengels-tum Oct 2, 2023
f1793a5
update constraint adding syntax
sengels-tum Oct 2, 2023
3e65656
update testcase
sengels-tum Oct 2, 2023
4dbc683
add stop tolerance
sengels-tum Oct 2, 2023
6d7454b
update minimal speed
sengels-tum Oct 2, 2023
405cf40
unused local variables CodeQL
sengels-tum Oct 2, 2023
0bf845e
Merge pull request #48 from cda-tum/main
sengels-tum Oct 4, 2023
67b460a
Merge branch 'main' into vss-modeling
sengels-tum Oct 4, 2023
c166222
Merge branch 'main' into vss-modeling
sengels-tum Oct 4, 2023
0a50750
update testcases
sengels-tum Oct 5, 2023
216a074
TO REVERT: Debug output in windows failing test case
sengels-tum Oct 5, 2023
097be54
TO REVERT: debug speed output
sengels-tum Oct 5, 2023
1ee5fda
fix len_out problem
sengels-tum Oct 5, 2023
3c158db
fix linter warning
sengels-tum Oct 6, 2023
df02684
TO REVERT Variable Outout
sengels-tum Oct 6, 2023
0cf8034
TO REVERT: Debug on right place
sengels-tum Oct 6, 2023
fe15ddf
Revert "TO REVERT: Debug on right place"
sengels-tum Oct 6, 2023
1e5bf18
Revert "TO REVERT Variable Outout"
sengels-tum Oct 6, 2023
a77e405
add explicit variable for stopped vehicle
sengels-tum Oct 6, 2023
caf07dd
bugfix for fixed routes
sengels-tum Oct 6, 2023
cece133
Revert "TO REVERT: debug speed output"
sengels-tum Oct 6, 2023
097110e
Revert "TO REVERT: Debug output in windows failing test case"
sengels-tum Oct 6, 2023
3acb7df
add train integrity to data structure
sengels-tum Oct 16, 2023
f21d64f
tim test case
sengels-tum Oct 16, 2023
5774e83
make instance editable
sengels-tum Oct 17, 2023
1263d85
add discrete and fixed test cases
sengels-tum Oct 17, 2023
b131775
add tim for discrete case
sengels-tum Oct 17, 2023
8d4db21
tim constraints for non discretized version. TODO add cut that no mor…
sengels-tum Oct 17, 2023
6e8852a
non-tim cut
sengels-tum Oct 17, 2023
15b1d35
linter warning
sengels-tum Oct 17, 2023
1341ce2
improve coverage
sengels-tum Oct 20, 2023
c543259
improve coverage on different import options
sengels-tum Oct 20, 2023
453da55
improve coverage on datastructure
sengels-tum Oct 20, 2023
887fe2a
ignore some linter warnings in google test
sengels-tum Oct 20, 2023
81b38f0
update with current status from main (#51)
sengels-tum Oct 20, 2023
4caa2b0
linter warnings
sengels-tum Oct 20, 2023
bfab8cf
update iterative approach to prove optimality in more cases
sengels-tum Oct 23, 2023
9ce0ee6
warnings
sengels-tum Oct 24, 2023
2769d50
restructure iterative method
sengels-tum Oct 24, 2023
a10b3c2
resolve conflict
sengels-tum Oct 24, 2023
ba7e315
update with current status from main (#53)
sengels-tum Oct 24, 2023
1b7dfab
Merge pull request #54 from cda-tum/main
sengels-tum Oct 24, 2023
571ea82
remove redundant app
sengels-tum Oct 24, 2023
a67fc6f
add optimality strategy to iterative approach
sengels-tum Oct 25, 2023
3e4bc48
bugfix
sengels-tum Oct 25, 2023
ee748e4
bugfix
sengels-tum Oct 25, 2023
293f7ab
update update strategies
sengels-tum Oct 25, 2023
3dd4910
update start value
sengels-tum Oct 25, 2023
6242873
add tradeoff strategy
sengels-tum Oct 25, 2023
c0730f4
use defaults in app
sengels-tum Oct 26, 2023
c7a6dc7
fix order in app
sengels-tum Oct 26, 2023
38fe4cc
add optimality strategy to file name
sengels-tum Oct 26, 2023
d82b740
bugfix
sengels-tum Oct 26, 2023
abc2ae2
more debug output in app
sengels-tum Oct 26, 2023
de09e62
revert to default
sengels-tum Oct 26, 2023
28d09e5
only look for edge once
sengels-tum Oct 27, 2023
5f44336
enforce min block length on edges
sengels-tum Oct 27, 2023
854b32f
fix objective lower bound
sengels-tum Oct 27, 2023
29927cc
add has sol to solution object
sengels-tum Oct 27, 2023
65483f8
correct timeout status
sengels-tum Oct 27, 2023
4bebbc5
parameter test
sengels-tum Oct 30, 2023
4759bcc
bugfix
sengels-tum Oct 30, 2023
ad78ec1
linter warning
sengels-tum Oct 30, 2023
b35dd7d
add iterative cuts
sengels-tum Nov 2, 2023
75fd4d6
update apps
sengels-tum Nov 2, 2023
b7a025e
update parameter test app
sengels-tum Nov 3, 2023
73dd58e
bugfix
sengels-tum Nov 3, 2023
3e705ab
remove redundant cast
sengels-tum Nov 3, 2023
d3c0b6a
improve coverage for custom exceptions
sengels-tum Nov 3, 2023
ad14fdf
increase separation function coverage
sengels-tum Nov 3, 2023
f59b15a
increase timetable coverage
sengels-tum Nov 3, 2023
ba8ed4d
increase coverage on solution object
sengels-tum Nov 3, 2023
8aa7eb5
bugfix
sengels-tum Nov 3, 2023
a7c925c
bugfixed testcase
sengels-tum Nov 3, 2023
8e1fcb9
improve coverage on iterative cuts
sengels-tum Nov 3, 2023
85d3cf5
increase coverage of solver
sengels-tum Nov 3, 2023
c26bf35
bugfix in test case
sengels-tum Nov 6, 2023
44ab96c
add relative update option
sengels-tum Nov 6, 2023
a99dd91
bugfix
sengels-tum Nov 6, 2023
cade8f1
add more test cases
sengels-tum Nov 6, 2023
e45d793
linter warning
sengels-tum Nov 6, 2023
a5fff39
update app
sengels-tum Nov 7, 2023
42b41c3
update readme
sengels-tum Nov 7, 2023
3b317f2
update comment
sengels-tum Nov 7, 2023
8c8aabc
bugfix
sengels-tum Nov 7, 2023
469608b
update test cases
sengels-tum Nov 7, 2023
50532b0
linter warning
sengels-tum Nov 7, 2023
26ee3bb
update parameters of solve function
sengels-tum Nov 8, 2023
43e5e97
linter warnings
sengels-tum Nov 8, 2023
ef40f7f
update cleanup
sengels-tum Nov 8, 2023
9bfffe3
simplify testcase
sengels-tum Nov 8, 2023
b6234e6
bugfix
sengels-tum Nov 8, 2023
e7b17fb
fix testcases
sengels-tum Nov 9, 2023
0b7d5dd
update timeout
sengels-tum Nov 9, 2023
8799e0b
update test cases
sengels-tum Nov 17, 2023
b0dee07
do not cut in case of feasible solution to reuse incumbent warm start
sengels-tum Nov 17, 2023
f75b8c6
fix naming of test
sengels-tum Nov 17, 2023
bc7dfae
update comments
sengels-tum Nov 23, 2023
d70eea0
add test for exporting solution
sengels-tum Nov 24, 2023
8904588
change cleanup process to not prevent exporting
sengels-tum Nov 24, 2023
b97ed78
update export test cases
sengels-tum Nov 24, 2023
1ed29bf
bugfix for default directory
sengels-tum Nov 24, 2023
816bd9f
cuty only when infeasible. Otherwise without cuts so that optimality …
sengels-tum Nov 28, 2023
836ca86
use cerr instead of cout for errors in apps
sengels-tum Jan 2, 2024
210a185
change constants to constexpr
sengels-tum Jan 2, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 34 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,11 @@ Otherwise, they have to be set manually, see also https://support.gurobi.com/hc/

### Usage

Currently, the tool provides only basic access via the command line. `rail_vss_generation_timetable_mip_testing` provides access to solving a specified instance at different levels of accuracy and with a predefined timeout.
Currently, the tool provides only basic access via the command line and supports the generation of minimal VSS layouts. More command line functions will be added shortly. Example networks can be found in `test/example-networks/`.

#### MILP based algorithm

`rail_vss_generation_timetable_mip_testing` provides access to solving a specified instance at different levels of accuracy and with a predefined timeout.
It produces additional debugging output and saves the raw model and solution to a file.
The syntax is as follows

Expand All @@ -101,13 +105,39 @@ Hence, the instance _SimpleStation_ can be solved using default values by the fo
.\build\apps\rail_vss_generation_timetable_mip_testing SimpleStation .\test\example-networks\SimpleStation 15 1 0 1 1 0 1 -1
```

More command line functions will be added shortly.
#### Iterative approach

An iterative approach has been implemented, which can significantly improve the runtime. It uses the continuous model for placing VSS borders. The syntax is as follows

```commandline
.\build\apps\rail_vss_generation_timetable_mip_iterative_vss_testing [model_name] [instance_path] [delta_t] [fix_routes] [include_train_dynamics] [include_braking_curves] [use_pwl] [use_schedule_cuts] [iterate_vss] [optimality_strategy] [timeout] [output_path - optional]
```

The parameters meaning is as follows:

- _delta_t_: Length of discretized time intervals in seconds.
- _fix_routes_: If true, the routes are fixed to the ones given in the instance. Otherwise, routing is part of the optimization.
- _include_train_dynamics_: If true, the train dynamics (i.e., limited acceleration and deceleration) are included in the model.
- _include_braking_curves_: If true, the braking curves (i.e., the braking distance depending on the current speed has to be cleared) are included in the model.
- _use_pwl_: If true, the braking distances are approximated by piecewise linear functions with a fixed maximal error. Otherwise, they are modeled as quadratic functions and Gurobi's ability to solve these using spatial branching is used. Only relevant if include_braking_curves is true.
- _use_schedule_cuts_: If true, the formulation is strengthened using cuts implied by the schedule.
- _iterate_vss_: If true, the solver proceeds iteratively, i.e., it will start by trying to solve a restricted model, which is easier to solve, and only slowly increases its size. In many cases, already on such restricted models the optimal solution can be found.
- _optimality_strategy_: 0 (Optimal): The proven optimal solution is found; 1 (TradeOff): The restricted model is solved to optimality. The solution is returned even if it is not proven to be globally optimal. Experiments show that it is likely optimal, but the algorithm provides no guarantee; 2 (Feasible): The algorithm focuses only on finding a (probably good) feasible solution. It is likely not the optimal solution, but only close to optimal. No guarantee is provided.
- _time_limit_: Time limit in seconds. No limit if negative.
- _output_path_: The path in which the solution is written. The default is the current working directory.

Booleans have to be passed as numbers (0 = false or 1 = true).
Hence, the instance _SimpleStation_ can be solved using default values by the following command:

```commandline
.\build\apps\rail_vss_generation_timetable_mip_iterative_vss_testing SimpleStation .\test\example-networks\SimpleStation 15 1 1 1 0 1 1 0 -1
```

#### Access via C++

Additionally, one can call the public methods to create, save, load, and solve respective instances in C++ directly.
For this, we refer to the source code's docstrings and example usages in the Google Tests found in the `test` folder.

Example networks can be found in `test/example-networks/`.

## Contact Information

If you have any questions, feel free to contact us via [email protected] or by creating an issue on GitHub.
Expand Down
2 changes: 2 additions & 0 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ macro(ADD_SIM_EXECUTABLE appname)
endmacro()

add_sim_executable(vss_generation_timetable_mip_testing)
add_sim_executable(vss_generation_timetable_mip_iterative_vss_testing)
add_sim_executable(vss_generation_timetable_iterative_parameter_testing)
99 changes: 99 additions & 0 deletions apps/vss_generation_timetable_iterative_parameter_testing.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
#include "Definitions.hpp"
#include "VSSModel.hpp"
#include "solver/mip-based/VSSGenTimetableSolver.hpp"

#include <gsl/span>

int main(int argc, char** argv) {
if (argc < 13 || argc > 15) {
std::cerr << "Expected 12 or 13 or 14 arguments, got " << argc - 1
<< std::endl;
std::exit(-1);
}

auto args = gsl::span<char*>(argv, argc);

const std::string model_name = args[1];
const std::string instance_path = args[2];
cda_rail::solver::mip_based::VSSGenTimetableSolver solver(instance_path);

std::cout << "Instance " << model_name << " loaded at " << instance_path
<< std::endl;

const int delta_t = std::stoi(args[3]);
const bool fix_routes = std::stoi(args[4]) != 0;
const bool include_braking_curves = std::stoi(args[5]) != 0;
const bool iterate_vss = std::stoi(args[6]) != 0;
const int optimality_strategy_int = std::stoi(args[7]);
const auto optimality_strategy =
static_cast<cda_rail::OptimalityStrategy>(optimality_strategy_int);
const int update_strategy_int = std::stoi(args[8]);
const auto update_strategy =
static_cast<cda_rail::solver::mip_based::UpdateStrategy>(
update_strategy_int);
const double initial_vss = std::stod(args[9]);
const double update_value = std::stod(args[10]);
const bool include_cuts = std::stoi(args[11]) != 0;
const int timeout = std::stoi(args[12]);
const std::string output_path = (argc >= 14 ? args[13] : "");
const std::string file_name =
(argc >= 15
? args[14]
: model_name + "_" + std::to_string(delta_t) + "_" +
std::to_string(static_cast<int>(fix_routes)) + "_" +
std::to_string(static_cast<int>(include_braking_curves)) +
"_" + std::to_string(static_cast<int>(iterate_vss)) + "_" +
std::to_string(optimality_strategy_int) + "_" +
std::to_string(update_strategy_int) + "_" +
std::to_string(initial_vss) + "_" +
std::to_string(update_value) + "_" +
std::to_string(static_cast<int>(include_cuts)) + "_" +
std::to_string(timeout));

std::cout << "The following parameters were passed to the toolkit:"
<< std::endl;
std::cout << " delta_t: " << delta_t << std::endl;
sengels-tum marked this conversation as resolved.
Show resolved Hide resolved
if (fix_routes) {
std::cout << " routes are fixed" << std::endl;
}
if (include_braking_curves) {
std::cout << " braking distance is included" << std::endl;
}
if (iterate_vss) {
std::cout << " VSS is iterated to optimality" << std::endl;
std::cout << " using initial value " << initial_vss << std::endl;
std::cout << " and update value " << update_value << std::endl;
if (update_strategy == cda_rail::solver::mip_based::UpdateStrategy::Fixed) {
std::cout << " with fixed update strategy" << std::endl;
} else if (update_strategy ==
cda_rail::solver::mip_based::UpdateStrategy::Relative) {
std::cout << " with relative update strategy" << std::endl;
} else {
std::cout << " with unknown update strategy" << std::endl;
}
if (include_cuts) {
std::cout << " and cuts are used" << std::endl;
}
}
if (optimality_strategy == cda_rail::OptimalityStrategy::Optimal) {
std::cout << " optimality strategy: optimal" << std::endl;
} else if (optimality_strategy == cda_rail::OptimalityStrategy::TradeOff) {
std::cout << " optimality strategy: trade-off" << std::endl;
} else if (optimality_strategy == cda_rail::OptimalityStrategy::Feasible) {
std::cout << " optimality strategy: feasible" << std::endl;
} else {
std::cout << " optimality strategy: unknown" << std::endl;
}
std::cout << " timeout: " << timeout << "s" << std::endl;
std::cout << " output path: " << output_path << std::endl;
std::cout << " file name: " << file_name << std::endl;

cda_rail::vss::Model vss_model(cda_rail::vss::ModelType::Continuous);

solver.solve(
{delta_t, fix_routes, true, include_braking_curves}, {vss_model},
{iterate_vss, optimality_strategy, update_strategy, initial_vss,
update_value, include_cuts},
{false, cda_rail::ExportOption::ExportSolution, file_name, output_path},
timeout, true);
}
86 changes: 86 additions & 0 deletions apps/vss_generation_timetable_mip_iterative_vss_testing.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
#include "Definitions.hpp"
#include "VSSModel.hpp"
#include "solver/mip-based/VSSGenTimetableSolver.hpp"

#include <gsl/span>

int main(int argc, char** argv) {
Fixed Show fixed Hide fixed
if (argc < 12 || argc > 13) {
std::cerr << "Expected 11 or 12 arguments, got " << argc - 1 << std::endl;
std::exit(-1);
}

auto args = gsl::span<char*>(argv, argc);

const std::string model_name = args[1];
const std::string instance_path = args[2];
cda_rail::solver::mip_based::VSSGenTimetableSolver solver(instance_path);

std::cout << "Instance " << model_name << " loaded at " << instance_path
<< std::endl;

const int delta_t = std::stoi(args[3]);
const bool fix_routes = std::stoi(args[4]) != 0;
const bool include_train_dynamics = std::stoi(args[5]) != 0;
const bool include_braking_curves = std::stoi(args[6]) != 0;
const bool use_pwl = std::stoi(args[7]) != 0;
const bool use_schedule_cuts = std::stoi(args[8]) != 0;
const bool iterate_vss = std::stoi(args[9]) != 0;
const int optimality_strategy_int = std::stoi(args[10]);
const auto optimality_strategy =
static_cast<cda_rail::OptimalityStrategy>(optimality_strategy_int);
const int timeout = std::stoi(args[11]);
const std::string output_path = (argc == 13 ? args[12] : "");

std::cout << "The following parameters were passed to the toolkit:"
<< std::endl;
std::cout << " delta_t: " << delta_t << std::endl;
if (fix_routes) {
std::cout << " routes are fixed" << std::endl;
}
if (include_train_dynamics) {
std::cout << " acceleration and deceleration are included" << std::endl;
}
if (include_braking_curves) {
std::cout << " braking distance is included" << std::endl;
}
if (use_pwl) {
std::cout << " piecewise linear functions are used" << std::endl;
}
if (use_schedule_cuts) {
std::cout << " schedule cuts are used" << std::endl;
}
if (iterate_vss) {
std::cout << " VSS is iterated" << std::endl;
}
if (optimality_strategy == cda_rail::OptimalityStrategy::Optimal) {
std::cout << " optimality strategy: optimal" << std::endl;
} else if (optimality_strategy == cda_rail::OptimalityStrategy::TradeOff) {
std::cout << " optimality strategy: trade-off" << std::endl;
} else if (optimality_strategy == cda_rail::OptimalityStrategy::Feasible) {
std::cout << " optimality strategy: feasible" << std::endl;
} else {
std::cout << " optimality strategy: unknown" << std::endl;
}
std::cout << " timeout: " << timeout << "s" << std::endl;

const std::string file_name =
model_name + "_" + std::to_string(delta_t) + "_" +
std::to_string(static_cast<int>(fix_routes)) + "_" +
std::to_string(static_cast<int>(include_train_dynamics)) + "_" +
std::to_string(static_cast<int>(include_braking_curves)) + "_" +
std::to_string(static_cast<int>(use_pwl)) + "_" +
std::to_string(static_cast<int>(use_schedule_cuts)) + "_" +
std::to_string(static_cast<int>(iterate_vss)) + "_" +
std::to_string(static_cast<int>(optimality_strategy_int)) + "_" +
std::to_string(timeout);

cda_rail::vss::Model vss_model(cda_rail::vss::ModelType::Continuous);

solver.solve(
{delta_t, fix_routes, include_train_dynamics, include_braking_curves},
{vss_model, use_pwl, use_schedule_cuts},
{iterate_vss, optimality_strategy},
{false, cda_rail::ExportOption::ExportSolution, file_name, output_path},
timeout, true);
}
39 changes: 26 additions & 13 deletions apps/vss_generation_timetable_mip_testing.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#include "Definitions.hpp"
#include "VSSModel.hpp"
#include "solver/mip-based/VSSGenTimetableSolver.hpp"

#include <gsl/span>

int main(int argc, char** argv) {
if (argc != 11) {
std::cout << "Expected 10 arguments, got " << argc - 1 << std::endl;
if (argc < 11 || argc > 12) {
std::cerr << "Expected 10 or 11 arguments, got " << argc - 1 << std::endl;
std::exit(-1);
}

Expand All @@ -17,14 +19,15 @@ int main(int argc, char** argv) {
std::cout << "Instance " << model_name << " loaded at " << instance_path
<< std::endl;

const int delta_t = std::stoi(args[3]);
const bool fix_routes = std::stoi(args[4]) != 0;
const bool discretize_vss_positions = std::stoi(args[5]) != 0;
const bool include_train_dynamics = std::stoi(args[6]) != 0;
const bool include_braking_curves = std::stoi(args[7]) != 0;
const bool use_pwl = std::stoi(args[8]) != 0;
const bool use_schedule_cuts = std::stoi(args[9]) != 0;
const int timeout = std::stoi(args[10]);
const int delta_t = std::stoi(args[3]);
const bool fix_routes = std::stoi(args[4]) != 0;
const bool discretize_vss_positions = std::stoi(args[5]) != 0;
const bool include_train_dynamics = std::stoi(args[6]) != 0;
const bool include_braking_curves = std::stoi(args[7]) != 0;
const bool use_pwl = std::stoi(args[8]) != 0;
const bool use_schedule_cuts = std::stoi(args[9]) != 0;
const int timeout = std::stoi(args[10]);
const std::string output_path = (argc == 12 ? args[11] : "");

std::cout << "The following parameters were passed to the toolkit:"
<< std::endl;
Expand Down Expand Up @@ -59,7 +62,17 @@ int main(int argc, char** argv) {
std::to_string(static_cast<int>(use_schedule_cuts)) + "_" +
std::to_string(timeout);

solver.solve(delta_t, fix_routes, discretize_vss_positions,
include_train_dynamics, include_braking_curves, use_pwl,
use_schedule_cuts, timeout, true, true, file_name);
cda_rail::vss::Model vss_model =
discretize_vss_positions
? cda_rail::vss::Model(cda_rail::vss::ModelType::Discrete,
{&cda_rail::vss::functions::uniform})
: cda_rail::vss::Model(cda_rail::vss::ModelType::Continuous);

solver.solve(
{delta_t, fix_routes, include_train_dynamics, include_braking_curves},
{vss_model, use_pwl, use_schedule_cuts},
{false, cda_rail::OptimalityStrategy::Optimal},
{false, cda_rail::ExportOption::ExportSolutionWithInstance, file_name,
output_path},
timeout, true);
}
1 change: 1 addition & 0 deletions include/CustomExceptions.hpp
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#pragma once
#include <exception>
#include <string>
#include <utility>
Expand Down
Loading