1#ifndef CDA_RAIL_SIMULATOR_GREEDYHEURISTIC_HPP
2#define CDA_RAIL_SIMULATOR_GREEDYHEURISTIC_HPP
31 "Unknown remaining-time heuristic type");
46[[nodiscard]]
inline double
48 const std::vector<double>& tr_exit_times,
49 const std::vector<std::vector<double>>& stop_times) {
84 bool consider_earliest_exit);
110 bool consider_earliest_exit) {
115 .remaining_exit_time = 0.0,
116 .average_remaining_stop_delay = 0.0,
120 consider_earliest_exit);
124 "This code should not have been reachable...");
159 bool consider_earliest_exit);
182 bool consider_earliest_exit);
Thrown when a consistency check fails.
Definition CustomExceptions.hpp:80
Definition EventSimulator.hpp:25
RemainingTimeHeuristicResult remaining_time_heuristic(RemainingTimeHeuristicType type, size_t tr, const instances::GeneralPerformanceOptimizationInstance &instance, const SimulatorState &state, double tr_exit_time, bool consider_earliest_exit)
Computes a remaining-time heuristic estimate using the selected strategy.
Definition GreedyHeuristic.hpp:106
constexpr std::string remaining_time_heuristic_type_to_string(RemainingTimeHeuristicType const type)
The name of type, as it is reported and parsed.
Definition GreedyHeuristic.hpp:23
RemainingTimeHeuristicType
Which lower bound on the remaining time the A* search uses.
Definition GreedyHeuristic.hpp:20
@ Simple
Definition GreedyHeuristic.hpp:20
@ Zero
Definition GreedyHeuristic.hpp:20
RemainingTimeHeuristicResult simple_remaining_time_heuristic(size_t tr, const instances::GeneralPerformanceOptimizationInstance &instance, const SimulatorState &state, double tr_exit_time, bool consider_earliest_exit)
Computes the simple remaining-time heuristic for one train.
Definition GreedyHeuristic.cpp:15
HeuristicResult full_greedy_heuristic(RemainingTimeHeuristicType remaining_time_heuristic_type, const instances::GeneralPerformanceOptimizationInstance &instance, const SimulatorState &state, const SimulatorResults &sim_results, bool consider_earliest_exit)
Computes a weighted-sum objective-value difference for all trains.
Definition GreedyHeuristic.cpp:121
HeuristicResult greedy_heuristic(RemainingTimeHeuristicType remaining_time_heuristic_type, size_t tr, const instances::GeneralPerformanceOptimizationInstance &instance, const SimulatorState &state, double tr_exit_time, bool consider_earliest_exit)
Combines braking-time and remaining-time heuristics into a single objective-value difference for a tr...
Definition GreedyHeuristic.cpp:105
double objective_val(const instances::GeneralPerformanceOptimizationInstance &instance, const std::vector< double > &tr_exit_times, const std::vector< std::vector< double > > &stop_times)
Computes the objective value based on train exit times and stop times.
Definition GreedyHeuristic.hpp:47
A lower bound on how much the objective still increases.
Definition GreedyHeuristic.hpp:132
double objective_value_difference
Definition GreedyHeuristic.hpp:134
bool feasible
Definition GreedyHeuristic.hpp:133
What a remaining-time heuristic estimates for one train.
Definition GreedyHeuristic.hpp:64
double remaining_exit_time
Definition GreedyHeuristic.hpp:66
double average_remaining_stop_delay
Definition GreedyHeuristic.hpp:67
bool feasible
Definition GreedyHeuristic.hpp:65
What a simulation run produced.
Definition GeneralSimulator.hpp:51
Everything a simulation run needs beyond the instance itself.
Definition GeneralSimulator.hpp:74