MTCT
Design Automation and Optimization for ETCS Railway Networks
Loading...
Searching...
No Matches
cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver Class Reference

Routes the trains of a moving block instance by a MILP. More...

#include <GenPOMovingBlockMIPSolver.hpp>

Inheritance diagram for cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver:
cda_rail::solver::mip_based::GeneralMIPSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance > cda_rail::solver::GeneralSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >

Public Member Functions

 GenPOMovingBlockMIPSolver ()=default
 GenPOMovingBlockMIPSolver (const instances::GeneralPerformanceOptimizationInstance &instance)
template<typename... Args>
requires (!IsSingleInstanceArgument<Args...>::value)
 GenPOMovingBlockMIPSolver (Args &&... args)
 ~GenPOMovingBlockMIPSolver () override=default
instances::SolGeneralPerformanceOptimizationInstance solve (int time_limit, bool debug_input, bool overwrite_severity) override
instances::SolGeneralPerformanceOptimizationInstance solve (const ModelDetailMovingBlock &model_detail_input, const SolverStrategyMovingBlock &solver_strategy_input, const SolutionSettingsMovingBlock &solution_settings_input, int time_limit=-1, bool debug_input=false, bool overwrite_severity=true)
 Solves the instance under moving block signaling.
S solve ()
 Solves the problem instance using default configuration.
S solve (int time_limit, bool debug_input)
 Solves the problem instance.
Public Member Functions inherited from cda_rail::solver::GeneralSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >
const nlohmann::json & get_solver_data () const
 The solver data of the last solve, as written to solver_data.json if the solution is exported, so that it can be exported later. Null before the first solve.
const instances::GeneralPerformanceOptimizationInstance & get_instance () const
 Accesses the problem instance stored in this solver.
instances::GeneralPerformanceOptimizationInstance & editable_instance ()
 Provides mutable access to the problem instance.
instances::SolGeneralPerformanceOptimizationInstance solve ()
 Solves the problem instance using default configuration.
virtual ~GeneralSolver ()=default
 Virtual destructor.

Protected Member Functions

void cleanup () override
 Releases the model and the environment after solving.
Protected Member Functions inherited from cda_rail::solver::mip_based::GeneralMIPSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >
void solve_init_general_mip (bool debug_input, bool overwrite_severity)
 Initializes the model with the default message callback.
 GeneralMIPSolver ()=default
 Constructs a solver with a default-initialized problem instance.
Protected Member Functions inherited from cda_rail::solver::GeneralSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >
void solve_init_general (bool debug_input, bool overwrite_severity)
 Initializes logging and records solver start time.
 GeneralSolver ()=default
 Constructs a solver with a default-initialized problem instance.
nlohmann::json solver_data (FurtherData const &further_data) const
 Solver data, i.e., timing and further information (e.g. iterations, nodes, etc.), as written to solver_data.json.
void export_solver_data (std::filesystem::path const &export_directory, FurtherData const &further_data={})
 Exports solver data, see solver_data, into solver_data.json.
std::optional< std::filesystem::path > export_general_solution (instances::SolGeneralPerformanceOptimizationInstance &solution, const GeneralSolutionSettings &solution_settings, FurtherData const &further_data={})
 Exports the solution together with the solver data if requested.

Additional Inherited Members

Protected Attributes inherited from cda_rail::solver::mip_based::GeneralMIPSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >
std::vector< GRBTempConstr > m_lazy_constraints
std::optional< GRBEnv > m_env
std::optional< GRBModel > m_model
std::unordered_map< std::string, MultiArray< GRBVar > > m_vars
GRBLinExpr m_objective_expr
Protected Attributes inherited from cda_rail::solver::GeneralSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolGeneralPerformanceOptimizationInstance >
instances::GeneralPerformanceOptimizationInstance m_instance
decltype(std::chrono::high_resolution_clock::now()) m_start
decltype(std::chrono::high_resolution_clock::now()) m_model_created
decltype(std::chrono::high_resolution_clock::now()) m_model_solved
int64_t m_create_time
int64_t m_solve_time
nlohmann::json m_solver_data

Detailed Description

Routes the trains of a moving block instance by a MILP.

The model decides, for every train, which edges it uses, at which velocity it passes every vertex, and at what time, where the velocities are taken from a discrete set per vertex, see VelocityRefinementStrategy. The separation of the trains is expressed by their order on the edges and TTD sections, whose headway constraints are separated lazily.

The model is built on separated station tracks, see instances::StopDiscretization, so that a train can also stop within a long platform, while the solution refers to the original network.

Constructor & Destructor Documentation

◆ GenPOMovingBlockMIPSolver() [1/3]

cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::GenPOMovingBlockMIPSolver ( )
default

◆ GenPOMovingBlockMIPSolver() [2/3]

cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::GenPOMovingBlockMIPSolver ( const instances::GeneralPerformanceOptimizationInstance & instance)
inlineexplicit

◆ GenPOMovingBlockMIPSolver() [3/3]

template<typename... Args>
requires (!IsSingleInstanceArgument<Args...>::value)
cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::GenPOMovingBlockMIPSolver ( Args &&... args)
inlineexplicit

◆ ~GenPOMovingBlockMIPSolver()

cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::~GenPOMovingBlockMIPSolver ( )
overridedefault

Member Function Documentation

◆ cleanup()

void cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::cleanup ( )
overrideprotectedvirtual

◆ solve() [1/4]

S cda_rail::solver::GeneralSolver< T, S >::solve ( )
inlinenodiscard

Solves the problem instance using default configuration.

Returns
S The solution.

◆ solve() [2/4]

cda_rail::instances::SolGeneralPerformanceOptimizationInstance cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::solve ( const ModelDetailMovingBlock & model_detail_input,
const SolverStrategyMovingBlock & solver_strategy_input,
const SolutionSettingsMovingBlock & solution_settings_input,
int time_limit = -1,
bool debug_input = false,
bool overwrite_severity = true )
nodiscard

Solves the instance under moving block signaling.

Only breakable edges use moving block. On all others, only one train is allowed at a time, which is how Flankenschutz can be modelled in practice. Trains are only routed if no route is specified.

Parameters
model_detail_inputHow accurately the operation is modelled.
solver_strategy_inputHow the model is solved.
solution_settings_inputWhere and what is exported.
time_limitTime limit in seconds. No limit if negative.
debug_inputIf true, the debug output is enabled.
overwrite_severityIf true, the severity of the log is overwritten even if this decreases the logging level.
Returns
Solution object containing status, objective value, and solution.

◆ solve() [3/4]

S cda_rail::solver::GeneralSolver< T, S >::solve ( int time_limit,
bool debug_input )
inlinenodiscard

Solves the problem instance.

Parameters
time_limitMaximum time allowed for solving. Zero or negative values disable the limit.
debug_inputWhether to enable debug input mode.
Returns
S The computed solution.

◆ solve() [4/4]

instances::SolGeneralPerformanceOptimizationInstance cda_rail::solver::mip_based::GenPOMovingBlockMIPSolver::solve ( int time_limit,
bool debug_input,
bool overwrite_severity )
inlinenodiscardoverride

The documentation for this class was generated from the following files: