Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CoMISo
CoMISo
Commits
acf8de08
Commit
acf8de08
authored
Jan 29, 2018
by
Max Lyon
Browse files
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
Changes
2
Pipelines
3
Expand all
Hide whitespace changes
Inline
Side-by-side
NSolver/GUROBISolver.cc
View file @
acf8de08
This diff is collapsed.
Click to expand it.
NSolver/GUROBISolver.hh
View file @
acf8de08
...
...
@@ -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_
;
};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment