5 #ifndef TCPSPSUITE_EBILP_HPP
6 #define TCPSPSUITE_EBILP_HPP
8 #include "../manager/solvers.hpp"
9 #include "../util/log.hpp"
10 #include "generated_config.hpp"
15 class AdditionalResultStorage;
19 template <
unsigned int>
23 #if defined(GUROBI_FOUND)
24 #include "../contrib/ilpabstraction/src/ilpa_gurobi.hpp"
27 #if defined(CPLEX_FOUND)
28 #include "../contrib/ilpabstraction/src/ilpa_cplex.hpp"
31 template <
class SolverT>
32 class EBILP :
public ILPBase<SolverT> {
34 EBILP(
const Instance & instance, AdditionalResultStorage & additional,
35 const SolverConfig & sconf);
38 static std::string get_id();
43 using Base = ILPBase<SolverT>;
44 using MIPSolver =
typename Base::MIPSolver;
45 using Model =
typename Base::Model;
46 using Variable =
typename Base::Variable;
47 using Expression =
typename Base::Expression;
48 using VarType =
typename Base::VarType;
49 using ParamType =
typename Base::ParamType;
50 using ModelStatus =
typename Base::ModelStatus;
51 using Constraint =
typename Base::Constraint;
59 std::vector<std::vector<Variable>> job_start_events;
67 std::vector<std::vector<Variable>> job_end_events;
72 std::vector<Variable> event_times;
90 std::vector<std::vector<Expression>> event_usages;
101 std::vector<std::pair<size_t, size_t>> skip_numbers;
102 std::vector<size_t> event_counts;
104 unsigned int max_deadline;
108 bool start_point_mode;
112 bool enforce_end_after_start_via_sum;
114 void compute_skip_numbers() noexcept;
116 void prepare_variables();
119 void prepare_duration_constraint();
122 void prepare_event_constraints();
126 void prepare_job_event_constraints();
129 void prepare_time_constraints();
132 void prepare_start_points_constraints();
135 void prepare_release_deadline_constraints();
138 void prepare_dependency_constraints();
141 void prepare_usage_expressions();
146 void create_solution();
151 #if defined(GUROBI_FOUND)
153 struct registry_hook<
154 solvers::get_free_N<EBILP<ilpabstraction::GurobiInterface>>()>
156 constexpr
static unsigned int my_N =
157 solvers::get_free_N<EBILP<ilpabstraction::GurobiInterface>>();
162 return solvers::register_class<EBILP<ilpabstraction::GurobiInterface>,
168 #if defined(CPLEX_FOUND)
170 struct registry_hook<
171 solvers::get_free_N<EBILP<ilpabstraction::CPLEXInterface>>()>
173 constexpr
static unsigned int my_N =
174 solvers::get_free_N<EBILP<ilpabstraction::CPLEXInterface>>();
179 return solvers::register_class<EBILP<ilpabstraction::CPLEXInterface>,
186 #endif // TCPSPSUITE_EBILP_HPP