MTCT
Design Automation and Optimization for ETCS Railway Networks
Loading...
Searching...
No Matches
GenPOMovingBlockMIPSolver.hpp
Go to the documentation of this file.
1#ifndef CDA_RAIL_SOLVER_MIP_BASED_GENPOMOVINGBLOCKMIPSOLVER_HPP
2#define CDA_RAIL_SOLVER_MIP_BASED_GENPOMOVINGBLOCKMIPSOLVER_HPP
3
5#include "Definitions.hpp"
8#include "gurobi_c++.h"
13
14// NOLINTNEXTLINE(misc-include-cleaner)
15#include "gtest/gtest_prod.h"
16#include <algorithm>
17#include <cstddef>
18#include <cstdint>
19#include <exception>
20#include <functional>
21#include <map>
22#include <optional>
23#include <string>
24#include <tuple>
25#include <unordered_map>
26#include <utility>
27#include <vector>
28
29// If TEST_FRIENDS has value true, the corresponding test is friended to test
30// complex private functions
31// This is not good practice, however after consideration, it was decided that
32// - it is not reasonable to make the functions public, because they are only
33// needed to build the model
34// - they have a complexity that should be tested
35// - by only testing the overall solution, there is too much code tested at once
36#ifndef TEST_FRIENDS
37#define TEST_FRIENDS false
38#endif
39#if TEST_FRIENDS
40class GenPOMovingBlockMIPSolver_PrivateFillFunctions_Test;
41class GenPOMovingBlockMIPSolver_WarmStartIsFeasible_Test;
42class GenPOMovingBlockMIPSolver_WarmStartRoutesTrainWithoutRoute_Test;
43class GenPOMovingBlockMIPSolver_NoWarmStartIfFixedRouteMissesStop_Test;
44class GenPOMovingBlockMIPSolver_NoWarmStartWithoutModelVelocities_Test;
45class GenPOMovingBlockMIPSolver_RelaxationStateFollowsHighestEdges_Test;
46class GenPOMovingBlockMIPSolver_RelaxationStateServesStopsOnRoute_Test;
47class GenPOMovingBlockMIPSolver_RelaxationStateBreaksTiesByEdgeIndex_Test;
48class GenPOMovingBlockMIPSolver_RelaxationStateSkipsEdgesOnRoute_Test;
49class GenPOMovingBlockMIPSolver_CompleteRelaxationKeepsOnlyBetterSolutions_Test;
50class GenPOMovingBlockMIPSolver_SimulateStateFailsWithoutSimulation_Test;
51class
52 GenPOMovingBlockMIPSolver_SimulatedIncumbentOnlyReplacesWorseSolutions_Test;
53class GenPOMovingBlockMIPSolver_SimulatedIncumbentWithoutGurobiBound_Test;
54class GenPOMovingBlockMIPSolver_CompletionsUseTheirTimeStep_Test;
55class GenPOMovingBlockMIPSolver_CompletionStopsOnceIncumbentWithinGap_Test;
56class GenPOMovingBlockMIPSolver_NodeCompletionsImproveSimulatedIncumbent_Test;
57class GenPOMovingBlockMIPSolver_SmallCoefficientsAreRemoved_Test;
58class GenPOMovingBlockMIPSolver_LazyCallbackStopsOnException_Test;
59#endif
60
62
63using std::size_t;
64
66constexpr std::string
68 switch (strategy) {
70 return "None";
72 return "MinOneStep";
73 default:
75 "Unknown velocity refinement strategy");
76 }
77}
78
79// The maximal delay is the time horizon of the model and with it the big-M of
80// all timing constraints. A big-M of size M turns the tolerance eps with which
81// a solver still accepts a binary variable as integral into a slack of M * eps
82// seconds within the corresponding constraint. A horizon that is numerically
83// infinite hence voids the travel times altogether, which is why the default
84// is a large but finite one. A delay of more than a day is not to be expected
85// in any realistic instance.
86constexpr double DEFAULT_MAX_DELAY = 24 * 60 * 60; // one day
87
88// Default time step in seconds with which the completions of
89// SolverStrategyMovingBlock are simulated, the default of the A* search, see
90// simulator::GeneralSimulator::simulate
91constexpr double DEFAULT_COMPLETION_DT = 6.0;
92
93// Smallest and default integrality tolerance supported by Gurobi.
94constexpr double MIN_INT_FEAS_TOL = 1e-9;
95constexpr double DEFAULT_INT_FEAS_TOL = 1e-5;
96
105 bool fix_routes = false;
106 double max_velocity_delta = 5.55; // 20 km/h
111 bool allow_late_entry = false;
112 // Bound every timing variable by the earliest time at which the
113 // corresponding event can happen, i.e. by the minimal running time the train
114 // needs to get there, including the stops it has to serve on the way.
115 // Without these bounds the only lower bound on the
116 // objective is the scheduled timetable, and since everything that forces a
117 // train to travel at all is a big-M constraint, the LP relaxation is then
118 // free of any running time. Disabling this is only useful to measure the
119 // effect.
123};
124
140
144 switch (strategy) {
146 return "OnlyFirstFound";
148 return "OnlyViolated";
150 return "AllChecked";
151 default:
153 "Unknown lazy constraint selection strategy");
154 }
155}
156
164enum class LazyTrainSelectionStrategy : std::uint8_t {
166 All = 1,
167};
168
170constexpr std::string
172 switch (strategy) {
174 return "OnlyAdjacent";
176 return "All";
177 default:
179 "Unknown lazy train selection strategy");
180 }
181}
182
205enum class LazyVelocitySelectionStrategy : std::uint8_t {
208 All = 2,
209};
210
214 switch (strategy) {
216 return "OnlyCurrent";
218 return "ExtendToHigher";
220 return "All";
221 default:
223 "Unknown lazy velocity selection strategy");
224 }
225}
226
263
278 : public GeneralMIPSolver<
279 instances::GeneralPerformanceOptimizationInstance,
280 instances::SolGeneralPerformanceOptimizationInstance> {
281private:
282#if TEST_FRIENDS
283 FRIEND_TEST(::GenPOMovingBlockMIPSolver, PrivateFillFunctions);
284 FRIEND_TEST(::GenPOMovingBlockMIPSolver, WarmStartIsFeasible);
285 FRIEND_TEST(::GenPOMovingBlockMIPSolver, WarmStartRoutesTrainWithoutRoute);
286 FRIEND_TEST(::GenPOMovingBlockMIPSolver, NoWarmStartIfFixedRouteMissesStop);
287 FRIEND_TEST(::GenPOMovingBlockMIPSolver, NoWarmStartWithoutModelVelocities);
288 FRIEND_TEST(::GenPOMovingBlockMIPSolver, RelaxationStateFollowsHighestEdges);
289 FRIEND_TEST(::GenPOMovingBlockMIPSolver, RelaxationStateServesStopsOnRoute);
290 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
291 RelaxationStateBreaksTiesByEdgeIndex);
292 FRIEND_TEST(::GenPOMovingBlockMIPSolver, RelaxationStateSkipsEdgesOnRoute);
293 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
294 CompleteRelaxationKeepsOnlyBetterSolutions);
295 FRIEND_TEST(::GenPOMovingBlockMIPSolver, SimulateStateFailsWithoutSimulation);
296 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
297 SimulatedIncumbentOnlyReplacesWorseSolutions);
298 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
299 SimulatedIncumbentWithoutGurobiBound);
300 FRIEND_TEST(::GenPOMovingBlockMIPSolver, CompletionsUseTheirTimeStep);
301 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
302 CompletionStopsOnceIncumbentWithinGap);
303 FRIEND_TEST(::GenPOMovingBlockMIPSolver,
304 NodeCompletionsImproveSimulatedIncumbent);
305 FRIEND_TEST(::GenPOMovingBlockMIPSolver, SmallCoefficientsAreRemoved);
306 FRIEND_TEST(::GenPOMovingBlockMIPSolver, LazyCallbackStopsOnException);
307#endif
308
309 SolutionSettingsMovingBlock m_solution_settings = {};
310 ModelDetailMovingBlock m_model_detail = {};
311 SolverStrategyMovingBlock m_solver_strategy = {};
312 size_t m_num_tr = 0;
313 size_t m_num_edges = 0;
314 size_t m_num_vertices = 0;
315 size_t m_num_ttd = 0;
316 // int m_max_t = 0;
317 std::vector<cda_rail::index_set> m_ttd_sections;
318 // tr_stop_data:
319 // For every train, for every station, list of possible stop vertices together
320 // with respective edges
321 std::vector<std::vector<
322 std::vector<std::pair<size_t, std::vector<cda_rail::index_vector>>>>>
323 m_tr_stop_data;
324 std::vector<std::vector<std::vector<double>>> m_velocity_extensions;
325 std::vector<std::pair<size_t, size_t>> m_relevant_reverse_edges;
326 // Earliest time at which the front of a train can arrive at a vertex, by
327 // train and vertex. All zero if
328 // ModelDetailMovingBlock::use_minimum_time_bounds is not set.
329 std::vector<std::vector<double>> m_minimum_arrival_times;
330 // Time the rear of a train needs to reach a vertex after its front, by
331 // train. All zero if ModelDetailMovingBlock::use_minimum_time_bounds is not
332 // set.
333 std::vector<double> m_minimum_clearing_times;
334 // Earliest time at which the rear of a train can leave its exit vertex, by
335 // train. At least the scheduled exit time.
336 std::vector<double> m_minimum_exit_times;
337 // Earliest service delay of a scheduled stop, by train and stop. All zero if
338 // ModelDetailMovingBlock::use_minimum_time_bounds is not set.
339 std::vector<std::vector<double>> m_minimum_service_delays;
340
347 void initialize_variables(
348 const SolutionSettingsMovingBlock& solution_settings_input,
349 const SolverStrategyMovingBlock& solver_strategy_input,
350 const ModelDetailMovingBlock& model_detail_input);
357 struct SolveStatistics {
358 // Number of lazy constraints handed to Gurobi during the solve. A
359 // constraint added before is handed over again only if the offered
360 // solution violates it, and then counts again. Zero without lazy
361 // constraints.
362 int num_lazy_constraints_added = -1;
363 // Number of linear constraints (rows) of the created model, i.e., without
364 // the lazy constraints and without general constraints such as indicator
365 // constraints.
366 int model_num_rows = -1;
367 // Number of variables (columns) of the created model.
368 int model_num_columns = -1;
369 // Number of branch-and-bound nodes Gurobi explored.
370 double node_count = -1;
371 // Number of completions tried, including the initial one, and of those
372 // that the simulator could complete within the delay bounds, see
373 // SolverStrategyMovingBlock::completion_interval. Zero without
374 // completions.
375 int completions_attempted = -1;
376 int completions_found = -1;
377 // Whether the returned solution is a simulated one rather than one of
378 // Gurobi.
379 bool simulated_solution = false;
380 };
396 [[nodiscard]] static FurtherData
397 get_further_data(const ModelDetailMovingBlock& model_detail,
398 const SolverStrategyMovingBlock& solver_strategy,
399 const SolutionSettingsMovingBlock& solution_settings,
400 int time_limit, const SolveStatistics& statistics);
401
403 [[nodiscard]] double latest_exit_time(size_t tr) const;
405 [[nodiscard]] double minimum_arrival_time(size_t tr, size_t v) const {
406 return m_minimum_arrival_times.at(tr).at(v);
407 };
412 [[nodiscard]] double minimum_stop_arrival_time(size_t tr, size_t stop) const;
413 // Between the front and the rear of a train passing a vertex, the train
414 // covers its own length, which takes at least its length divided by its
415 // maximal speed.
416 [[nodiscard]] double minimum_rear_departure_time(size_t tr, size_t v) const {
417 return std::min(minimum_arrival_time(tr, v) +
418 m_minimum_clearing_times.at(tr),
419 latest_exit_time(tr));
420 };
421
423 void fill_minimum_time_bounds();
425 void fill_tr_stop_data();
427 void fill_relevant_reverse_edges();
429 void fill_velocity_extensions();
431 void fill_velocity_extensions_using_none_strategy();
433 void fill_velocity_extensions_using_min_one_step_strategy();
434
436 [[nodiscard]] size_t get_maximal_velocity_extension_size() const;
437
446 [[nodiscard]] std::tuple<double, GRBLinExpr, double, GRBLinExpr>
447 get_vertex_headway_expressions(size_t tr, size_t e);
455 [[nodiscard]] std::tuple<double, GRBLinExpr, double, GRBLinExpr>
456 get_edge_headway_expressions(size_t tr, size_t e);
457
464 void create_model(const SolutionSettingsMovingBlock& solution_settings_input,
465 const SolverStrategyMovingBlock& solver_strategy_input,
466 const ModelDetailMovingBlock& model_detail_input);
474 void remove_small_coefficients();
476 void create_variables();
478 void create_timing_variables();
480 void create_general_edge_variables();
482 void create_stop_variables();
484 void create_velocity_extended_variables();
489 void create_reverse_edge_variables();
490
492 void set_objective();
493
495 void create_constraints();
497 void create_general_path_constraints();
499 void create_travel_times_constraints();
501 void create_basic_order_constraints();
503 void create_basic_ttd_constraints();
505 void create_train_rear_constraints();
507 void create_reverse_edge_constraints();
509 void create_stopping_constraints();
511 void create_vertex_headway_constraints();
513 void create_headway_constraints();
521 void create_simplified_headway_constraints();
522
523 // Helper for headway normal and lazy constraints
524 [[nodiscard]] GRBLinExpr
525 get_edge_path_expr(size_t tr, const cda_rail::index_vector& p,
526 double initial_velocity,
527 bool also_higher_velocities = false);
528
530 void extract_solution(
533 [[nodiscard]] double extract_speed(size_t tr, size_t vertex_id) const;
535 [[nodiscard]] double extract_stop_time(size_t tr, size_t stop_idx) const;
548 static double headway(const Train& tr_obj, const Edge& e_obj, double v_1,
549 double v_2, bool entry_vertex = false);
550
563 [[nodiscard]] std::optional<simulator::SimulatorState>
564 completed_initial_state() const;
575 struct VertexPassing {
576 double departure;
577 double velocity;
578 bool stands_still;
579 };
596 [[nodiscard]] std::optional<std::vector<size_t>>
597 velocity_indices(size_t tr, const cda_rail::index_vector& route,
598 const std::vector<VertexPassing>& passings) const;
600 struct SimulatedSolution {
603 double obj;
604 };
605 // The best simulated solution so far, see
606 // SolverStrategyMovingBlock::completion_interval
607 std::optional<SimulatedSolution> m_simulated_incumbent;
608 // The row bounding the objective by the initial simulated solution, see
609 // solve(). Removed before the model is exported.
610 std::optional<GRBConstr> m_incumbent_constraint;
611
620 [[nodiscard]] std::optional<SimulatedSolution>
621 simulate_state(simulator::SimulatorState state) const;
639 [[nodiscard]] std::optional<std::vector<std::pair<GRBVar, double>>>
640 integer_values(const SimulatedSolution& solution);
654 std::optional<SimulatedSolution> set_warm_start();
670 [[nodiscard]] simulator::SimulatorState
671 relaxation_state(const std::function<double(const GRBVar&)>& value) const;
682 [[nodiscard]] std::optional<bool>
683 complete_relaxation(const std::function<double(const GRBVar&)>& value);
697 bool use_simulated_incumbent(
699
700 class LazyCallback : public MessageCallback {
701 private:
703 struct LazyConstraint {
704 GRBLinExpr lhs;
705 GRBLinExpr rhs;
706 };
707
709 enum class LazyConstraintKind : std::uint8_t {
710 VertexHeadway = 0,
711 EdgeHeadway = 1,
712 TtdHeadway = 2,
713 ReverseEdge = 3,
714 SimplifiedEdge = 4,
715 SimplifiedTtd = 5,
716 };
717
719 // The lazy constraints added so far, by a key that identifies how they
720 // were created, see add_lazy_constraints().
721 std::map<std::vector<size_t>, std::vector<LazyConstraint>>
722 m_added_lazy_constraints;
723 // Gurobi's feasibility tolerance, with which a constraint that was added
724 // before counts as violated.
725 double m_feasibility_tolerance = 0;
726 // Number of addLazy() calls so far, see
727 // SolveStatistics::num_lazy_constraints_added.
728 int m_num_lazy_constraints_added = 0;
729 // Number of node relaxations reported so far, see
730 // complete_node_relaxation().
731 size_t m_num_relaxations = 0;
732 // See SolveStatistics::completions_attempted and completions_found,
733 // without the initial completion.
734 int m_completions_attempted = 0;
735 int m_completions_found = 0;
736 // An exception thrown while checking a solution. An exception must not
737 // leave the callback, since it cannot pass Gurobi. Hence, the callback
738 // stops the optimization instead, and solve() rethrows it afterwards.
739 std::exception_ptr m_exception;
740
760 template <typename CreateConstraints>
761 [[nodiscard]] bool add_lazy_constraints(LazyConstraintKind kind,
762 std::vector<size_t> key,
763 const CreateConstraints& create);
765 [[nodiscard]] double get_solution_value(const GRBLinExpr& expr);
767 [[nodiscard]] size_t velocity_index(size_t tr, size_t v, double vel) const;
768
770 struct MovingAuthorityEnd {
771 // The edges from the vertex the train passes up to the one the moving
772 // authority ends on
774 // The distance of the end from the source of the last of these edges
775 double pos_on_edge;
776 };
787 [[nodiscard]] MovingAuthorityEnd
788 moving_authority_end(const std::vector<std::pair<size_t, double>>& route,
789 size_t r_v_idx, double braking_distance) const;
809 [[nodiscard]] bool
810 add_lazy_edge_headway_constraints(size_t tr, size_t other_tr, size_t v_idx,
811 double vel,
812 const MovingAuthorityEnd& ma_end);
813
820 std::vector<std::vector<std::pair<size_t, double>>> get_routes();
821 std::vector<std::unordered_map<size_t, double>> get_train_velocities(
822 const std::vector<std::vector<std::pair<size_t, double>>>& routes);
823 std::vector<std::pair<std::vector<std::pair<size_t, bool>>,
824 std::vector<std::pair<size_t, bool>>>>
825 get_train_orders_on_edges(
826 const std::vector<std::vector<std::pair<size_t, double>>>& routes);
827 std::vector<cda_rail::index_vector> get_train_orders_on_ttd();
828
829 bool create_lazy_edge_and_ttd_headway_constraints(
830 const std::vector<std::vector<std::pair<size_t, double>>>& routes,
831 const std::vector<std::unordered_map<size_t, double>>& train_velocities,
832 const std::vector<std::pair<std::vector<std::pair<size_t, bool>>,
833 std::vector<std::pair<size_t, bool>>>>&
834 train_orders_on_edges,
835 const std::vector<cda_rail::index_vector>& train_orders_on_ttd);
836 bool create_lazy_simplified_edge_constraints(
837 const std::vector<std::vector<std::pair<size_t, double>>>& routes,
838 const std::vector<std::unordered_map<size_t, double>>& train_velocities,
839 const std::vector<std::pair<std::vector<std::pair<size_t, bool>>,
840 std::vector<std::pair<size_t, bool>>>>&
841 train_orders_on_edges,
842 const std::vector<cda_rail::index_vector>& train_orders_on_ttd);
843 bool create_lazy_vertex_headway_constraints(
844 const std::vector<std::vector<std::pair<size_t, double>>>& routes,
845 const std::vector<std::unordered_map<size_t, double>>& train_velocities,
846 const std::vector<std::pair<std::vector<std::pair<size_t, bool>>,
847 std::vector<std::pair<size_t, bool>>>>&
848 train_orders_on_edges);
849 bool create_lazy_reverse_edge_constraints(
850 const std::vector<std::pair<std::vector<std::pair<size_t, bool>>,
851 std::vector<std::pair<size_t, bool>>>>&
852 train_orders_on_edges);
853
865 void complete_node_relaxation();
866
867 public:
868 explicit LazyCallback(GenPOMovingBlockMIPSolver* solver) : solver(solver) {}
869
871 [[nodiscard]] int get_completions_attempted() const {
872 return m_completions_attempted;
873 }
875 [[nodiscard]] int get_completions_found() const {
876 return m_completions_found;
877 }
878
880 [[nodiscard]] int get_num_lazy_constraints_added() const {
881 return m_num_lazy_constraints_added;
882 }
883
890 [[nodiscard]] std::exception_ptr get_exception() const {
891 return m_exception;
892 }
893
894 protected:
895 void callback() override;
896 };
897
898protected:
899 void cleanup() override;
900
901public:
903
906 : GeneralMIPSolver<instances::GeneralPerformanceOptimizationInstance,
907 instances::SolGeneralPerformanceOptimizationInstance>(
908 instance) {};
909
910 template <typename... Args>
911 explicit GenPOMovingBlockMIPSolver(Args&&... args)
912 requires(!IsSingleInstanceArgument<Args...>::value)
913 : GeneralMIPSolver(std::forward<Args>(args)...) {}
914
915 ~GenPOMovingBlockMIPSolver() override = default;
916
919 solve(int time_limit, bool debug_input, bool overwrite_severity) override {
920 return solve({}, {}, {}, time_limit, debug_input, overwrite_severity);
921 };
922
940 solve(const ModelDetailMovingBlock& model_detail_input,
941 const SolverStrategyMovingBlock& solver_strategy_input,
942 const SolutionSettingsMovingBlock& solution_settings_input,
943 int time_limit = -1, bool debug_input = false,
944 bool overwrite_severity = true);
945};
946
947} // namespace cda_rail::solver::mip_based
948
949#endif // CDA_RAIL_SOLVER_MIP_BASED_GENPOMOVINGBLOCKMIPSOLVER_HPP
Properties and characteristics of a train.
Definition Train.hpp:26
Thrown when a consistency check fails.
Definition CustomExceptions.hpp:80
An instance in which the trains are routed as efficiently as possible.
Definition GeneralPerformanceOptimizationInstance.hpp:95
The trajectories a solver found for a performance optimization instance.
Definition GeneralPerformanceOptimizationInstance.hpp:641
S solve()
Solves the problem instance using default configuration.
Definition GeneralSolver.hpp:314
GenPOMovingBlockMIPSolver(Args &&... args)
Definition GenPOMovingBlockMIPSolver.hpp:911
instances::SolGeneralPerformanceOptimizationInstance solve(int time_limit, bool debug_input, bool overwrite_severity) override
Definition GenPOMovingBlockMIPSolver.hpp:919
GenPOMovingBlockMIPSolver(const instances::GeneralPerformanceOptimizationInstance &instance)
Definition GenPOMovingBlockMIPSolver.hpp:904
S solve()
Solves the problem instance using default configuration.
Definition GeneralSolver.hpp:314
void cleanup() override
Releases the model and the environment after solving.
Definition GenPOMovingBlockMIPSolver.cpp:3263
Routes the output of Gurobi into the logging of this tool.
Definition GeneralMIPSolver.hpp:59
void callback() override
Logs one message of Gurobi, without its trailing newline.
Definition GeneralMIPSolver.hpp:65
Definition GeneralPerformanceOptimizationInstance.hpp:41
Definition GeneralMIPSolver.hpp:17
constexpr std::string velocity_refinement_strategy_to_string(VelocityRefinementStrategy strategy)
The name of strategy, as it is reported and parsed.
Definition GenPOMovingBlockMIPSolver.hpp:67
LazyVelocitySelectionStrategy
For which velocities the lazy callback adds a headway constraint between two trains on an edge.
Definition GenPOMovingBlockMIPSolver.hpp:205
@ All
Definition GenPOMovingBlockMIPSolver.hpp:208
@ OnlyCurrent
Definition GenPOMovingBlockMIPSolver.hpp:206
@ ExtendToHigher
Definition GenPOMovingBlockMIPSolver.hpp:207
LazyConstraintSelectionStrategy
Which of the headway constraints the lazy callback adds.
Definition GenPOMovingBlockMIPSolver.hpp:135
@ OnlyViolated
Definition GenPOMovingBlockMIPSolver.hpp:137
@ AllChecked
Definition GenPOMovingBlockMIPSolver.hpp:138
@ OnlyFirstFound
Definition GenPOMovingBlockMIPSolver.hpp:136
constexpr std::string lazy_constraint_selection_strategy_to_string(LazyConstraintSelectionStrategy strategy)
The name of strategy, as it is reported and parsed.
Definition GenPOMovingBlockMIPSolver.hpp:142
constexpr double DEFAULT_INT_FEAS_TOL
Definition GenPOMovingBlockMIPSolver.hpp:95
constexpr double DEFAULT_MAX_DELAY
Definition GenPOMovingBlockMIPSolver.hpp:86
LazyTrainSelectionStrategy
Which train pairs the lazy callback checks against each other.
Definition GenPOMovingBlockMIPSolver.hpp:164
@ OnlyAdjacent
Definition GenPOMovingBlockMIPSolver.hpp:165
@ All
Definition GenPOMovingBlockMIPSolver.hpp:166
SolutionSettingsMIP SolutionSettingsMovingBlock
Export settings of the moving block MIP solver.
Definition GeneralMIPSolver.hpp:39
constexpr double MIN_INT_FEAS_TOL
Definition GenPOMovingBlockMIPSolver.hpp:94
constexpr double DEFAULT_COMPLETION_DT
Definition GenPOMovingBlockMIPSolver.hpp:91
constexpr std::string lazy_train_selection_strategy_to_string(LazyTrainSelectionStrategy strategy)
The name of strategy, as it is reported and parsed.
Definition GenPOMovingBlockMIPSolver.hpp:171
constexpr std::string lazy_velocity_selection_strategy_to_string(LazyVelocitySelectionStrategy strategy)
The name of strategy, as it is reported and parsed.
Definition GenPOMovingBlockMIPSolver.hpp:212
Definition CompletionHeuristic.hpp:10
VelocityRefinementStrategy
How the discrete velocities of a vertex are chosen.
Definition Definitions.hpp:99
@ MinOneStep
Definition Definitions.hpp:101
@ None
Definition Definitions.hpp:100
std::vector< size_t > index_vector
Definition Definitions.hpp:21
double braking_distance(double v, double d)
Helpers for 1D train motion under constant-acceleration bounds.
Definition EOMHelper.cpp:182
Represents a directed edge in the railway network graph.
Definition RailwayNetwork.hpp:79
What a simulation run produced.
Definition GeneralSimulator.hpp:51
Everything a simulation run needs beyond the instance itself.
Definition GeneralSimulator.hpp:74
How accurately the moving block MIP models the operation.
Definition GenPOMovingBlockMIPSolver.hpp:104
bool strengthen_vertex_headway_constraints
Definition GenPOMovingBlockMIPSolver.hpp:110
bool use_minimum_time_bounds
Definition GenPOMovingBlockMIPSolver.hpp:120
double max_velocity_delta
Definition GenPOMovingBlockMIPSolver.hpp:106
VelocityRefinementStrategy velocity_refinement_strategy
Definition GenPOMovingBlockMIPSolver.hpp:107
double max_exit_delay
Definition GenPOMovingBlockMIPSolver.hpp:121
bool fix_routes
Definition GenPOMovingBlockMIPSolver.hpp:105
bool allow_late_entry
Definition GenPOMovingBlockMIPSolver.hpp:111
bool simplify_headway_constraints
Definition GenPOMovingBlockMIPSolver.hpp:109
double max_station_delay
Definition GenPOMovingBlockMIPSolver.hpp:122
How the moving block MIP is handed to and solved by Gurobi.
Definition GenPOMovingBlockMIPSolver.hpp:248
LazyTrainSelectionStrategy lazy_train_selection_strategy
Definition GenPOMovingBlockMIPSolver.hpp:257
double abs_mip_gap
Definition GenPOMovingBlockMIPSolver.hpp:259
LazyVelocitySelectionStrategy lazy_velocity_selection_strategy
Definition GenPOMovingBlockMIPSolver.hpp:253
size_t completion_interval
Definition GenPOMovingBlockMIPSolver.hpp:260
double completion_dt
Definition GenPOMovingBlockMIPSolver.hpp:261
bool use_indicator_constraints
Definition GenPOMovingBlockMIPSolver.hpp:249
LazyConstraintSelectionStrategy lazy_constraint_selection_strategy
Definition GenPOMovingBlockMIPSolver.hpp:255
bool use_lazy_constraints
Definition GenPOMovingBlockMIPSolver.hpp:250
bool include_reverse_headways
Definition GenPOMovingBlockMIPSolver.hpp:252