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

The same solver, guided by a moving block solution of the instance. More...

#include <VSSGenTimetableSolver.hpp>

Inheritance diagram for cda_rail::solver::mip_based::VSSGenTimetableSolverWithMovingBlockInformation:
cda_rail::solver::mip_based::VSSGenTimetableSolver cda_rail::solver::mip_based::GeneralMIPSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolVSSGeneralPerformanceOptimizationInstance > cda_rail::solver::GeneralSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolVSSGeneralPerformanceOptimizationInstance >

Public Member Functions

 ~VSSGenTimetableSolverWithMovingBlockInformation () override=default
 VSSGenTimetableSolverWithMovingBlockInformation (const instances::SolGeneralPerformanceOptimizationInstance &moving_block_solution)
instances::SolVSSGeneralPerformanceOptimizationInstance solve (const ModelDetailMBInformation &model_detail_mb_information, const ModelSettingsVSSGen &model_settings={}, const SolverStrategyVSSGen &solver_strategy={}, const SolutionSettingsVSSGen &solution_settings={}, int time_limit=-1, bool debug_input=false, bool overwrite_severity=true)
 Solves the instance, guided by the moving block solution.
instances::SolVSSGeneralPerformanceOptimizationInstance solve (int time_limit, bool debug_input, bool overwrite_severity) override
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::mip_based::VSSGenTimetableSolver
 ~VSSGenTimetableSolver () override=default
 VSSGenTimetableSolver (const instances::GeneralPerformanceOptimizationInstance &instance)
template<typename... Args>
requires (!IsSingleInstanceArgument<Args...>::value)
 VSSGenTimetableSolver (Args &&... args)
instances::SolVSSGeneralPerformanceOptimizationInstance solve (const ModelDetailVSSGen &model_detail, const ModelSettingsVSSGen &model_settings={}, const SolverStrategyVSSGen &solver_strategy={}, const SolutionSettingsVSSGen &solution_settings={}, int time_limit=-1, bool debug_input=false, bool overwrite_severity=true)
 Solves the instance, adding as few VSS borders as possible.
instances::SolVSSGeneralPerformanceOptimizationInstance solve (int time_limit, bool debug_input, bool overwrite_severity) override
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::SolVSSGeneralPerformanceOptimizationInstance >
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::SolVSSGeneralPerformanceOptimizationInstance 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::VSSGenTimetableSolver
void solve_init_vss_gen_timetable (bool debug_input, bool overwrite_severity)
 Initializes the logging and the Gurobi model.
Protected Member Functions inherited from cda_rail::solver::mip_based::GeneralMIPSolver< instances::GeneralPerformanceOptimizationInstance, instances::SolVSSGeneralPerformanceOptimizationInstance >
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::SolVSSGeneralPerformanceOptimizationInstance >
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::SolVSSGeneralPerformanceOptimizationInstance &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::SolVSSGeneralPerformanceOptimizationInstance >
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::SolVSSGeneralPerformanceOptimizationInstance >
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

The same solver, guided by a moving block solution of the instance.

A moving block solution is a lower bound on what any VSS layout can achieve, so it is a good starting point. How much of it is fixed and how much is only hinted to the solver is given by ModelDetailMBInformation.

Constructor & Destructor Documentation

◆ ~VSSGenTimetableSolverWithMovingBlockInformation()

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

◆ VSSGenTimetableSolverWithMovingBlockInformation()

cda_rail::solver::mip_based::VSSGenTimetableSolverWithMovingBlockInformation::VSSGenTimetableSolverWithMovingBlockInformation ( const instances::SolGeneralPerformanceOptimizationInstance & moving_block_solution)
inlineexplicit

Member Function Documentation

◆ cleanup()

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

Releases the model and the environment after solving.

Reimplemented from cda_rail::solver::mip_based::VSSGenTimetableSolver.

◆ 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::SolVSSGeneralPerformanceOptimizationInstance cda_rail::solver::mip_based::VSSGenTimetableSolverWithMovingBlockInformation::solve ( const ModelDetailMBInformation & model_detail_mb_information,
const ModelSettingsVSSGen & model_settings = {},
const SolverStrategyVSSGen & solver_strategy = {},
const SolutionSettingsVSSGen & solution_settings = {},
int time_limit = -1,
bool debug_input = false,
bool overwrite_severity = true )
nodiscard

Solves the instance, guided by the moving block solution.

Works as the solve function of the parent class, except that the routes and, depending on model_detail_mb_information, further parts of the moving block solution are fixed or hinted to the solver.

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::SolVSSGeneralPerformanceOptimizationInstance cda_rail::solver::mip_based::VSSGenTimetableSolverWithMovingBlockInformation::solve ( int time_limit,
bool debug_input,
bool overwrite_severity )
inlinenodiscardoverride

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