|
| virtual void | cleanup () |
| | Releases the model and the environment after solving.
|
| void | solve_init_general_mip (bool debug_input, bool overwrite_severity) |
| | Initializes the model with the default message callback.
|
| void | solve_init_general_mip (bool debug_input, bool overwrite_severity, GRBCallback *cb) |
| | Initializes the logging, the Gurobi environment, and the model.
|
| | GeneralMIPSolver ()=default |
| | Constructs a solver with a default-initialized problem instance.
|
| | GeneralMIPSolver (const T &instance) |
| | Constructs a solver from a problem instance.
|
template<typename... Args>
requires ( !GeneralSolver<T, S>::template IsSingleInstanceArgument<Args...>::value) |
| | GeneralMIPSolver (Args &&... args) |
| | Constructs the problem instance from the given arguments.
|
| 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.
|
| | GeneralSolver (T instance) |
| | Constructs a solver from a problem instance.
|
template<typename... Args>
requires (sizeof...(Args) > 0 && !IsSingleInstanceArgument<Args...>::value && std::constructible_from<T, Args...>) |
| | GeneralSolver (Args &&... args) |
| | Constructs a GeneralSolver with arguments for the problem instance constructor.
|
| 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 (S &solution, const GeneralSolutionSettings &solution_settings, FurtherData const &further_data={}) |
| | Exports the solution together with the solver data if requested.
|
|
| 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 T & | get_instance () const |
| | Accesses the problem instance stored in this solver.
|
| T & | editable_instance () |
| | Provides mutable access to the problem instance.
|
| S | solve () |
| | Solves the problem instance using default configuration.
|
| S | solve (int time_limit, bool debug_input) |
| | Solves the problem instance.
|
| virtual S | solve (int time_limit, bool debug_input, bool overwrite_severity)=0 |
| | Solves the problem instance, which every solver implements.
|
| virtual | ~GeneralSolver ()=default |
| | Virtual destructor.
|
template<typename T, typename S>
class cda_rail::solver::mip_based::GeneralMIPSolver< T, S >
Base of every solver that builds a MIP and hands it to Gurobi.
It owns the Gurobi environment, the model, and its variables, and takes care of everything that is the same for every model, namely its creation and its cleanup.
- Template Parameters
-
| T | The problem instance type, a child of GeneralProblemInstance. |
| S | The solution type belonging to it, a child of SolGeneralProblemInstance. |