Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
#include <bop_solution.h>
Public Member Functions | |
BopSolution (const sat::LinearBooleanProblem &problem, absl::string_view name) | |
void | SetValue (VariableIndex var, bool value) |
size_t | Size () const |
bool | Value (VariableIndex var) const |
const std::string & | name () const |
void | set_name (absl::string_view name) |
int64_t | GetCost () const |
double | GetScaledCost () const |
bool | IsFeasible () const |
util_intops::StrongVector< VariableIndex, bool >::const_iterator | begin () const |
For range based iteration, i.e. for (const bool value : solution) {...}. | |
util_intops::StrongVector< VariableIndex, bool >::const_iterator | end () const |
bool | operator< (const BopSolution &solution) const |
A Bop solution is a Boolean assignment for each variable of the problem. The cost value associated to the solution is the instantiation of the objective cost of the problem.
Definition at line 39 of file bop_solution.h.
operations_research::bop::BopSolution::BopSolution | ( | const sat::LinearBooleanProblem & | problem, |
absl::string_view | name ) |
Try the lucky assignment, i.e. the optimal one if feasible.
Definition at line 38 of file bop_solution.cc.
|
inline |
For range based iteration, i.e. for (const bool value : solution) {...}.
Definition at line 84 of file bop_solution.h.
|
inline |
Definition at line 87 of file bop_solution.h.
|
inline |
Returns the objective cost of the solution.
Definition at line 57 of file bop_solution.h.
|
inline |
Returns the objective cost of the solution taking into account the problem cost scaling and offset. This is mainly useful for displaying the current problem cost, while internally, the algorithm works directly with the integer version of the cost returned by GetCost().
Definition at line 68 of file bop_solution.h.
|
inline |
Returns true iff the solution is feasible.
Definition at line 76 of file bop_solution.h.
|
inline |
Definition at line 51 of file bop_solution.h.
|
inline |
Returns true when the cost of the argument solution is strictly greater than the cost of the object. This is used to sort solutions.
Definition at line 94 of file bop_solution.h.
|
inline |
Definition at line 52 of file bop_solution.h.
|
inline |
Definition at line 43 of file bop_solution.h.
|
inline |
Definition at line 49 of file bop_solution.h.
|
inline |
Definition at line 50 of file bop_solution.h.