Commit acf8de08 authored by Max Lyon's avatar Max Lyon

Merge branch 'gurobi_const' into 'master'

Gurobi Solver refactoring

See merge request !27
parents 45d01e0f 15b5154a
Pipeline #6703 failed with stages
in 4 minutes and 30 seconds
This diff is collapsed.
......@@ -46,7 +46,9 @@ public:
bool solve(NProblemInterface* _problem, // problem instance
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit = 60 ); // time limit in seconds
const double _time_limit = 60, // time limit in seconds
const double _gap = 0.0); // stops when solution with optimality gap
// lower than _gab is reached
bool solve(NProblemInterface* _problem, // problem instance
const std::vector<NConstraintInterface*>& _constraints, // linear constraints
......@@ -89,6 +91,14 @@ public:
const double _time_limit = 60,
const bool _silent = false);
bool solve( NProblemInterface* _problem,
const std::vector<NConstraintInterface*>& _constraints,
const std::vector<NConstraintInterface*>& _lazy_constraints,
const std::vector<PairIndexVtype>& _discrete_constraints, // discrete constraints
const double _time_limit = 60,
const double _gap = 0.0,
const int _lazy_level = 0); // lazy level between 0 and 3
// same as above with additional lazy constraints that are only added iteratively to the problem if not satisfied
bool solve(NProblemInterface* _problem,
......@@ -104,24 +114,19 @@ public:
}
void set_problem_output_path ( const std::string &_problem_output_path);
void set_problem_env_output_path( const std::string &_problem_env_output_path);
void set_solution_input_path ( const std::string &_solution_input_path);
void set_problem_output_path ( const std::string &_problem_output_path);
void set_start_solution_output_path( const std::string &_start_solution_output_path);
void set_problem_env_output_path ( const std::string &_problem_env_output_path);
void set_solution_input_path ( const std::string &_solution_input_path);
protected:
double* P(std::vector<double>& _v)
{
if( !_v.empty())
return ((double*)&_v[0]);
else
return 0;
}
private:
// filenames for exporting/importing gurobi solutions
// if string is empty nothing is imported or exported
std::string problem_output_path_;
std::string start_solution_output_path_;
std::string problem_env_output_path_;
std::string solution_input_path_;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment