Generated on: Thu Mar 29 07:46:58 PDT 2012 for custom file set | ||
|
||
// doxy/ or-tools/ src/ constraint_solver/ |
#include <constraint_solver.h>
Public Types | |
enum | IntVarStrategy { INT_VAR_DEFAULT, INT_VAR_SIMPLE, CHOOSE_FIRST_UNBOUND, CHOOSE_RANDOM, CHOOSE_MIN_SIZE_LOWEST_MIN, CHOOSE_MIN_SIZE_HIGHEST_MIN, CHOOSE_MIN_SIZE_LOWEST_MAX, CHOOSE_MIN_SIZE_HIGHEST_MAX, CHOOSE_PATH } |
This enum describes the strategy used to select the next branching variable at each node during the search. More... | |
enum | IntValueStrategy { INT_VALUE_DEFAULT, INT_VALUE_SIMPLE, ASSIGN_MIN_VALUE, ASSIGN_MAX_VALUE, ASSIGN_RANDOM_VALUE, ASSIGN_CENTER_VALUE } |
This enum describes the strategy used to select the next variable value to set. More... | |
enum | EvaluatorStrategy { CHOOSE_STATIC_GLOBAL_BEST, CHOOSE_DYNAMIC_GLOBAL_BEST } |
This enum is used by Solver::MakePhase to specify how to select variables and values during the search. More... | |
enum | SequenceStrategy { SEQUENCE_DEFAULT, SEQUENCE_SIMPLE, CHOOSE_MIN_SLACK_RANK_FORWARD, CHOOSE_RANDOM_RANK_FORWARD } |
Used for scheduling. Not yet implemented. More... | |
enum | IntervalStrategy { INTERVAL_DEFAULT, INTERVAL_SIMPLE, INTERVAL_SET_TIMES_FORWARD } |
Used for scheduling. Not yet implemented. More... | |
enum | LocalSearchOperators { TWOOPT, OROPT, RELOCATE, EXCHANGE, CROSS, MAKEACTIVE, MAKEINACTIVE, SWAPACTIVE, EXTENDEDSWAPACTIVE, PATHLNS, UNACTIVELNS, INCREMENT, DECREMENT, SIMPLELNS } |
This enum is used in Solver::MakeOperator to specify the neighborhood to create. More... | |
enum | EvaluatorLocalSearchOperators { LK, TSPOPT, TSPLNS } |
This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create. More... | |
enum | LocalSearchFilterBound { GE, LE, EQ } |
This enum is used in Solver::MakeLocalSearchObjectiveFilter. More... | |
enum | LocalSearchOperation { SUM, PROD, MAX, MIN } |
This enum is used in Solver::MakeLocalSearchObjectiveFilter. More... | |
enum | DemonPriority { DELAYED_PRIORITY = 0, VAR_PRIORITY = 1, NORMAL_PRIORITY = 2 } |
This enum represents the three possible priorities for a demon in the Solver queue. More... | |
enum | BinaryIntervalRelation { ENDS_AFTER_END, ENDS_AFTER_START, ENDS_AT_END, ENDS_AT_START, STARTS_AFTER_END, STARTS_AFTER_START, STARTS_AT_END, STARTS_AT_START, STAYS_IN_SYNC } |
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2. More... | |
enum | UnaryIntervalRelation { ENDS_AFTER, ENDS_AT, ENDS_BEFORE, STARTS_AFTER, STARTS_AT, STARTS_BEFORE, CROSS_DATE, AVOID_DATE } |
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d. More... | |
enum | DecisionModification { NO_CHANGE, KEEP_LEFT, KEEP_RIGHT, KILL_BOTH, SWITCH_BRANCHES } |
The Solver is responsible for creating the search tree. More... | |
enum | MarkerType { SENTINEL, SIMPLE_MARKER, CHOICE_POINT, REVERSIBLE_ACTION } |
This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree. More... | |
enum | SolverState { OUTSIDE_SEARCH, IN_ROOT_NODE, IN_SEARCH, AT_SOLUTION, NO_MORE_SOLUTIONS, PROBLEM_INFEASIBLE } |
This enum represents the state of the solver w.r.t. the search. More... | |
typedef ResultCallback1< int64, int64 > | IndexEvaluator1 |
Callback typedefs. | |
typedef ResultCallback2< int64, int64, int64 > | IndexEvaluator2 |
typedef ResultCallback3< int64, int64, int64, int64 > | IndexEvaluator3 |
typedef ResultCallback2 < IntExpr *, CPModelLoader *, const CPIntegerExpressionProto & > | IntegerExpressionBuilder |
typedef ResultCallback2 < Constraint *, CPModelLoader *, const CPConstraintProto & > | ConstraintBuilder |
typedef ResultCallback2 < IntervalVar *, CPModelLoader *, const CPIntervalVariableProto & > | IntervalVariableBuilder |
typedef ResultCallback2 < SequenceVar *, CPModelLoader *, const CPSequenceVariableProto & > | SequenceVariableBuilder |
Public Member Functions | |
Solver (const string &modelname) | |
Solver (const string &modelname, const SolverParameters ¶meters) | |
~Solver () | |
const SolverParameters & | parameters () const |
Read-only Parameters. | |
template<class T> | |
void | SaveValue (T *o) |
reversibility | |
template<typename T> | |
T * | RevAlloc (T *object) |
Registers the given object as being reversible. | |
template<typename T> | |
T * | RevAllocArray (T *object) |
Like RevAlloc() above, but for an array of objects: the array must have been allocated with the new[] operator. | |
void | AddConstraint (Constraint *const c) |
propagation | |
void | AddCastConstraint (CastConstraint *const c, IntVar *const target_var, IntExpr *const casted_expression) |
Adds the constraint 'c' to the solver and marks it as a cast constraint, that is, a constraint created calling Var() on an expression. | |
bool | NestedSolve (DecisionBuilder *const db, bool restore, const std::vector< SearchMonitor * > &monitors) |
Nested solve using a decision builder and up to three search monitors, usually one for the objective, one for the limits and one to collect solutions. | |
bool | NestedSolve (DecisionBuilder *const db, bool restore, SearchMonitor *const *monitors, int size) |
bool | NestedSolve (DecisionBuilder *const db, bool restore) |
bool | NestedSolve (DecisionBuilder *const db, bool restore, SearchMonitor *const m1) |
bool | NestedSolve (DecisionBuilder *const db, bool restore, SearchMonitor *const m1, SearchMonitor *const m2) |
bool | NestedSolve (DecisionBuilder *const db, bool restore, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
bool | CheckAssignment (Assignment *const assignment) |
Checks whether the given assignment satisfies all the relevant constraints. | |
bool | CheckConstraint (Constraint *const constraint) |
Checks whether adding this constraint will lead to an immediate failure. | |
SolverState | state () const |
State of the solver. | |
void | Fail () |
Abandon the current branch in the search tree. A backtrack will follow. | |
void | ExportModel (CPModelProto *const proto) const |
Exports the model to protobuf. | |
void | ExportModel (const std::vector< SearchMonitor * > &monitors, CPModelProto *const proto) const |
Exports the model to protobuf. | |
bool | LoadModel (const CPModelProto &proto) |
Loads the model into the solver, and returns true upon success. | |
bool | LoadModel (const CPModelProto &proto, std::vector< SearchMonitor * > *monitors) |
Loads the model into the solver, appends search monitors to monitors, and returns true upon success. | |
bool | CollectDecisionVariables (std::vector< IntVar * > *const primary_integer_variables, std::vector< IntVar * > *const secondary_integer_variables, std::vector< SequenceVar * > *const sequence_variables, std::vector< IntervalVar * > *const interval_variables) |
Collects decision variables. | |
void | RegisterBuilder (const string &tag, ConstraintBuilder *const builder) |
Registers a constraint builder. Ownership is passed to the solver. | |
void | RegisterBuilder (const string &tag, IntegerExpressionBuilder *const builder) |
Registers an integer expression builder. Ownership is passed to the solver. | |
void | RegisterBuilder (const string &tag, IntervalVariableBuilder *const builder) |
Registers an interval variable builder. Ownership is passed to the solver. | |
void | RegisterBuilder (const string &tag, SequenceVariableBuilder *const builder) |
Registers a sequence variable builder. Ownership is passed to the solver. | |
ConstraintBuilder * | GetConstraintBuilder (const string &tag) const |
IntegerExpressionBuilder * | GetIntegerExpressionBuilder (const string &tag) const |
IntervalVariableBuilder * | GetIntervalVariableBuilder (const string &tag) const |
SequenceVariableBuilder * | GetSequenceVariableBuilder (const string &tag) const |
void | AddBacktrackAction (Action *a, bool fast) |
When SaveValue() is not the best way to go, one can create a reversible action that will be called upon backtrack. | |
string | DebugString () const |
misc debug string. | |
int64 | wall_time () const |
wall_time() in ms since the creation of the solver. | |
int64 | branches () const |
number of branches explored since the creation of the solver. | |
int64 | solutions () const |
number of solutions found since the start of the search. | |
int64 | demon_runs (DemonPriority p) const |
number of demons executed during search for a given priority. | |
int64 | failures () const |
number of failures encountered since the creation of the solver. | |
int64 | neighbors () const |
number of neighbors created | |
int64 | filtered_neighbors () const |
number of filtered neighbors (neighbors accepted by filters) | |
int64 | accepted_neighbors () const |
number of accepted neighbors | |
uint64 | stamp () const |
The stamp indicates how many moves in the search tree we have performed. | |
uint64 | fail_stamp () const |
The fail_stamp() is incremented after each backtrack. | |
IntVar * | MakeIntVar (int64 vmin, int64 vmax, const string &name) |
Make Factory. | |
IntVar * | MakeIntVar (const std::vector< int64 > &values, const string &name) |
MakeIntVar will create a variable with the given sparse domain. | |
IntVar * | MakeIntVar (const std::vector< int > &values, const string &name) |
MakeIntVar will create a variable with the given sparse domain. | |
IntVar * | MakeIntVar (int64 vmin, int64 vmax) |
MakeIntVar will create the best range based int var for the bounds given. | |
IntVar * | MakeIntVar (const std::vector< int64 > &values) |
MakeIntVar will create a variable with the given sparse domain. | |
IntVar * | MakeIntVar (const std::vector< int > &values) |
MakeIntVar will create a variable with the given sparse domain. | |
IntVar * | MakeBoolVar (const string &name) |
MakeBoolVar will create a variable with a {0, 1} domain. | |
IntVar * | MakeBoolVar () |
MakeBoolVar will create a variable with a {0, 1} domain. | |
IntVar * | MakeIntConst (int64 val, const string &name) |
IntConst will create a constant expression. | |
IntVar * | MakeIntConst (int64 val) |
IntConst will create a constant expression. | |
void | MakeIntVarArray (int var_count, int64 vmin, int64 vmax, const string &name, std::vector< IntVar * > *vars) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having name "name<i>" where is the index of the variable. | |
void | MakeIntVarArray (int var_count, int64 vmin, int64 vmax, std::vector< IntVar * > *vars) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having no names. | |
IntVar ** | MakeIntVarArray (int var_count, int64 vmin, int64 vmax, const string &name) |
Same but allocates an array and returns it. | |
void | MakeBoolVarArray (int var_count, const string &name, std::vector< IntVar * > *vars) |
This method will append the vector vars with 'var_count' boolean variables having name "name<i>" where is the index of the variable. | |
void | MakeBoolVarArray (int var_count, std::vector< IntVar * > *vars) |
This method will append the vector vars with 'var_count' boolean variables having no names. | |
IntVar ** | MakeBoolVarArray (int var_count, const string &name) |
Same but allocates an array and returns it. | |
IntExpr * | MakeSum (IntExpr *const left, IntExpr *const right) |
Integer Expressions. | |
IntExpr * | MakeSum (IntExpr *const expr, int64 value) |
expr + value. | |
IntExpr * | MakeSum (IntVar *const *vars, int size) |
sum of all vars. | |
IntExpr * | MakeSum (const std::vector< IntVar * > &vars) |
sum of all vars. | |
IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int64 > &coefs) |
scalar product | |
IntExpr * | MakeScalProd (IntVar *const *vars, const int64 *const coefs, int size) |
scalar product | |
IntExpr * | MakeScalProd (const std::vector< IntVar * > &vars, const std::vector< int > &coefs) |
scalar product | |
IntExpr * | MakeScalProd (IntVar *const *vars, const int *const coefs, int size) |
scalar product | |
IntExpr * | MakeDifference (IntExpr *const left, IntExpr *const right) |
left - right | |
IntExpr * | MakeDifference (int64 value, IntExpr *const expr) |
value - expr | |
IntExpr * | MakeOpposite (IntExpr *const expr) |
-expr | |
IntExpr * | MakeProd (IntExpr *const left, IntExpr *const right) |
left * right | |
IntExpr * | MakeProd (IntExpr *const expr, int64 value) |
expr * value | |
IntExpr * | MakeDiv (IntExpr *const expr, int64 value) |
expr / value (integer division) | |
IntExpr * | MakeDiv (IntExpr *const numerator, IntExpr *const denominator) |
numerator / denominator (integer division). Terms need to be positive. | |
IntExpr * | MakeAbs (IntExpr *const expr) |
|expr| | |
IntExpr * | MakeSquare (IntExpr *const expr) |
expr * expr | |
IntExpr * | MakeElement (const int64 *const vals, int size, IntVar *const index) |
vals[expr] | |
IntExpr * | MakeElement (const std::vector< int64 > &vals, IntVar *const index) |
vals[expr] | |
IntExpr * | MakeElement (const int *const vals, int size, IntVar *const index) |
vals[expr] | |
IntExpr * | MakeElement (const std::vector< int > &vals, IntVar *const index) |
vals[expr] | |
IntExpr * | MakeElement (IndexEvaluator1 *values, IntVar *const index) |
Function-based element. | |
IntExpr * | MakeMonotonicElement (IndexEvaluator1 *values, bool increasing, IntVar *const index) |
Function based element. | |
IntExpr * | MakeElement (IndexEvaluator2 *values, IntVar *const index1, IntVar *const index2) |
2D version of function-based element expression, values(expr1, expr2). | |
IntExpr * | MakeElement (const IntVar *const *vars, int size, IntVar *const index) |
vars[expr] | |
IntExpr * | MakeElement (const std::vector< IntVar * > &vars, IntVar *const index) |
vars[expr] | |
IntExpr * | MakeMin (const std::vector< IntVar * > &vars) |
min(vars) | |
IntExpr * | MakeMin (IntVar *const *vars, int size) |
min(vars) | |
IntExpr * | MakeMin (IntExpr *const left, IntExpr *const right) |
min (left, right) | |
IntExpr * | MakeMin (IntExpr *const expr, int64 val) |
min(expr, val) | |
IntExpr * | MakeMin (IntExpr *const expr, int val) |
min(expr, val) | |
IntExpr * | MakeMax (const std::vector< IntVar * > &vars) |
max(vars) | |
IntExpr * | MakeMax (IntVar *const *vars, int size) |
max(vars) | |
IntExpr * | MakeMax (IntExpr *const left, IntExpr *const right) |
max(left, right) | |
IntExpr * | MakeMax (IntExpr *const expr, int64 val) |
max(expr, val) | |
IntExpr * | MakeMax (IntExpr *const expr, int val) |
max(expr, val) | |
IntExpr * | MakeConvexPiecewiseExpr (IntVar *e, int64 early_cost, int64 early_date, int64 late_date, int64 late_cost) |
convex piecewise function. | |
IntExpr * | MakeSemiContinuousExpr (IntExpr *const e, int64 fixed_charge, int64 step) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0. | |
Constraint * | MakeTrueConstraint () |
Constraints This constraint always succeeds. | |
Constraint * | MakeFalseConstraint () |
This constraint always fails. | |
Constraint * | MakeFalseConstraint (const string &explanation) |
Constraint * | MakeIsEqualCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v == c) | |
IntVar * | MakeIsEqualCstVar (IntVar *const var, int64 value) |
status var of (v == c) | |
Constraint * | MakeIsEqualCt (IntExpr *const v1, IntExpr *v2, IntVar *const b) |
b == (v1 == v2) | |
IntVar * | MakeIsEqualVar (IntExpr *const var, IntExpr *v2) |
status var of (v1 == v2) | |
Constraint * | MakeEquality (IntVar *const left, IntVar *const right) |
left == right | |
Constraint * | MakeEquality (IntExpr *const expr, int64 value) |
expr == value | |
Constraint * | MakeEquality (IntExpr *const expr, int value) |
expr == value | |
Constraint * | MakeIsDifferentCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v != c) | |
IntVar * | MakeIsDifferentCstVar (IntVar *const v, int64 c) |
status var of (v != c) | |
IntVar * | MakeIsDifferentVar (IntExpr *const v1, IntExpr *const v2) |
status var of (v1 != v2) | |
Constraint * | MakeIsDifferentCt (IntExpr *const v1, IntExpr *const v2, IntVar *const b) |
b == (v1 != v2) | |
Constraint * | MakeNonEquality (IntVar *const left, IntVar *const right) |
left != right | |
Constraint * | MakeNonEquality (IntVar *const expr, int64 value) |
expr != value | |
Constraint * | MakeNonEquality (IntVar *const expr, int value) |
expr != value | |
Constraint * | MakeIsLessOrEqualCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v <= c) | |
IntVar * | MakeIsLessOrEqualCstVar (IntVar *const v, int64 c) |
status var of (v <= c) | |
IntVar * | MakeIsLessOrEqualVar (IntExpr *const left, IntExpr *const right) |
status var of (left <= right) | |
Constraint * | MakeIsLessOrEqualCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
b == (left <= right) | |
Constraint * | MakeLessOrEqual (IntVar *const left, IntVar *const right) |
left <= right | |
Constraint * | MakeLessOrEqual (IntExpr *const expr, int64 value) |
expr <= value | |
Constraint * | MakeLessOrEqual (IntExpr *const expr, int value) |
expr <= value | |
Constraint * | MakeIsGreaterOrEqualCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v >= c) | |
IntVar * | MakeIsGreaterOrEqualCstVar (IntVar *const v, int64 c) |
status var of (v >= c) | |
IntVar * | MakeIsGreaterOrEqualVar (IntExpr *const left, IntExpr *const right) |
status var of (left >= right) | |
Constraint * | MakeIsGreaterOrEqualCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
b == (left >= right) | |
Constraint * | MakeGreaterOrEqual (IntVar *const left, IntVar *const right) |
left >= right | |
Constraint * | MakeGreaterOrEqual (IntExpr *const expr, int64 value) |
expr >= value | |
Constraint * | MakeGreaterOrEqual (IntExpr *const expr, int value) |
expr >= value | |
Constraint * | MakeIsGreaterCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v > c) | |
IntVar * | MakeIsGreaterCstVar (IntVar *const v, int64 c) |
status var of (v > c) | |
IntVar * | MakeIsGreaterVar (IntExpr *const left, IntExpr *const right) |
status var of (left > right) | |
Constraint * | MakeIsGreaterCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
b == (left > right) | |
Constraint * | MakeGreater (IntVar *const left, IntVar *const right) |
left > right | |
Constraint * | MakeGreater (IntExpr *const expr, int64 value) |
expr > value | |
Constraint * | MakeGreater (IntExpr *const expr, int value) |
expr > value | |
Constraint * | MakeIsLessCstCt (IntVar *const v, int64 c, IntVar *const b) |
b == (v < c) | |
IntVar * | MakeIsLessCstVar (IntVar *const v, int64 c) |
status var of (v < c) | |
IntVar * | MakeIsLessVar (IntExpr *const left, IntExpr *const right) |
status var of (left < right) | |
Constraint * | MakeIsLessCt (IntExpr *const left, IntExpr *const right, IntVar *const b) |
b == (left < right) | |
Constraint * | MakeLess (IntVar *const left, IntVar *const right) |
left < right | |
Constraint * | MakeLess (IntExpr *const expr, int64 value) |
expr < value | |
Constraint * | MakeLess (IntExpr *const expr, int value) |
expr < value | |
Constraint * | MakeSumLessOrEqual (const std::vector< IntVar * > &vars, int64 cst) |
Variation on arrays. | |
Constraint * | MakeSumLessOrEqual (IntVar *const *vars, int size, int64 cst) |
Constraint * | MakeSumGreaterOrEqual (const std::vector< IntVar * > &vars, int64 cst) |
Constraint * | MakeSumGreaterOrEqual (IntVar *const *vars, int size, int64 cst) |
Constraint * | MakeSumEquality (const std::vector< IntVar * > &vars, int64 cst) |
Constraint * | MakeSumEquality (IntVar *const *vars, int size, int64 cst) |
Constraint * | MakeSumEquality (const std::vector< IntVar * > &vars, IntVar *const var) |
Constraint * | MakeSumEquality (IntVar *const *vars, int size, IntVar *const var) |
Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int64 > &coefficients, int64 cst) |
Constraint * | MakeScalProdEquality (IntVar *const *vars, int size, int64 const *coefficients, int64 cst) |
namespace | |
Constraint * | MakeScalProdEquality (IntVar *const *vars, int size, int const *coefficients, int64 cst) |
Constraint * | MakeScalProdEquality (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, int64 cst) |
Constraint * | MakeScalProdGreaterOrEqual (const std::vector< IntVar * > &vars, const std::vector< int64 > &coefficients, int64 cst) |
Constraint * | MakeScalProdGreaterOrEqual (IntVar *const *vars, int size, int64 const *coefficients, int64 cst) |
namespace | |
Constraint * | MakeScalProdGreaterOrEqual (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, int64 cst) |
Constraint * | MakeScalProdGreaterOrEqual (IntVar *const *vars, int size, int const *coefficients, int64 cst) |
Constraint * | MakeScalProdLessOrEqual (const std::vector< IntVar * > &vars, const std::vector< int64 > &coefficients, int64 cst) |
Constraint * | MakeScalProdLessOrEqual (IntVar *const *vars, int size, int64 const *coefficients, int64 cst) |
namespace | |
Constraint * | MakeScalProdLessOrEqual (const std::vector< IntVar * > &vars, const std::vector< int > &coefficients, int64 cst) |
Constraint * | MakeScalProdLessOrEqual (IntVar *const *vars, int size, int const *coefficients, int64 cst) |
Demon * | MakeConstraintInitialPropagateCallback (Constraint *const ct) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'. | |
Demon * | MakeDelayedConstraintInitialPropagateCallback (Constraint *const ct) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority. | |
Demon * | MakeCallbackDemon (Callback1< Solver * > *const callback) |
Creates a demon from a callback. | |
Demon * | MakeCallbackDemon (Closure *const closure) |
Creates a demon from a closure. | |
Constraint * | MakeBetweenCt (IntVar *const v, int64 l, int64 u) |
(l <= b <= u) | |
Constraint * | MakeIsBetweenCt (IntVar *const v, int64 l, int64 u, IntVar *const b) |
b == (l <= v <= u) | |
Constraint * | MakeIsMemberCt (IntVar *const v, const int64 *const values, int size, IntVar *const b) |
b == (v in set) | |
Constraint * | MakeIsMemberCt (IntVar *const v, const std::vector< int64 > &values, IntVar *const b) |
Constraint * | MakeIsMemberCt (IntVar *const v, const int *const values, int size, IntVar *const b) |
Constraint * | MakeIsMemberCt (IntVar *const v, const std::vector< int > &values, IntVar *const b) |
IntVar * | MakeIsMemberVar (IntVar *const v, const int64 *const values, int size) |
IntVar * | MakeIsMemberVar (IntVar *const v, const std::vector< int64 > &values) |
IntVar * | MakeIsMemberVar (IntVar *const v, const int *const values, int size) |
IntVar * | MakeIsMemberVar (IntVar *const v, const std::vector< int > &values) |
Constraint * | MakeMemberCt (IntVar *const v, const int64 *const values, int size) |
v in set. | |
Constraint * | MakeMemberCt (IntVar *const v, const std::vector< int64 > &values) |
Constraint * | MakeMemberCt (IntVar *const v, const int *const values, int size) |
Constraint * | MakeMemberCt (IntVar *const v, const std::vector< int > &values) |
Constraint * | MakeCount (const std::vector< IntVar * > &v, int64 value, int64 count) |
|{i | v[i] == value}| == count | |
Constraint * | MakeCount (const std::vector< IntVar * > &v, int64 value, IntVar *const count) |
|{i | v[i] == value}| == count | |
Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int64 > &values, const std::vector< IntVar * > &cards) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. | |
Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< int > &values, const std::vector< IntVar * > &cards) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]. | |
Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &cards) |
Aggregated version of count: |{i | v[i] == j}| == cards[j]. | |
Constraint * | MakeDistribute (const std::vector< IntVar * > &vars, int64 card_min, int64 card_max, int64 card_size) |
Aggregated version of count with bounded cardinalities: forall j in 0 . | |
Constraint * | MakeDeviation (const std::vector< IntVar * > &vars, IntVar *const deviation_var, int64 total_sum) |
Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = vars. | |
Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars) |
All variables are pairwise different. | |
Constraint * | MakeAllDifferent (const std::vector< IntVar * > &vars, bool stronger_propagation) |
All variables are pairwise different. | |
Constraint * | MakeAllDifferent (const IntVar *const *vars, int size, bool stronger_propagation) |
All variables are pairwise different. | |
Constraint * | MakeNoCycle (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, ResultCallback1< bool, int64 > *sink_handler=NULL) |
Prevent cycles, nexts variables representing the next in the chain. | |
Constraint * | MakeNoCycle (const IntVar *const *nexts, const IntVar *const *active, int size, ResultCallback1< bool, int64 > *sink_handler=NULL) |
Constraint * | MakeNoCycle (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, ResultCallback1< bool, int64 > *sink_handler, bool assume_paths) |
namespace | |
Constraint * | MakeNoCycle (const IntVar *const *nexts, const IntVar *const *active, int size, ResultCallback1< bool, int64 > *sink_handler, bool assume_paths) |
Constraint * | MakePathCumul (const std::vector< IntVar * > &nexts, const std::vector< IntVar * > &active, const std::vector< IntVar * > &cumuls, const std::vector< IntVar * > &transits) |
Accumulate values along a path such that: cumuls[next[i]] = cumuls[i] + transits[i]. | |
Constraint * | MakePathCumul (const IntVar *const *nexts, const IntVar *const *active, const IntVar *const *cumuls, const IntVar *const *transits, int next_size, int cumul_size) |
Constraint * | MakeMapDomain (IntVar *const var, IntVar *const *vars, int size) |
This constraint maps the domain of 'var' onto the array of variables 'vars'. | |
Constraint * | MakeMapDomain (IntVar *const var, const std::vector< IntVar * > &vars) |
This constraint maps the domain of 'var' onto the array of variables 'vars'. | |
Constraint * | MakeAllowedAssignments (const std::vector< IntVar * > &vars, const IntTupleSet &tuples) |
This method creates a constraint where the graph of the relation between the variables is given in extension. | |
Constraint * | MakeTransitionConstraint (const std::vector< IntVar * > &vars, const IntTupleSet &transitions, int64 initial_state, const std::vector< int64 > &final_states) |
This constraint create a finite automaton that will check the sequence of variables vars. | |
Constraint * | MakeTransitionConstraint (const std::vector< IntVar * > &vars, const IntTupleSet &transitions, int64 initial_state, const std::vector< int > &final_states) |
This constraint create a finite automaton that will check the sequence of variables vars. | |
Pack * | MakePack (const std::vector< IntVar * > &vars, int number_of_bins) |
Packing constraint. | |
IntervalVar * | MakeFixedDurationIntervalVar (int64 start_min, int64 start_max, int64 duration, bool optional, const string &name) |
scheduling objects | |
void | MakeFixedDurationIntervalVarArray (int count, int64 start_min, int64 start_max, int64 duration, bool optional, const string &name, std::vector< IntervalVar * > *array) |
This method fills the vector with 'count' interval var built with the corresponding parameters. | |
IntervalVar * | MakeFixedInterval (int64 start, int64 duration, const string &name) |
Creates an fixed and performed interval. | |
IntervalVar * | MakeMirrorInterval (IntervalVar *const interval_var) |
Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis. | |
IntervalVar * | MakeIntervalRelaxedMin (IntervalVar *const interval_var) |
Creates and returns an interval variable that wraps around the given one, relaxing the min start and end. | |
IntervalVar * | MakeIntervalRelaxedMax (IntervalVar *const interval_var) |
Creates and returns an interval variable that wraps around the given one, relaxing the max start and end. | |
Constraint * | MakeIntervalVarRelation (IntervalVar *const t, UnaryIntervalRelation r, int64 d) |
scheduling constraints | |
Constraint * | MakeIntervalVarRelation (IntervalVar *const t1, BinaryIntervalRelation r, IntervalVar *const t2) |
This method creates a relation between two an interval vars. | |
Constraint * | MakeTemporalDisjunction (IntervalVar *const t1, IntervalVar *const t2, IntVar *const alt) |
This constraint implements a temporal disjunction between two interval vars t1 and t2. | |
Constraint * | MakeTemporalDisjunction (IntervalVar *const t1, IntervalVar *const t2) |
This constraint implements a temporal disjunction between two interval vars. | |
Constraint * | MakeDisjunctiveConstraint (const std::vector< IntervalVar * > &intervals) |
This constraint forces all interval vars into an non overlapping sequence. | |
SequenceVar * | MakeSequenceVar (const std::vector< IntervalVar * > &intervals, const string &name) |
The sequence variable is used to rank disjoint intervals. | |
Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int64 > &demands, int64 capacity, const string &name) |
This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. | |
Constraint * | MakeCumulative (const std::vector< IntervalVar * > &intervals, const std::vector< int > &demands, int64 capacity, const string &name) |
This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity. | |
Assignment * | MakeAssignment () |
Assignments. | |
Assignment * | MakeAssignment (const Assignment *const a) |
This method creates an assignnment which is a copy of 'a'. | |
SolutionCollector * | MakeFirstSolutionCollector (const Assignment *const assignment) |
Solution Collectors. | |
SolutionCollector * | MakeFirstSolutionCollector () |
Collect the first solution of the search. | |
SolutionCollector * | MakeLastSolutionCollector (const Assignment *const assignment) |
Collect the last solution of the search. | |
SolutionCollector * | MakeLastSolutionCollector () |
Collect the last solution of the search. | |
SolutionCollector * | MakeBestValueSolutionCollector (const Assignment *const assignment, bool maximize) |
Collect the solution corresponding to the optimal value of the objective of 'a'; if 'a' does not have an objective no solution is collected. | |
SolutionCollector * | MakeBestValueSolutionCollector (bool maximize) |
Collect the solution corresponding to the optimal value of the objective of 'a'; if 'a' does not have an objective no solution is collected. | |
SolutionCollector * | MakeAllSolutionCollector (const Assignment *const assignment) |
Collect all solutions of the search. | |
SolutionCollector * | MakeAllSolutionCollector () |
Collect all solutions of the search. | |
OptimizeVar * | MakeMinimize (IntVar *const v, int64 step) |
Objective. | |
OptimizeVar * | MakeMaximize (IntVar *const v, int64 step) |
Creates a maximization objective. | |
OptimizeVar * | MakeOptimize (bool maximize, IntVar *const v, int64 step) |
Creates a objective with a given sense (true = maximization). | |
OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &vars, const std::vector< int64 > &weights, int64 step) |
Creates a minimization weighted objective. | |
OptimizeVar * | MakeWeightedMinimize (const std::vector< IntVar * > &vars, const std::vector< int > &weights, int64 step) |
Creates a minimization weighted objective. | |
OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &vars, const std::vector< int64 > &weights, int64 step) |
Creates a maximization weigthed objective. | |
OptimizeVar * | MakeWeightedMaximize (const std::vector< IntVar * > &vars, const std::vector< int > &weights, int64 step) |
Creates a maximization weigthed objective. | |
OptimizeVar * | MakeWeightedOptimize (bool maximize, const std::vector< IntVar * > &vars, const std::vector< int64 > &weights, int64 step) |
Creates a weighted objective with a given sense (true = maximization). | |
OptimizeVar * | MakeWeightedOptimize (bool maximize, const std::vector< IntVar * > &vars, const std::vector< int > &weights, int64 step) |
Creates a weighted objective with a given sense (true = maximization). | |
SearchMonitor * | MakeTabuSearch (bool maximize, IntVar *const v, int64 step, const std::vector< IntVar * > &vars, int64 keep_tenure, int64 forbid_tenure, double tabu_factor) |
Meta-heuristics Search monitors which try to get the search out of local optima. | |
SearchMonitor * | MakeTabuSearch (bool maximize, IntVar *const v, int64 step, const IntVar *const *vars, int size, int64 keep_tenure, int64 forbid_tenure, double tabu_factor) |
SearchMonitor * | MakeSimulatedAnnealing (bool maximize, IntVar *const v, int64 step, int64 initial_temperature) |
Creates a Simulated Annealing monitor. | |
SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator2 *objective_function, int64 step, const std::vector< IntVar * > &vars, double penalty_factor) |
Creates a Guided Local Search monitor. | |
SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator2 *objective_function, int64 step, const IntVar *const *vars, int size, double penalty_factor) |
SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator3 *objective_function, int64 step, const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, double penalty_factor) |
SearchMonitor * | MakeGuidedLocalSearch (bool maximize, IntVar *const objective, IndexEvaluator3 *objective_function, int64 step, const IntVar *const *vars, const IntVar *const *secondary_vars, int size, double penalty_factor) |
SearchMonitor * | MakeLubyRestart (int scale_factor) |
Restart Search. | |
SearchMonitor * | MakeConstantRestart (int frequency) |
This search monitor will restart the search periodically after 'frequency' failures. | |
SearchLimit * | MakeTimeLimit (int64 time_in_ms) |
Search Limit. | |
SearchLimit * | MakeBranchesLimit (int64 branches) |
Creates a search limit that constrains the number of branches explored in the search tree. | |
SearchLimit * | MakeFailuresLimit (int64 failures) |
Creates a search limit that constrains the number of failures that can happen when exploring the search tree. | |
SearchLimit * | MakeSolutionsLimit (int64 solutions) |
Creates a search limit that constrains the number of solutions found during the search. | |
SearchLimit * | MakeLimit (int64 time, int64 branches, int64 failures, int64 solutions) |
Limits the search with the 'time', 'branches', 'failures' and 'solutions' limits. | |
SearchLimit * | MakeLimit (int64 time, int64 branches, int64 failures, int64 solutions, bool smart_time_check) |
Version reducing calls to wall timer by estimating number of remaining calls. | |
SearchLimit * | MakeLimit (int64 time, int64 branches, int64 failures, int64 solutions, bool smart_time_check, bool cumulative) |
Creates a search limit which can either apply cumulatively or search-by-search. | |
SearchLimit * | MakeLimit (const SearchLimitProto &proto) |
Creates a search limit from its protobuf description. | |
SearchLimit * | MakeLimit (SearchLimit *const limit_1, SearchLimit *const limit_2) |
Creates a search limit that is reached when either of the underlying limit is reached. | |
void | UpdateLimits (int64 time, int64 branches, int64 failures, int64 solutions, SearchLimit *limit) |
int64 | GetTime (SearchLimit *limit) |
Returns 'time' limit of search limit. | |
SearchLimit * | MakeCustomLimit (ResultCallback< bool > *limiter) |
Callback-based search limit. | |
NoGoodManager * | MakeNoGoodManager () |
No Goods. | |
SearchMonitor * | MakeTreeMonitor (const IntVar *const *vars, int size, const string &file_tree, const string &file_visualization) |
Tree Monitor Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const std::vector< IntVar * > &vars, const string &file_tree, const string &file_visualization) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const IntVar *const *vars, int size, const string &file_config, const string &file_tree, const string &file_visualization) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const std::vector< IntVar * > &vars, const string &file_config, const string &file_tree, const string &file_visualization) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const IntVar *const *vars, int size, string *const tree_xml, string *const visualization_xml) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const std::vector< IntVar * > &vars, string *const tree_xml, string *const visualization_xml) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const IntVar *const *vars, int size, string *const config_xml, string *const tree_xml, string *const visualization_xml) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeTreeMonitor (const std::vector< IntVar * > &vars, string *const config_xml, string *const tree_xml, string *const visualization_xml) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format. | |
SearchMonitor * | MakeSearchLog (int branch_count) |
Search Log The SearchMonitors below will display a periodic search log on LOG(INFO) every branch_count branches explored. | |
SearchMonitor * | MakeSearchLog (int branch_count, IntVar *const objective) |
At each solution, this monitor also display the objective value. | |
SearchMonitor * | MakeSearchLog (int branch_count, ResultCallback< string > *display_callback) |
At each solution, this monitor will also display result of display_callback . | |
SearchMonitor * | MakeSearchLog (int branch_count, IntVar *objective, ResultCallback< string > *display_callback) |
At each solution, this monitor will display the objective value and the result of display_callback . | |
SearchMonitor * | MakeSearchLog (int branch_count, OptimizeVar *const objective) |
OptimizeVar Search Logs At each solution, this monitor will also display the objective->Print(). | |
SearchMonitor * | MakeSearchLog (int branch_count, OptimizeVar *const objective, ResultCallback< string > *display_callback) |
Creates a search monitor that will also print the result of the display callback. | |
SearchMonitor * | MakeSearchTrace (const string &prefix) |
Search Trace. | |
ModelVisitor * | MakePrintModelVisitor () |
ModelVisitor. | |
ModelVisitor * | MakeStatisticsModelVisitor () |
Displays some nice statistics on the model. | |
SearchMonitor * | MakeSymmetryManager (const std::vector< SymmetryBreaker * > &visitors) |
Symmetry Breaking. | |
SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const *visitors, int size) |
SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1) |
SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2) |
SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2, SymmetryBreaker *const v3) |
SearchMonitor * | MakeSymmetryManager (SymmetryBreaker *const v1, SymmetryBreaker *const v2, SymmetryBreaker *const v3, SymmetryBreaker *const v4) |
SearchMonitor * | MakeSimplexConnection (Callback1< MPSolver * > *const builder, Callback1< MPSolver * > *const modifier, Callback1< MPSolver * > *const runner, int simplex_frequency) |
Simplex Connection. | |
SearchMonitor * | MakeSimplexConstraint (int simplex_frequency) |
Linear Relaxation Constraint. | |
Decision * | MakeAssignVariableValue (IntVar *const var, int64 value) |
Search Decicions and Decision Builders. | |
Decision * | MakeVariableLessOrEqualValue (IntVar *const var, int64 value) |
Decision * | MakeVariableGreaterOrEqualValue (IntVar *const var, int64 value) |
Decision * | MakeSplitVariableDomain (IntVar *const var, int64 value, bool start_with_lower_half) |
namespace | |
Decision * | MakeAssignVariableValueOrFail (IntVar *const var, int64 value) |
namespace | |
Decision * | MakeAssignVariablesValues (const IntVar *const *vars, int size, const int64 *const values) |
namespace | |
Decision * | MakeAssignVariablesValues (const std::vector< IntVar * > &vars, const std::vector< int64 > &values) |
Decision * | MakeFailDecision () |
namespace | |
DecisionBuilder * | Compose (DecisionBuilder *const db1, DecisionBuilder *const db2) |
Creates a decision builder which sequentially composes decision builders. | |
DecisionBuilder * | Compose (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3) |
DecisionBuilder * | Compose (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3, DecisionBuilder *const db4) |
DecisionBuilder * | Compose (const std::vector< DecisionBuilder * > &dbs) |
DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2) |
Creates a decision builder which will create a search tree where each decision builder is called from the top of the search tree. | |
DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3) |
DecisionBuilder * | Try (DecisionBuilder *const db1, DecisionBuilder *const db2, DecisionBuilder *const db3, DecisionBuilder *const db4) |
DecisionBuilder * | Try (const std::vector< DecisionBuilder * > &dbs) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IntValueStrategy val_str) |
Phases on IntVar arrays. | |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IntVarStrategy var_str, IntValueStrategy val_str) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 *var_evaluator, IntValueStrategy val_str) |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IndexEvaluator1 *var_evaluator, IntValueStrategy val_str) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IndexEvaluator2 *val_eval) |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IntVarStrategy var_str, IndexEvaluator2 *val_eval) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 *var_evaluator, IndexEvaluator2 *val_eval) |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IndexEvaluator1 *var_evaluator, IndexEvaluator2 *val_eval) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IntVarStrategy var_str, IndexEvaluator2 *val_eval, IndexEvaluator1 *tie_breaker) |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IntVarStrategy var_str, IndexEvaluator2 *val_eval, IndexEvaluator1 *tie_breaker) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator1 *var_evaluator, IndexEvaluator2 *val_eval, IndexEvaluator1 *tie_breaker) |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IndexEvaluator1 *var_evaluator, IndexEvaluator2 *val_eval, IndexEvaluator1 *tie_breaker) |
DecisionBuilder * | MakeDefaultPhase (const IntVar *const *vars, int size) |
DecisionBuilder * | MakeDefaultPhase (const std::vector< IntVar * > &vars) |
namespace | |
DecisionBuilder * | MakeDefaultPhase (const IntVar *const *vars, int size, const DefaultPhaseParameters ¶meters) |
DecisionBuilder * | MakeDefaultPhase (const std::vector< IntVar * > &vars, const DefaultPhaseParameters ¶meters) |
DecisionBuilder * | MakePhase (IntVar *const v0, IntVarStrategy var_str, IntValueStrategy val_str) |
shortcuts for small arrays. | |
DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVarStrategy var_str, IntValueStrategy val_str) |
DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVar *const v2, IntVarStrategy var_str, IntValueStrategy val_str) |
DecisionBuilder * | MakePhase (IntVar *const v0, IntVar *const v1, IntVar *const v2, IntVar *const v3, IntVarStrategy var_str, IntValueStrategy val_str) |
Decision * | MakeScheduleOrPostpone (IntervalVar *const var, int64 est, int64 *const marker) |
Scheduling Decisions. | |
Decision * | MakeRankFirstInterval (SequenceVar *const sequence, int index) |
Returns a decision that tries to rank first the ith interval var in the sequence variable. | |
Decision * | MakeRankLastInterval (SequenceVar *const sequence, int index) |
Returns a decision that tries to rank last the ith interval var in the sequence variable. | |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 *evaluator, EvaluatorStrategy str) |
Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. | |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IndexEvaluator2 *evaluator, EvaluatorStrategy str) |
DecisionBuilder * | MakePhase (const std::vector< IntVar * > &vars, IndexEvaluator2 *evaluator, IndexEvaluator1 *tie_breaker, EvaluatorStrategy str) |
Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator. | |
DecisionBuilder * | MakePhase (const IntVar *const *vars, int size, IndexEvaluator2 *evaluator, IndexEvaluator1 *tie_breaker, EvaluatorStrategy str) |
DecisionBuilder * | MakePhase (const std::vector< IntervalVar * > &intervals, IntervalStrategy str) |
Scheduling phases. | |
DecisionBuilder * | MakePhase (const std::vector< SequenceVar * > &sequences, SequenceStrategy str) |
DecisionBuilder * | MakeDecisionBuilderFromAssignment (Assignment *const assignment, DecisionBuilder *const db, const IntVar *const *vars, int size) |
Returns a decision builder for which the left-most leaf corresponds to assignment, the rest of the tree being explored using 'db'. | |
DecisionBuilder * | MakeConstraintAdder (Constraint *const ct) |
Returns a decision builder that will add the given constraint to the model. | |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db) |
SolveOnce will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point. | |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1) |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2) |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3) |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3, SearchMonitor *const monitor4) |
DecisionBuilder * | MakeSolveOnce (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step) |
NestedOptimize will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point. | |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step, SearchMonitor *const monitor1) |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step, SearchMonitor *const monitor1, SearchMonitor *const monitor2) |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3) |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step, SearchMonitor *const monitor1, SearchMonitor *const monitor2, SearchMonitor *const monitor3, SearchMonitor *const monitor4) |
DecisionBuilder * | MakeNestedOptimize (DecisionBuilder *const db, Assignment *const solution, bool maximize, int64 step, const std::vector< SearchMonitor * > &monitors) |
DecisionBuilder * | MakeRestoreAssignment (Assignment *assignment) |
Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore()). | |
DecisionBuilder * | MakeStoreAssignment (Assignment *assignment) |
Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store()). | |
LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, LocalSearchOperators op) |
Local Search Operators. | |
LocalSearchOperator * | MakeOperator (const IntVar *const *vars, int size, LocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, LocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const IntVar *const *vars, const IntVar *const *secondary_vars, int size, LocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, IndexEvaluator3 *const evaluator, EvaluatorLocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const IntVar *const *vars, int size, IndexEvaluator3 *const evaluator, EvaluatorLocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const std::vector< IntVar * > &vars, const std::vector< IntVar * > &secondary_vars, IndexEvaluator3 *const evaluator, EvaluatorLocalSearchOperators op) |
LocalSearchOperator * | MakeOperator (const IntVar *const *vars, const IntVar *const *secondary_vars, int size, IndexEvaluator3 *const evaluator, EvaluatorLocalSearchOperators op) |
LocalSearchOperator * | MakeRandomLNSOperator (const std::vector< IntVar * > &vars, int number_of_variables) |
Creates a large neighborhood search operator which creates fragments (set of relaxed variables) with up to number_of_variables random variables (sampling with replacement is performed meaning that at most number_of_variables variables are selected). | |
LocalSearchOperator * | MakeRandomLNSOperator (const std::vector< IntVar * > &vars, int number_of_variables, int32 seed) |
LocalSearchOperator * | MakeRandomLNSOperator (const IntVar *const *vars, int size, int number_of_variables) |
LocalSearchOperator * | MakeRandomLNSOperator (const IntVar *const *vars, int size, int number_of_variables, int32 seed) |
LocalSearchOperator * | MakeMoveTowardTargetOperator (const Assignment &target) |
Creates a local search operator that tries to move the assignment of some variables toward a target. | |
LocalSearchOperator * | MakeMoveTowardTargetOperator (const std::vector< IntVar * > &variables, const std::vector< int64 > &target_values) |
Creates a local search operator that tries to move the assignment of some variables toward a target. | |
LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops) |
Creates a local search operator which concatenates a vector of operators. | |
LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, bool restart) |
LocalSearchOperator * | ConcatenateOperators (const std::vector< LocalSearchOperator * > &ops, ResultCallback2< int64, int, int > *const evaluator) |
LocalSearchOperator * | RandomConcatenateOperators (const std::vector< LocalSearchOperator * > &ops) |
Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor(). | |
LocalSearchOperator * | MakeNeighborhoodLimit (LocalSearchOperator *const op, int64 limit) |
Creates a local search operator that wraps another local search operator and limits the number of neighbors explored (i.e. | |
DecisionBuilder * | MakeLocalSearchPhase (Assignment *const assignment, LocalSearchPhaseParameters *const parameters) |
Local Search decision builders factories. | |
DecisionBuilder * | MakeLocalSearchPhase (const std::vector< IntVar * > &vars, DecisionBuilder *const first_solution, LocalSearchPhaseParameters *const parameters) |
DecisionBuilder * | MakeLocalSearchPhase (IntVar *const *vars, int size, DecisionBuilder *const first_solution, LocalSearchPhaseParameters *const parameters) |
SolutionPool * | MakeDefaultSolutionPool () |
Solution Pool. | |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder) |
Local Search Phase Parameters. | |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, SearchLimit *const limit) |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, SearchLimit *const limit, const std::vector< LocalSearchFilter * > &filters) |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder) |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, SearchLimit *const limit) |
LocalSearchPhaseParameters * | MakeLocalSearchPhaseParameters (SolutionPool *const pool, LocalSearchOperator *const ls_operator, DecisionBuilder *const sub_decision_builder, SearchLimit *const limit, const std::vector< LocalSearchFilter * > &filters) |
LocalSearchFilter * | MakeVariableDomainFilter () |
Local Search Filters. | |
LocalSearchFilter * | MakeLocalSearchObjectiveFilter (const IntVar *const *vars, int size, IndexEvaluator2 *const values, const IntVar *const objective, Solver::LocalSearchFilterBound filter_enum, Solver::LocalSearchOperation op_enum) |
namespace | |
LocalSearchFilter * | MakeLocalSearchObjectiveFilter (const std::vector< IntVar * > &vars, IndexEvaluator2 *const values, const IntVar *const objective, Solver::LocalSearchFilterBound filter_enum, Solver::LocalSearchOperation op_enum) |
LocalSearchFilter * | MakeLocalSearchObjectiveFilter (const IntVar *const *vars, const IntVar *const *secondary_vars, int size, ResultCallback3< int64, int64, int64, int64 > *const values, const IntVar *const objective, Solver::LocalSearchFilterBound filter_enum, Solver::LocalSearchOperation op_enum) |
void | TopPeriodicCheck () |
Performs PeriodicCheck on the top-level search; can be called from a nested solve to check top-level limits for instance. | |
int | TopProgressPercent () |
Returns a percentage representing the propress of the search before reaching the limits of the top-level search (can be called from a nested solve). | |
void | PushState () |
The PushState and PopState methods manipulates the states of the reversible objects. | |
void | PopState () |
int | SearchDepth () const |
Gets the search depth of the current active search. | |
int | SearchLeftDepth () const |
Gets the search left depth of the current active search. | |
int | SolveDepth () const |
Gets the number of nested searches. | |
void | SetBranchSelector (ResultCallback1< Solver::DecisionModification, Solver * > *const bs) |
Sets the given branch selector on the current active search. | |
DecisionBuilder * | MakeApplyBranchSelector (ResultCallback1< Solver::DecisionModification, Solver * > *const bs) |
Creates a decision builder that will set the branch selector. | |
template<class T> | |
void | SaveAndSetValue (T *adr, T val) |
All-in-one SaveAndSetValue. | |
template<class T> | |
void | SaveAndAdd (T *adr, T val) |
All-in-one SaveAndAdd_value. | |
int64 | Rand64 (int64 size) |
Returns a random value between 0 and 'size' - 1;. | |
int32 | Rand32 (int32 size) |
Returns a random value between 0 and 'size' - 1;. | |
void | ReSeed (int32 seed) |
Reseed the solver random generator. | |
void | AddFailHook (Action *a) |
Adds a fail hook, that is an action that will be called after each failure. | |
void | ExportProfilingOverview (const string &filename) |
Exports the profiling information in a human readable overview. | |
bool | CurrentlyInSolve () const |
Returns true whether the current search has been created using a Solve() call instead of a NewSearch 0ne. | |
int | constraints () const |
Counts the number of constraints that have been added to the solver before the search,. | |
void | Accept (ModelVisitor *const visitor) const |
Accepts the given model visitor. | |
void | Accept (ModelVisitor *const visitor, const std::vector< SearchMonitor * > &monitors) const |
Accepts the given model visitor. | |
Decision * | balancing_decision () const |
void | set_fail_intercept (Closure *const c) |
Internal set_fail_intercept does not take ownership of the closure. | |
void | clear_fail_intercept () |
DemonProfiler * | demon_profiler () const |
Access to demon profiler. | |
bool | HasName (const PropagationBaseObject *object) const |
Returns whether the object has been named or not. | |
Demon * | RegisterDemon (Demon *const d) |
Adds a new demon and wraps it inside a DemonProfiler if necessary. | |
IntExpr * | RegisterIntExpr (IntExpr *const expr) |
Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary. | |
IntVar * | RegisterIntVar (IntVar *const var) |
Registers a new IntVar and wraps it inside a TraceIntVar if necessary. | |
IntervalVar * | RegisterIntervalVar (IntervalVar *const var) |
Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary. | |
Search * | ActiveSearch () const |
Returns the active search, NULL outside search. | |
ModelCache * | Cache () const |
Returns the cache of the model. | |
bool | InstrumentsDemons () const |
Returns whether we are instrumenting demons. | |
bool | IsProfilingEnabled () const |
Returns whether we are profiling the solver. | |
bool | InstrumentsVariables () const |
Returns whether we are tracing variables. | |
bool | NameAllVariables () const |
Returns whether all variables should be named. | |
string | model_name () const |
Returns the name of the model. | |
DependencyGraph * | Graph () const |
Returns the dependency graph of the solver. | |
PropagationMonitor * | GetPropagationMonitor () const |
Returns the propagation monitor. | |
void | AddPropagationMonitor (PropagationMonitor *const monitor) |
Adds the propagation monitor to the solver. | |
bool | Solve (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
bool | Solve (DecisionBuilder *const db, SearchMonitor *const *monitors, int size) |
bool | Solve (DecisionBuilder *const db) |
bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1) |
bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2) |
bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
bool | Solve (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3, SearchMonitor *const m4) |
void | NewSearch (DecisionBuilder *const db, const std::vector< SearchMonitor * > &monitors) |
void | NewSearch (DecisionBuilder *const db, SearchMonitor *const *monitors, int size) |
Opens a new top level search. | |
void | NewSearch (DecisionBuilder *const db) |
void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1) |
void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2) |
void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3) |
void | NewSearch (DecisionBuilder *const db, SearchMonitor *const m1, SearchMonitor *const m2, SearchMonitor *const m3, SearchMonitor *const m4) |
bool | NextSolution () |
namespace | |
void | RestartSearch () |
void | EndSearch () |
Static Public Member Functions | |
static bool | UpgradeModel (CPModelProto *const proto) |
Upgrades the model to the latest version. | |
static int64 | MemoryUsage () |
Current memory usage in bytes. | |
Static Public Attributes | |
static const int | kNumPriorities = 3 |
Number of priorities for demons. | |
Friends | |
class | BaseIntExpr |
class | Constraint |
class | DemonProfiler |
class | FindOneNeighbor |
class | IntVar |
class | PropagationBaseObject |
class | Queue |
class | SearchMonitor |
class | SimpleRevFIFO |
class | RevImmutableMultiMap |
void | InternalSaveBooleanVarValue (Solver *const, IntVar *const) |
void | SetQueueCleanerOnFail (Solver *const, IntVar *const) |
Classes | |
struct | IntegerCastInfo |
Holds semantic information stating that the 'expression' has been cast into 'variable' using the Var() method, and that 'maintainer' is responsible for maintaining the equality between 'variable' and 'expression'. More... |
A solver represent the main computation engine. It implements the whole range of Constraint Programming protocol:
Usually, a Constraint Programming code consists of
For the time being, Solver is not MT_SAFE, nor MT_HOT.
Definition at line 342 of file constraint_solver.h.
typedef ResultCallback1<int64, int64> operations_research::Solver::IndexEvaluator1 |
typedef ResultCallback2<int64, int64, int64> operations_research::Solver::IndexEvaluator2 |
Definition at line 346 of file constraint_solver.h.
typedef ResultCallback3<int64, int64, int64, int64> operations_research::Solver::IndexEvaluator3 |
Definition at line 347 of file constraint_solver.h.
typedef ResultCallback2<IntExpr*, CPModelLoader*, const CPIntegerExpressionProto&> operations_research::Solver::IntegerExpressionBuilder |
Definition at line 351 of file constraint_solver.h.
typedef ResultCallback2<Constraint*, CPModelLoader*, const CPConstraintProto&> operations_research::Solver::ConstraintBuilder |
Definition at line 354 of file constraint_solver.h.
typedef ResultCallback2<IntervalVar*, CPModelLoader*, const CPIntervalVariableProto&> operations_research::Solver::IntervalVariableBuilder |
Definition at line 358 of file constraint_solver.h.
typedef ResultCallback2<SequenceVar*, CPModelLoader*, const CPSequenceVariableProto&> operations_research::Solver::SequenceVariableBuilder |
Definition at line 362 of file constraint_solver.h.
This enum describes the strategy used to select the next branching variable at each node during the search.
Definition at line 382 of file constraint_solver.h.
This enum describes the strategy used to select the next variable value to set.
Definition at line 436 of file constraint_solver.h.
This enum is used by Solver::MakePhase to specify how to select variables and values during the search.
In Solver::MakePhase(const std::vector<IntVar*>&, IntVarStrategy, IntValueStrategy), variables are selected first, and then the associated value. In Solver::MakePhase(const std::vector<IntVar*>& vars, IndexEvaluator2*, EvaluatorStrategy), the selection is done scanning every pair <variable, possible value>. The next selected pair is then the best among all possibilities, i.e. the pair with the smallest evaluation. As this is costly, two options are offered: static or dynamic evaluation.
Definition at line 468 of file constraint_solver.h.
Used for scheduling. Not yet implemented.
SEQUENCE_DEFAULT | |
SEQUENCE_SIMPLE | |
CHOOSE_MIN_SLACK_RANK_FORWARD | |
CHOOSE_RANDOM_RANK_FORWARD |
Definition at line 483 of file constraint_solver.h.
This enum is used in Solver::MakeOperator to specify the neighborhood to create.
Definition at line 499 of file constraint_solver.h.
This enum is used in Solver::MakeOperator associated with an evaluator to specify the neighborhood to create.
Definition at line 624 of file constraint_solver.h.
This enum is used in Solver::MakeLocalSearchObjectiveFilter.
It specifies the behavior of the objective filter to create. The goal is to define under which condition a move is accepted based on the current objective value.
Definition at line 652 of file constraint_solver.h.
This enum is used in Solver::MakeLocalSearchObjectiveFilter.
It specifies the operation used in the objective to build the corresponding filter.
SUM |
The objective is the sum of the variables defined in Solver::MakeLocalSearchObjectiveFilter.
|
PROD |
The objective is the product of the variables defined in Solver::MakeLocalSearchObjectiveFilter.
|
MAX |
The objective is the max of the variables defined in Solver::MakeLocalSearchObjectiveFilter.
|
MIN |
The objective is the min of the variables defined in Solver::MakeLocalSearchObjectiveFilter.
|
Definition at line 664 of file constraint_solver.h.
This enum represents the three possible priorities for a demon in the Solver queue.
Note this is for advanced users only.
Definition at line 685 of file constraint_solver.h.
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between the two intervals t1 and t2.
Definition at line 699 of file constraint_solver.h.
This enum is used in Solver::MakeIntervalVarRelation to specify the temporal relation between an interval t and an integer d.
Definition at line 732 of file constraint_solver.h.
The Solver is responsible for creating the search tree.
Thanks to the DecisionBuilder, it creates a new decision with two branches at each node: left and right. The DecisionModification enum is used to specify how the branch selector should behave.
Definition at line 767 of file constraint_solver.h.
This enum is used internally in private methods Solver::PushState and Solver::PopState to tag states in the search tree.
Definition at line 793 of file constraint_solver.h.
This enum represents the state of the solver w.r.t. the search.
Definition at line 801 of file constraint_solver.h.
operations_research::Solver::Solver | ( | const string & | modelname | ) | [explicit] |
Definition at line 1407 of file constraint_solver.cc.
operations_research::Solver::Solver | ( | const string & | modelname, | |
const SolverParameters & | parameters | |||
) |
Definition at line 1373 of file constraint_solver.cc.
operations_research::Solver::~Solver | ( | ) |
Definition at line 1457 of file constraint_solver.cc.
const SolverParameters& operations_research::Solver::parameters | ( | ) | const [inline] |
void operations_research::Solver::SaveValue | ( | T * | o | ) | [inline] |
reversibility
SaveValue() will save the value of the corresponding object. It must be called before modifying the object. The value will be restored upon backtrack.
Definition at line 822 of file constraint_solver.h.
T* operations_research::Solver::RevAlloc | ( | T * | object | ) | [inline] |
Registers the given object as being reversible.
By calling this method, the caller gives ownership of the object to the solver, which will delete it when there is a backtrack out of the current state.
Returns the argument for convenience: this way, the caller may directly invoke a constructor in the argument, without having to store the pointer first.
This function is only for users that define their own subclasses of BaseObject: for all subclasses predefined in the library, the corresponding factory methods (e.g., MakeIntVar(...), MakeAllDifferent(...) already take care of the registration.
Definition at line 838 of file constraint_solver.h.
T* operations_research::Solver::RevAllocArray | ( | T * | object | ) | [inline] |
Like RevAlloc() above, but for an array of objects: the array must have been allocated with the new[] operator.
The entire array will be deleted when backtracking out of the current state.
This method is valid for arrays of int, int64, uint64, bool, BaseObject*, IntVar*, IntExpr*, and Constraint*.
Definition at line 848 of file constraint_solver.h.
void operations_research::Solver::AddConstraint | ( | Constraint *const | c | ) |
propagation
Adds the constraint 'c' to the model.
After calling this method, and until there is a backtrack that undoes the addition, any assignment of variables to values must satisfy the given constraint in order to be considered feasible. There are two fairly different use cases:
state() == OUTSIDE_SEARCH
). Most users should only use AddConstraint in this way. In this case, the constraint will belong to the model forever: it cannot not be removed by backtracking.
state() == IN_SEARCH
or state() == IN_ROOT_NODE
). When a constraint is added during a search, it applies only to the subtree of the search tree rooted at the current node, and will be automatically removed by bracktracking.
This method does not take ownership of the constraint. If the constraint has been created by any factory method (Solver::MakeXXX), it will automatically be deleted. However, power users who implement their own constraints should do: solver.AddConstraint(solver.RevAlloc(new MyConstraint(...));
Definition at line 1659 of file constraint_solver.cc.
void operations_research::Solver::AddCastConstraint | ( | CastConstraint *const | c, | |
IntVar *const | target_var, | |||
IntExpr *const | casted_expression | |||
) |
Adds the constraint 'c' to the solver and marks it as a cast constraint, that is, a constraint created calling Var() on an expression.
This is used internally.
Definition at line 1679 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
const std::vector< SearchMonitor * > & | monitors | |||
) |
Solves the problem using the given DecisionBuilder and returns true if a solution was found and accepted.
These methods are the ones most users should use to search for a solution. Note that the definition of 'solution' is subtle. A solution here is defined as a leaf of the search tree with respect to the given decision builder for which there is no failure. What this means is that, contrary to intuition, a solution may not have all variables of the model bound. It is the responsibility of the decision builder to keep returning decisions until all variables are indeed bound. The most extreme counterexample is calling Solve with a trivial decision builder whose Next() method always returns NULL. In this case, Solve immediately returns 'true', since not assigning any variable to any value is a solution, unless the root node propagation discovers that the model is infeasible.
These function must be called from outside of search, meaning that state() == OUTSIDE_SEARCH
.
Solve will terminate whenever any of the following event arise: A search monitor asks the solver to terminate the search by calling SearchMonitor::FinishCurrentSearch(). A solution is found that is accepted by all search monitors, and none of the search monitors decides to search for another one.
Upon search termination, there will be a series of backtracks all the way to the top level. This means that a user cannot expect to inspect the solution by querying variables after a call to Solve(): all the information will be lost. In order to do something with the solution, the user must either: Use a search monitor that can process such a leaf. See, in particular, the SolutionCollector class. Do not use Solve. Instead, use the more fine-grained approach using methods NewSearch(...), NextSolution(), and EndSearch().
db | The decision builder that will generate the search tree. | |
monitors | A vector of search monitors that will be notified of various events during the search. In their reaction to these events, such monitors may influence the search. |
Definition at line 1782 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
SearchMonitor *const * | monitors, | |||
int | size | |||
) |
Definition at line 1830 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db | ) |
Definition at line 1793 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1 | |||
) |
Definition at line 1787 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2 | |||
) |
Definition at line 1797 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2, | |||
SearchMonitor *const | m3 | |||
) |
Definition at line 1806 of file constraint_solver.cc.
bool operations_research::Solver::Solve | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2, | |||
SearchMonitor *const | m3, | |||
SearchMonitor *const | m4 | |||
) |
Definition at line 1817 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
const std::vector< SearchMonitor * > & | monitors | |||
) |
Decomposed top level search. The code should look like solver->NewSearch(db); while (solver->NextSolution()) { .. use the current solution } solver()->EndSearch();
Definition at line 1841 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
SearchMonitor *const * | monitors, | |||
int | size | |||
) |
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db | ) |
Definition at line 1852 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1 | |||
) |
Definition at line 1846 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2 | |||
) |
Definition at line 1856 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2, | |||
SearchMonitor *const | m3 | |||
) |
Definition at line 1865 of file constraint_solver.cc.
void operations_research::Solver::NewSearch | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2, | |||
SearchMonitor *const | m3, | |||
SearchMonitor *const | m4 | |||
) |
Definition at line 1876 of file constraint_solver.cc.
bool operations_research::Solver::NextSolution | ( | ) |
namespace
Search for the next solution in the search tree.
Definition at line 2126 of file constraint_solver.cc.
void operations_research::Solver::RestartSearch | ( | ) |
Definition at line 2013 of file constraint_solver.cc.
void operations_research::Solver::EndSearch | ( | ) |
Definition at line 2292 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore, | |||
const std::vector< SearchMonitor * > & | monitors | |||
) |
Nested solve using a decision builder and up to three search monitors, usually one for the objective, one for the limits and one to collect solutions.
The restore parameter indicates if the search should backtrack completely after completion, even in case of success.
Definition at line 2385 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore, | |||
SearchMonitor *const * | monitors, | |||
int | size | |||
) |
Definition at line 2425 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore | |||
) |
Definition at line 2399 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore, | |||
SearchMonitor *const | m1 | |||
) |
Definition at line 2391 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore, | |||
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2 | |||
) |
Definition at line 2403 of file constraint_solver.cc.
bool operations_research::Solver::NestedSolve | ( | DecisionBuilder *const | db, | |
bool | restore, | |||
SearchMonitor *const | m1, | |||
SearchMonitor *const | m2, | |||
SearchMonitor *const | m3 | |||
) |
Definition at line 2413 of file constraint_solver.cc.
bool operations_research::Solver::CheckAssignment | ( | Assignment *const | assignment | ) |
Checks whether the given assignment satisfies all the relevant constraints.
Definition at line 2305 of file constraint_solver.cc.
bool operations_research::Solver::CheckConstraint | ( | Constraint *const | constraint | ) |
Checks whether adding this constraint will lead to an immediate failure.
It will return true if the model is already inconsistent, or if adding the constraint makes it inconsistent.
Definition at line 2381 of file constraint_solver.cc.
SolverState operations_research::Solver::state | ( | ) | const [inline] |
void operations_research::Solver::Fail | ( | ) |
Abandon the current branch in the search tree. A backtrack will follow.
Definition at line 2474 of file constraint_solver.cc.
void operations_research::Solver::ExportModel | ( | CPModelProto *const | proto | ) | const |
void operations_research::Solver::ExportModel | ( | const std::vector< SearchMonitor * > & | monitors, | |
CPModelProto *const | proto | |||
) | const |
bool operations_research::Solver::LoadModel | ( | const CPModelProto & | proto | ) |
bool operations_research::Solver::LoadModel | ( | const CPModelProto & | proto, | |
std::vector< SearchMonitor * > * | monitors | |||
) |
bool operations_research::Solver::UpgradeModel | ( | CPModelProto *const | proto | ) | [static] |
bool operations_research::Solver::CollectDecisionVariables | ( | std::vector< IntVar * > *const | primary_integer_variables, | |
std::vector< IntVar * > *const | secondary_integer_variables, | |||
std::vector< SequenceVar * > *const | sequence_variables, | |||
std::vector< IntervalVar * > *const | interval_variables | |||
) |
Collects decision variables.
namespace
All decision variables will be collected in 4 groups:
From these 4 groups, one could write a decision builder: solver.Compose( solver.MakeDefaultPhase(primary_integer_variables), solver.MakePhase(sequence_variables, Solver::SEQUENCE_DEFAULT), solver.MakePhase(interval_variables, Solver::INTERVAL_DEFAULT), solver.MakePhase(secondary_integer_variables, Solver::INT_VAR_DEFAULT); SWIG
Definition at line 201 of file collect_variables.cc.
void operations_research::Solver::RegisterBuilder | ( | const string & | tag, | |
ConstraintBuilder *const | builder | |||
) |
void operations_research::Solver::RegisterBuilder | ( | const string & | tag, | |
IntegerExpressionBuilder *const | builder | |||
) |
void operations_research::Solver::RegisterBuilder | ( | const string & | tag, | |
IntervalVariableBuilder *const | builder | |||
) |
void operations_research::Solver::RegisterBuilder | ( | const string & | tag, | |
SequenceVariableBuilder *const | builder | |||
) |
Solver::ConstraintBuilder * operations_research::Solver::GetConstraintBuilder | ( | const string & | tag | ) | const |
Solver::IntegerExpressionBuilder * operations_research::Solver::GetIntegerExpressionBuilder | ( | const string & | tag | ) | const |
Solver::IntervalVariableBuilder * operations_research::Solver::GetIntervalVariableBuilder | ( | const string & | tag | ) | const |
Solver::SequenceVariableBuilder * operations_research::Solver::GetSequenceVariableBuilder | ( | const string & | tag | ) | const |
void operations_research::Solver::AddBacktrackAction | ( | Action * | a, | |
bool | fast | |||
) |
When SaveValue() is not the best way to go, one can create a reversible action that will be called upon backtrack.
The "fast" parameter indicates whether we need restore all values saved through SaveValue() before calling this method.
Definition at line 1571 of file constraint_solver.cc.
string operations_research::Solver::DebugString | ( | ) | const |
int64 operations_research::Solver::MemoryUsage | ( | ) | [static] |
int64 operations_research::Solver::wall_time | ( | ) | const |
wall_time() in ms since the creation of the solver.
Definition at line 1524 of file constraint_solver.cc.
int64 operations_research::Solver::branches | ( | ) | const [inline] |
number of branches explored since the creation of the solver.
Definition at line 1099 of file constraint_solver.h.
int64 operations_research::Solver::solutions | ( | ) | const |
number of solutions found since the start of the search.
Definition at line 1528 of file constraint_solver.cc.
int64 operations_research::Solver::demon_runs | ( | DemonPriority | p | ) | const [inline] |
number of demons executed during search for a given priority.
Definition at line 1105 of file constraint_solver.h.
int64 operations_research::Solver::failures | ( | ) | const [inline] |
number of failures encountered since the creation of the solver.
Definition at line 1108 of file constraint_solver.h.
int64 operations_research::Solver::neighbors | ( | ) | const [inline] |
int64 operations_research::Solver::filtered_neighbors | ( | ) | const [inline] |
number of filtered neighbors (neighbors accepted by filters)
Definition at line 1114 of file constraint_solver.h.
int64 operations_research::Solver::accepted_neighbors | ( | ) | const [inline] |
uint64 operations_research::Solver::stamp | ( | ) | const |
The stamp indicates how many moves in the search tree we have performed.
It is useful to detect if we need to update same lazy structures.
Definition at line 1639 of file constraint_solver.cc.
uint64 operations_research::Solver::fail_stamp | ( | ) | const |
The fail_stamp() is incremented after each backtrack.
Definition at line 1643 of file constraint_solver.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | int64 | vmin, | |
int64 | vmax, | |||
const string & | name | |||
) |
Make Factory.
API.
All factories (MakeXXX methods) encapsulate creation of objects through RevAlloc(). Hence, the Solver used for allocating the returned object will retain ownership of the allocated memory. Destructors are called upon backtrack, or when the Solver is itself destructed. Int Variables and Constants MakeIntVar will create the best range based int var for the bounds given.
Definition at line 4307 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int64 > & | values, | |
const string & | name | |||
) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 4330 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int > & | values, | |
const string & | name | |||
) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 4345 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | int64 | vmin, | |
int64 | vmax | |||
) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 4318 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int64 > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 4341 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntVar | ( | const std::vector< int > & | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 4356 of file expressions.cc.
IntVar * operations_research::Solver::MakeBoolVar | ( | const string & | name | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 4322 of file expressions.cc.
IntVar * operations_research::Solver::MakeBoolVar | ( | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 4326 of file expressions.cc.
IntVar * operations_research::Solver::MakeIntConst | ( | int64 | val, | |
const string & | name | |||
) |
IntVar * operations_research::Solver::MakeIntConst | ( | int64 | val | ) |
void operations_research::Solver::MakeIntVarArray | ( | int | var_count, | |
int64 | vmin, | |||
int64 | vmax, | |||
const string & | name, | |||
std::vector< IntVar * > * | vars | |||
) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having name "name<i>" where is the index of the variable.
namespace
Definition at line 4391 of file expressions.cc.
void operations_research::Solver::MakeIntVarArray | ( | int | var_count, | |
int64 | vmin, | |||
int64 | vmax, | |||
std::vector< IntVar * > * | vars | |||
) |
This method will append the vector vars with 'var_count' variables having bounds vmin and vmax and having no names.
Definition at line 4401 of file expressions.cc.
IntVar ** operations_research::Solver::MakeIntVarArray | ( | int | var_count, | |
int64 | vmin, | |||
int64 | vmax, | |||
const string & | name | |||
) |
void operations_research::Solver::MakeBoolVarArray | ( | int | var_count, | |
const string & | name, | |||
std::vector< IntVar * > * | vars | |||
) |
This method will append the vector vars with 'var_count' boolean variables having name "name<i>" where is the index of the variable.
Definition at line 4421 of file expressions.cc.
void operations_research::Solver::MakeBoolVarArray | ( | int | var_count, | |
std::vector< IntVar * > * | vars | |||
) |
This method will append the vector vars with 'var_count' boolean variables having no names.
Definition at line 4429 of file expressions.cc.
IntVar ** operations_research::Solver::MakeBoolVarArray | ( | int | var_count, | |
const string & | name | |||
) |
IntExpr * operations_research::Solver::MakeDiv | ( | IntExpr *const | numerator, | |
IntExpr *const | denominator | |||
) |
numerator / denominator (integer division). Terms need to be positive.
Definition at line 4790 of file expressions.cc.
IntExpr * operations_research::Solver::MakeElement | ( | IndexEvaluator1 * | values, | |
IntVar *const | index | |||
) |
Function-based element.
namespace
The constraint takes ownership of callback The callback must be able to cope with any possible value in the domain of 'index' (potentially negative ones too).
Definition at line 731 of file element.cc.
IntExpr * operations_research::Solver::MakeMonotonicElement | ( | IndexEvaluator1 * | values, | |
bool | increasing, | |||
IntVar *const | index | |||
) |
Function based element.
namespace
The constraint takes ownership of callback. The callback must be monotonic. It must be able to cope with any possible value in the domain of 'index' (potentially negative ones too). Furtermore, monotonicity is not checked. Thus giving a non monotonic function, or specifying an incorrect increasing parameter will result in undefined behavior.
Definition at line 757 of file element.cc.
IntExpr * operations_research::Solver::MakeElement | ( | IndexEvaluator2 * | values, | |
IntVar *const | index1, | |||
IntVar *const | index2 | |||
) |
2D version of function-based element expression, values(expr1, expr2).
namespace
Definition at line 1005 of file element.cc.
IntExpr * operations_research::Solver::MakeSemiContinuousExpr | ( | IntExpr *const | e, | |
int64 | fixed_charge, | |||
int64 | step | |||
) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b) a >= 0 and b >= 0.
Definition at line 4931 of file expressions.cc.
Constraint * operations_research::Solver::MakeTrueConstraint | ( | ) |
Constraints This constraint always succeeds.
namespace
Definition at line 105 of file constraints.cc.
Constraint * operations_research::Solver::MakeFalseConstraint | ( | ) |
Constraint * operations_research::Solver::MakeFalseConstraint | ( | const string & | explanation | ) |
Definition at line 138 of file constraints.cc.
Constraint * operations_research::Solver::MakeIsEqualCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsEqualCt | ( | IntExpr *const | v1, | |
IntExpr * | v2, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeEquality | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeEquality | ( | IntExpr *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeEquality | ( | IntExpr *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeIsDifferentCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsDifferentCt | ( | IntExpr *const | v1, | |
IntExpr *const | v2, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeNonEquality | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeNonEquality | ( | IntVar *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeNonEquality | ( | IntVar *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeIsLessOrEqualCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsLessOrEqualCt | ( | IntExpr *const | left, | |
IntExpr *const | right, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeLessOrEqual | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeLessOrEqual | ( | IntExpr *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeLessOrEqual | ( | IntExpr *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeIsGreaterOrEqualCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsGreaterOrEqualCt | ( | IntExpr *const | left, | |
IntExpr *const | right, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeGreaterOrEqual | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeGreaterOrEqual | ( | IntExpr *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeGreaterOrEqual | ( | IntExpr *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeIsGreaterCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsGreaterCt | ( | IntExpr *const | left, | |
IntExpr *const | right, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeGreater | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeGreater | ( | IntExpr *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeGreater | ( | IntExpr *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeIsLessCstCt | ( | IntVar *const | v, | |
int64 | c, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsLessCt | ( | IntExpr *const | left, | |
IntExpr *const | right, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeLess | ( | IntVar *const | left, | |
IntVar *const | right | |||
) |
Constraint * operations_research::Solver::MakeLess | ( | IntExpr *const | expr, | |
int64 | value | |||
) |
Constraint * operations_research::Solver::MakeLess | ( | IntExpr *const | expr, | |
int | value | |||
) |
Constraint * operations_research::Solver::MakeSumLessOrEqual | ( | const std::vector< IntVar * > & | vars, | |
int64 | cst | |||
) |
Constraint * operations_research::Solver::MakeSumLessOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int64 | cst | |||
) |
Definition at line 2571 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, | |
int64 | cst | |||
) |
Definition at line 2581 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumGreaterOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int64 | cst | |||
) |
Definition at line 2586 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumEquality | ( | const std::vector< IntVar * > & | vars, | |
int64 | cst | |||
) |
Definition at line 2596 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumEquality | ( | IntVar *const * | vars, | |
int | size, | |||
int64 | cst | |||
) |
Definition at line 2600 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumEquality | ( | const std::vector< IntVar * > & | vars, | |
IntVar *const | var | |||
) |
Definition at line 2619 of file expr_array.cc.
Constraint * operations_research::Solver::MakeSumEquality | ( | IntVar *const * | vars, | |
int | size, | |||
IntVar *const | var | |||
) |
Definition at line 2624 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2634 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdEquality | ( | IntVar *const * | vars, | |
int | size, | |||
int64 const * | coefficients, | |||
int64 | cst | |||
) |
Constraint * operations_research::Solver::MakeScalProdEquality | ( | IntVar *const * | vars, | |
int | size, | |||
int const * | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2687 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdEquality | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2644 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2694 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int64 const * | coefficients, | |||
int64 | cst | |||
) |
Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2704 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdGreaterOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int const * | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2741 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2749 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int64 const * | coefficients, | |||
int64 | cst | |||
) |
Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2759 of file expr_array.cc.
Constraint * operations_research::Solver::MakeScalProdLessOrEqual | ( | IntVar *const * | vars, | |
int | size, | |||
int const * | coefficients, | |||
int64 | cst | |||
) |
Definition at line 2811 of file expr_array.cc.
Demon * operations_research::Solver::MakeConstraintInitialPropagateCallback | ( | Constraint *const | ct | ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 28 of file constraints.cc.
Demon * operations_research::Solver::MakeDelayedConstraintInitialPropagateCallback | ( | Constraint *const | ct | ) |
This method is a specialized case of the MakeConstraintDemon method to call the InitiatePropagate of the constraint 'ct' with low priority.
Definition at line 35 of file constraints.cc.
Demon * operations_research::Solver::MakeCallbackDemon | ( | Closure *const | closure | ) |
Constraint * operations_research::Solver::MakeBetweenCt | ( | IntVar *const | v, | |
int64 | l, | |||
int64 | u | |||
) |
Constraint * operations_research::Solver::MakeIsBetweenCt | ( | IntVar *const | v, | |
int64 | l, | |||
int64 | u, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntVar *const | v, | |
const int64 *const | values, | |||
int | size, | |||
IntVar *const | b | |||
) |
Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntVar *const | v, | |
const std::vector< int64 > & | values, | |||
IntVar *const | b | |||
) |
Definition at line 1026 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntVar *const | v, | |
const int *const | values, | |||
int | size, | |||
IntVar *const | b | |||
) |
Definition at line 1032 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeIsMemberCt | ( | IntVar *const | v, | |
const std::vector< int > & | values, | |||
IntVar *const | b | |||
) |
Definition at line 1044 of file expr_cst.cc.
IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntVar *const | v, | |
const int64 *const | values, | |||
int | size | |||
) |
Definition at line 1050 of file expr_cst.cc.
IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntVar *const | v, | |
const std::vector< int64 > & | values | |||
) |
Definition at line 1058 of file expr_cst.cc.
IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntVar *const | v, | |
const int *const | values, | |||
int | size | |||
) |
Definition at line 1063 of file expr_cst.cc.
IntVar * operations_research::Solver::MakeIsMemberVar | ( | IntVar *const | v, | |
const std::vector< int > & | values | |||
) |
Definition at line 1071 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeMemberCt | ( | IntVar *const | v, | |
const int64 *const | values, | |||
int | size | |||
) |
v in set.
namespace
Propagation is lazy, i.e. this constraint does not creates holes in the domain of the variable.
Definition at line 899 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeMemberCt | ( | IntVar *const | v, | |
const std::vector< int64 > & | values | |||
) |
Definition at line 907 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeMemberCt | ( | IntVar *const | v, | |
const int *const | values, | |||
int | size | |||
) |
Definition at line 912 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeMemberCt | ( | IntVar *const | v, | |
const std::vector< int > & | values | |||
) |
Definition at line 920 of file expr_cst.cc.
Constraint * operations_research::Solver::MakeCount | ( | const std::vector< IntVar * > & | v, | |
int64 | value, | |||
int64 | count | |||
) |
Constraint * operations_research::Solver::MakeCount | ( | const std::vector< IntVar * > & | v, | |
int64 | value, | |||
IntVar *const | count | |||
) |
Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | values, | |||
const std::vector< IntVar * > & | cards | |||
) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
namespace
Factory
Definition at line 1107 of file count_cst.cc.
Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | values, | |||
const std::vector< IntVar * > & | cards | |||
) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j].
Definition at line 1138 of file count_cst.cc.
Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< IntVar * > & | cards | |||
) |
Aggregated version of count: |{i | v[i] == j}| == cards[j].
Definition at line 1169 of file count_cst.cc.
Constraint * operations_research::Solver::MakeDistribute | ( | const std::vector< IntVar * > & | vars, | |
int64 | card_min, | |||
int64 | card_max, | |||
int64 | card_size | |||
) |
Aggregated version of count with bounded cardinalities: forall j in 0 .
. card_size - 1: card_min <= |{i | v[i] == j}| <= card_max
Definition at line 1184 of file count_cst.cc.
Constraint * operations_research::Solver::MakeDeviation | ( | const std::vector< IntVar * > & | vars, | |
IntVar *const | deviation_var, | |||
int64 | total_sum | |||
) |
Deviation constraint: sum_i |n * vars[i] - total_sum| <= deviation_var and sum_i vars[i] == total_sum n = vars.
namespace
Definition at line 427 of file deviation.cc.
Constraint * operations_research::Solver::MakeAllDifferent | ( | const std::vector< IntVar * > & | vars | ) |
All variables are pairwise different.
namespace
This corresponds to the stronger version of the propagation algorithm.
Definition at line 426 of file alldiff_cst.cc.
Constraint * operations_research::Solver::MakeAllDifferent | ( | const std::vector< IntVar * > & | vars, | |
bool | stronger_propagation | |||
) |
All variables are pairwise different.
If 'stronger_propagation' is true, stronger, and potentially slower propagation will occur. This API will be deprecated in the future.
Definition at line 430 of file alldiff_cst.cc.
Constraint * operations_research::Solver::MakeAllDifferent | ( | const IntVar *const * | vars, | |
int | size, | |||
bool | stronger_propagation | |||
) |
All variables are pairwise different.
If 'stronger_propagation' is true, stronger, and potentially slower propagation will occur. This API will be deprecated in the future.
Definition at line 435 of file alldiff_cst.cc.
Constraint * operations_research::Solver::MakeNoCycle | ( | const std::vector< IntVar * > & | nexts, | |
const std::vector< IntVar * > & | active, | |||
ResultCallback1< bool, int64 > * | sink_handler = NULL | |||
) |
Prevent cycles, nexts variables representing the next in the chain.
Active variables indicate if the corresponding next variable is active; this could be useful to model unperformed nodes in a routing problem. A callback can be added to specify sink values (by default sink values are values >= vars.size()). Ownership of the callback is passed to the constraint. If assume_paths is either not specified or true, the constraint assumes the 'next' variables represent paths (and performs a faster propagation); otherwise the constraint assumes the 'next' variables represent a forest.
Definition at line 574 of file constraints.cc.
Constraint * operations_research::Solver::MakeNoCycle | ( | const IntVar *const * | nexts, | |
const IntVar *const * | active, | |||
int | size, | |||
ResultCallback1< bool, int64 > * | sink_handler = NULL | |||
) |
Definition at line 580 of file constraints.cc.
Constraint * operations_research::Solver::MakeNoCycle | ( | const std::vector< IntVar * > & | nexts, | |
const std::vector< IntVar * > & | active, | |||
ResultCallback1< bool, int64 > * | sink_handler, | |||
bool | assume_paths | |||
) |
Constraint * operations_research::Solver::MakeNoCycle | ( | const IntVar *const * | nexts, | |
const IntVar *const * | active, | |||
int | size, | |||
ResultCallback1< bool, int64 > * | sink_handler, | |||
bool | assume_paths | |||
) |
Definition at line 556 of file constraints.cc.
Constraint * operations_research::Solver::MakePathCumul | ( | const std::vector< IntVar * > & | nexts, | |
const std::vector< IntVar * > & | active, | |||
const std::vector< IntVar * > & | cumuls, | |||
const std::vector< IntVar * > & | transits | |||
) |
Accumulate values along a path such that: cumuls[next[i]] = cumuls[i] + transits[i].
namespace
Active variables indicate if the corresponding next variable is active; this could be useful to model unperformed nodes in a routing problem.
Definition at line 814 of file constraints.cc.
Constraint * operations_research::Solver::MakePathCumul | ( | const IntVar *const * | nexts, | |
const IntVar *const * | active, | |||
const IntVar *const * | cumuls, | |||
const IntVar *const * | transits, | |||
int | next_size, | |||
int | cumul_size | |||
) |
Definition at line 827 of file constraints.cc.
Constraint * operations_research::Solver::MakeMapDomain | ( | IntVar *const | var, | |
IntVar *const * | vars, | |||
int | size | |||
) |
This constraint maps the domain of 'var' onto the array of variables 'vars'.
namespace
That is for all i in [0 .. size - 1]: vars[i] == 1 <=> var->Contains(i);
Definition at line 273 of file constraints.cc.
Constraint * operations_research::Solver::MakeMapDomain | ( | IntVar *const | var, | |
const std::vector< IntVar * > & | vars | |||
) |
This constraint maps the domain of 'var' onto the array of variables 'vars'.
That is for all i in [0 .. size - 1]: vars[i] == 1 <=> var->Contains(i);
Definition at line 278 of file constraints.cc.
Constraint * operations_research::Solver::MakeAllowedAssignments | ( | const std::vector< IntVar * > & | vars, | |
const IntTupleSet & | tuples | |||
) |
Constraint * operations_research::Solver::MakeTransitionConstraint | ( | const std::vector< IntVar * > & | vars, | |
const IntTupleSet & | transitions, | |||
int64 | initial_state, | |||
const std::vector< int64 > & | final_states | |||
) |
This constraint create a finite automaton that will check the sequence of variables vars.
namespace
It uses a transition table called 'transitions'. Each transition is a triple (current_state, variable_value, new_state). The initial state is given, and the set of accepted states is decribed by 'final_states'. These states are hidden inside the constraint. Only the transitions (i.e. the variables) are visible.
Constraint * operations_research::Solver::MakeTransitionConstraint | ( | const std::vector< IntVar * > & | vars, | |
const IntTupleSet & | transitions, | |||
int64 | initial_state, | |||
const std::vector< int > & | final_states | |||
) |
This constraint create a finite automaton that will check the sequence of variables vars.
It uses a transition table called 'transitions'. Each transition is a triple (current_state, variable_value, new_state). The initial state is given, and the set of accepted states is decribed by 'final_states'. These states are hidden inside the constraint. Only the transitions (i.e. the variables) are visible.
Pack * operations_research::Solver::MakePack | ( | const std::vector< IntVar * > & | vars, | |
int | number_of_bins | |||
) |
Packing constraint.
This constraint packs all variables onto 'number_of_bins' variables. For any given variable, a value of 'number_of_bins' indicates that the variable is not assigned to any bin. Dimensions, i.e. cumulative constraints on this packing can be added directly from the pack class.
IntervalVar * operations_research::Solver::MakeFixedDurationIntervalVar | ( | int64 | start_min, | |
int64 | start_max, | |||
int64 | duration, | |||
bool | optional, | |||
const string & | name | |||
) |
scheduling objects
Creates an interval var with a fixed duration. The duration must be greater than 0. If optional is true, then the interval can be performed or unperformed. If optional is false, then the interval is always performed.
Definition at line 1468 of file interval.cc.
void operations_research::Solver::MakeFixedDurationIntervalVarArray | ( | int | count, | |
int64 | start_min, | |||
int64 | start_max, | |||
int64 | duration, | |||
bool | optional, | |||
const string & | name, | |||
std::vector< IntervalVar * > * | array | |||
) |
This method fills the vector with 'count' interval var built with the corresponding parameters.
Definition at line 1488 of file interval.cc.
IntervalVar * operations_research::Solver::MakeFixedInterval | ( | int64 | start, | |
int64 | duration, | |||
const string & | name | |||
) |
IntervalVar * operations_research::Solver::MakeMirrorInterval | ( | IntervalVar *const | interval_var | ) |
Creates an interval var that is the mirror image of the given one, that is, the interval var obtained by reversing the axis.
namespace
Definition at line 93 of file interval.cc.
IntervalVar * operations_research::Solver::MakeIntervalRelaxedMin | ( | IntervalVar *const | interval_var | ) |
Creates and returns an interval variable that wraps around the given one, relaxing the min start and end.
Relaxing means making unbounded when optional. If the variable is non optional, this methods returns interval_var.
More precisely, such an interval variable behaves as follows: When the underlying must be performed, the returned interval variable behaves exactly as the underlying; When the underlying may or may not be performed, the returned interval variable behaves like the underlying, except that it is unbounded on the min side; When the underlying cannot be performed, the returned interval variable is of duration 0 and must be performed in an interval unbounded on both sides.
This is very useful to implement propagators that may only modify the start max or end max.
Definition at line 280 of file interval.cc.
IntervalVar * operations_research::Solver::MakeIntervalRelaxedMax | ( | IntervalVar *const | interval_var | ) |
Creates and returns an interval variable that wraps around the given one, relaxing the max start and end.
namespace
Relaxing means making unbounded when optional. If the variable is non optional, this methods returns interval_var.
More precisely, such an interval variable behaves as follows: When the underlying must be performed, the returned interval variable behaves exactly as the underlying; When the underlying may or may not be performed, the returned interval variable behaves like the underlying, except that it is unbounded on the max side; When the underlying cannot be performed, the returned interval variable is of duration 0 and must be performed in an interval unbounded on both sides.
This is very useful to implement propagators that may only modify the start min or end min.
Definition at line 271 of file interval.cc.
Constraint * operations_research::Solver::MakeIntervalVarRelation | ( | IntervalVar *const | t, | |
Solver::UnaryIntervalRelation | r, | |||
int64 | d | |||
) |
scheduling constraints
namespace
This method creates a relation between an interval var and a date.
Definition at line 128 of file timetabling.cc.
Constraint * operations_research::Solver::MakeIntervalVarRelation | ( | IntervalVar *const | t1, | |
Solver::BinaryIntervalRelation | r, | |||
IntervalVar *const | t2 | |||
) |
This method creates a relation between two an interval vars.
namespace
Definition at line 260 of file timetabling.cc.
Constraint * operations_research::Solver::MakeTemporalDisjunction | ( | IntervalVar *const | t1, | |
IntervalVar *const | t2, | |||
IntVar *const | alt | |||
) |
This constraint implements a temporal disjunction between two interval vars t1 and t2.
namespace
'alt' indicates which alternative was chosen (alt == 0 is equivalent to t1 before t2).
Definition at line 433 of file timetabling.cc.
Constraint * operations_research::Solver::MakeTemporalDisjunction | ( | IntervalVar *const | t1, | |
IntervalVar *const | t2 | |||
) |
This constraint implements a temporal disjunction between two interval vars.
Definition at line 439 of file timetabling.cc.
Constraint * operations_research::Solver::MakeDisjunctiveConstraint | ( | const std::vector< IntervalVar * > & | intervals | ) |
This constraint forces all interval vars into an non overlapping sequence.
namespace
Sequence Constraint
Definition at line 1727 of file resource.cc.
SequenceVar * operations_research::Solver::MakeSequenceVar | ( | const std::vector< IntervalVar * > & | intervals, | |
const string & | name | |||
) |
The sequence variable is used to rank disjoint intervals.
Factory methods.
It will post a SequenceConstraint upon creation.
Definition at line 2153 of file resource.cc.
Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, | |
const std::vector< int64 > & | demands, | |||
int64 | capacity, | |||
const string & | name | |||
) |
This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity.
Intervals and demands should be vectors of equal size.
Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint.
Definition at line 2161 of file resource.cc.
Constraint * operations_research::Solver::MakeCumulative | ( | const std::vector< IntervalVar * > & | intervals, | |
const std::vector< int > & | demands, | |||
int64 | capacity, | |||
const string & | name | |||
) |
This constraint forces that, for any integer t, the sum of the demands corresponding to an interval containing t does not exceed the given capacity.
Intervals and demands should be vectors of equal size.
Demands should only contain non-negative values. Zero values are supported, and the corresponding intervals are filtered out, as they neither impact nor are impacted by this constraint.
Definition at line 2177 of file resource.cc.
Assignment * operations_research::Solver::MakeAssignment | ( | ) |
Assignments.
This method creates an empty assignment.
Definition at line 1097 of file assignment.cc.
Assignment * operations_research::Solver::MakeAssignment | ( | const Assignment *const | a | ) |
This method creates an assignnment which is a copy of 'a'.
Definition at line 1101 of file assignment.cc.
SolutionCollector * operations_research::Solver::MakeFirstSolutionCollector | ( | const Assignment *const | assignment | ) |
SolutionCollector * operations_research::Solver::MakeFirstSolutionCollector | ( | ) |
SolutionCollector * operations_research::Solver::MakeLastSolutionCollector | ( | const Assignment *const | assignment | ) |
SolutionCollector * operations_research::Solver::MakeLastSolutionCollector | ( | ) |
SolutionCollector * operations_research::Solver::MakeBestValueSolutionCollector | ( | const Assignment *const | assignment, | |
bool | maximize | |||
) |
Collect the solution corresponding to the optimal value of the objective of 'a'; if 'a' does not have an objective no solution is collected.
namespace
This collector only collects one solution corresponding to the best objective value (the first one found).
SolutionCollector * operations_research::Solver::MakeBestValueSolutionCollector | ( | bool | maximize | ) |
Collect the solution corresponding to the optimal value of the objective of 'a'; if 'a' does not have an objective no solution is collected.
This collector only collects one solution corresponding to the best objective value (the first one found). The variables will need to be added later.
SolutionCollector * operations_research::Solver::MakeAllSolutionCollector | ( | const Assignment *const | assignment | ) |
SolutionCollector * operations_research::Solver::MakeAllSolutionCollector | ( | ) |
OptimizeVar * operations_research::Solver::MakeMinimize | ( | IntVar *const | v, | |
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeMaximize | ( | IntVar *const | v, | |
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeOptimize | ( | bool | maximize, | |
IntVar *const | v, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedMinimize | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | weights, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedMinimize | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | weights, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedMaximize | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int64 > & | weights, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedMaximize | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< int > & | weights, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedOptimize | ( | bool | maximize, | |
const std::vector< IntVar * > & | vars, | |||
const std::vector< int64 > & | weights, | |||
int64 | step | |||
) |
OptimizeVar * operations_research::Solver::MakeWeightedOptimize | ( | bool | maximize, | |
const std::vector< IntVar * > & | vars, | |||
const std::vector< int > & | weights, | |||
int64 | step | |||
) |
SearchMonitor * operations_research::Solver::MakeTabuSearch | ( | bool | maximize, | |
IntVar *const | v, | |||
int64 | step, | |||
const std::vector< IntVar * > & | vars, | |||
int64 | keep_tenure, | |||
int64 | forbid_tenure, | |||
double | tabu_factor | |||
) |
Meta-heuristics Search monitors which try to get the search out of local optima.
namespace
Creates a Tabu Search monitor. In the context of local search the behavior is similar to MakeOptimize(), creating an objective in a given sense. The behavior differs once a local optimum is reached: thereafter solutions which degrade the value of the objective are allowed if they are not "tabu". A solution is "tabu" if it doesn't respect the following rules:
SearchMonitor * operations_research::Solver::MakeTabuSearch | ( | bool | maximize, | |
IntVar *const | v, | |||
int64 | step, | |||
const IntVar *const * | vars, | |||
int | size, | |||
int64 | keep_tenure, | |||
int64 | forbid_tenure, | |||
double | tabu_factor | |||
) |
SearchMonitor * operations_research::Solver::MakeSimulatedAnnealing | ( | bool | maximize, | |
IntVar *const | v, | |||
int64 | step, | |||
int64 | initial_temperature | |||
) |
SearchMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, | |
IntVar *const | objective, | |||
IndexEvaluator2 * | objective_function, | |||
int64 | step, | |||
const std::vector< IntVar * > & | vars, | |||
double | penalty_factor | |||
) |
Creates a Guided Local Search monitor.
namespace
Description here: http://en.wikipedia.org/wiki/Guided_Local_Search
SearchMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, | |
IntVar *const | objective, | |||
IndexEvaluator2 * | objective_function, | |||
int64 | step, | |||
const IntVar *const * | vars, | |||
int | size, | |||
double | penalty_factor | |||
) |
SearchMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, | |
IntVar *const | objective, | |||
IndexEvaluator3 * | objective_function, | |||
int64 | step, | |||
const std::vector< IntVar * > & | vars, | |||
const std::vector< IntVar * > & | secondary_vars, | |||
double | penalty_factor | |||
) |
SearchMonitor * operations_research::Solver::MakeGuidedLocalSearch | ( | bool | maximize, | |
IntVar *const | objective, | |||
IndexEvaluator3 * | objective_function, | |||
int64 | step, | |||
const IntVar *const * | vars, | |||
const IntVar *const * | secondary_vars, | |||
int | size, | |||
double | penalty_factor | |||
) |
SearchMonitor * operations_research::Solver::MakeLubyRestart | ( | int | scale_factor | ) |
SearchMonitor * operations_research::Solver::MakeConstantRestart | ( | int | frequency | ) |
SearchLimit * operations_research::Solver::MakeTimeLimit | ( | int64 | time_in_ms | ) |
SearchLimit * operations_research::Solver::MakeBranchesLimit | ( | int64 | branches | ) |
SearchLimit * operations_research::Solver::MakeFailuresLimit | ( | int64 | failures | ) |
SearchLimit * operations_research::Solver::MakeSolutionsLimit | ( | int64 | solutions | ) |
SearchLimit * operations_research::Solver::MakeLimit | ( | int64 | time, | |
int64 | branches, | |||
int64 | failures, | |||
int64 | solutions | |||
) |
SearchLimit * operations_research::Solver::MakeLimit | ( | int64 | time, | |
int64 | branches, | |||
int64 | failures, | |||
int64 | solutions, | |||
bool | smart_time_check | |||
) |
SearchLimit * operations_research::Solver::MakeLimit | ( | int64 | time, | |
int64 | branches, | |||
int64 | failures, | |||
int64 | solutions, | |||
bool | smart_time_check, | |||
bool | cumulative | |||
) |
SearchLimit * operations_research::Solver::MakeLimit | ( | const SearchLimitProto & | proto | ) |
SearchLimit * operations_research::Solver::MakeLimit | ( | SearchLimit *const | limit_1, | |
SearchLimit *const | limit_2 | |||
) |
void operations_research::Solver::UpdateLimits | ( | int64 | time, | |
int64 | branches, | |||
int64 | failures, | |||
int64 | solutions, | |||
SearchLimit * | limit | |||
) |
int64 operations_research::Solver::GetTime | ( | SearchLimit * | limit | ) |
SearchLimit * operations_research::Solver::MakeCustomLimit | ( | ResultCallback< bool > * | limiter | ) |
NoGoodManager * operations_research::Solver::MakeNoGoodManager | ( | ) |
No Goods.
namespace
Creates a non-reversible nogood manager to store and use nogoods during search. Nogoods are defined by the NoGood class. It can be used during search with restart to avoid revisiting the same portion of the search tree.
API
Definition at line 208 of file nogoods.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const IntVar *const * | vars, | |
int | size, | |||
const string & | file_tree, | |||
const string & | file_visualization | |||
) |
Tree Monitor Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
API.
The XML data is written to files file_tree and file_visualization as the search finishes.
Definition at line 795 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const std::vector< IntVar * > & | vars, | |
const string & | file_tree, | |||
const string & | file_visualization | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is written to files file_tree and file_visualization as the search finishes.
Definition at line 802 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const IntVar *const * | vars, | |
int | size, | |||
const string & | file_config, | |||
const string & | file_tree, | |||
const string & | file_visualization | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is written to files file_config, file_tree and file_visualization as the search finishes.
Definition at line 809 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const std::vector< IntVar * > & | vars, | |
const string & | file_config, | |||
const string & | file_tree, | |||
const string & | file_visualization | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is written to files file_config, file_tree and file_visualization as the search finishes.
Definition at line 817 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const IntVar *const * | vars, | |
int | size, | |||
string *const | tree_xml, | |||
string *const | visualization_xml | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is copied to tree_xml and visualization_xml as the search finishes. The tree monitor does not take ownership of either string.
Definition at line 825 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const std::vector< IntVar * > & | vars, | |
string *const | tree_xml, | |||
string *const | visualization_xml | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is copied to tree_xml and visualization_xml as the search finishes. The tree monitor does not take ownership of either string.
Definition at line 832 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const IntVar *const * | vars, | |
int | size, | |||
string *const | config_xml, | |||
string *const | tree_xml, | |||
string *const | visualization_xml | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is copied to config_xml, tree_xml and visualization_xml as the search finishes. The tree monitor does not take ownership of these strings.
Definition at line 839 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeTreeMonitor | ( | const std::vector< IntVar * > & | vars, | |
string *const | config_xml, | |||
string *const | tree_xml, | |||
string *const | visualization_xml | |||
) |
Creates a tree monitor that outputs a detailed overview of the decision phase in cpviz format.
The XML data is copied to config_xml, tree_xml and visualization_xml as the search finishes. The tree monitor does not take ownership of these strings. if !defined(SWIG)
Definition at line 847 of file tree_monitor.cc.
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count | ) |
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count, | |
IntVar *const | objective | |||
) |
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count, | |
ResultCallback< string > * | display_callback | |||
) |
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count, | |
IntVar * | objective, | |||
ResultCallback< string > * | display_callback | |||
) |
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count, | |
OptimizeVar *const | objective | |||
) |
OptimizeVar Search Logs At each solution, this monitor will also display the objective->Print().
SearchMonitor * operations_research::Solver::MakeSearchLog | ( | int | branch_count, | |
OptimizeVar *const | objective, | |||
ResultCallback< string > * | display_callback | |||
) |
SearchMonitor * operations_research::Solver::MakeSearchTrace | ( | const string & | prefix | ) |
ModelVisitor * operations_research::Solver::MakePrintModelVisitor | ( | ) |
ModelVisitor * operations_research::Solver::MakeStatisticsModelVisitor | ( | ) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | const std::vector< SymmetryBreaker * > & | visitors | ) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | SymmetryBreaker *const * | visitors, | |
int | size | |||
) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | SymmetryBreaker *const | v1 | ) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | SymmetryBreaker *const | v1, | |
SymmetryBreaker *const | v2 | |||
) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | SymmetryBreaker *const | v1, | |
SymmetryBreaker *const | v2, | |||
SymmetryBreaker *const | v3 | |||
) |
SearchMonitor * operations_research::Solver::MakeSymmetryManager | ( | SymmetryBreaker *const | v1, | |
SymmetryBreaker *const | v2, | |||
SymmetryBreaker *const | v3, | |||
SymmetryBreaker *const | v4 | |||
) |
SearchMonitor * operations_research::Solver::MakeSimplexConnection | ( | Callback1< MPSolver * > *const | builder, | |
Callback1< MPSolver * > *const | modifier, | |||
Callback1< MPSolver * > *const | runner, | |||
int | frequency | |||
) |
SearchMonitor * operations_research::Solver::MakeSimplexConstraint | ( | int | simplex_frequency | ) |
Linear Relaxation Constraint.
Creates a search monitor that will maintain a linear relaxation of the problem. Every 'simplex_frequency' nodes explored in the search tree, this linear relaxation will be called and the resulting optimal solution found by the simplex will be used to prune the objective of the constraint programming model.
Decision * operations_research::Solver::MakeFailDecision | ( | ) |
DecisionBuilder * operations_research::Solver::Compose | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2 | |||
) |
Creates a decision builder which sequentially composes decision builders.
namespace
At each leaf of a decision builder, the next decision builder is therefore called. For instance Compose(db1, db2) will result in the following tree: d1 tree | / | \ | db1 leaves | / | \ | db2 tree db2 tree db2 tree |
DecisionBuilder * operations_research::Solver::Compose | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2, | |||
DecisionBuilder *const | db3 | |||
) |
DecisionBuilder * operations_research::Solver::Compose | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2, | |||
DecisionBuilder *const | db3, | |||
DecisionBuilder *const | db4 | |||
) |
DecisionBuilder * operations_research::Solver::Compose | ( | const std::vector< DecisionBuilder * > & | dbs | ) |
DecisionBuilder * operations_research::Solver::Try | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2 | |||
) |
Creates a decision builder which will create a search tree where each decision builder is called from the top of the search tree.
namespace
For instance the decision builder Try(db1, db2) will entirely explore the search tree of db1 then the one of db2, resulting in the following search tree: Tree root | / \ | db1 tree db2 tree |
This is very handy to try a decision builder which partially explores the search space and if it fails to try another decision builder.
DecisionBuilder * operations_research::Solver::Try | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2, | |||
DecisionBuilder *const | db3 | |||
) |
DecisionBuilder * operations_research::Solver::Try | ( | DecisionBuilder *const | db1, | |
DecisionBuilder *const | db2, | |||
DecisionBuilder *const | db3, | |||
DecisionBuilder *const | db4 | |||
) |
DecisionBuilder * operations_research::Solver::Try | ( | const std::vector< DecisionBuilder * > & | dbs | ) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
IndexEvaluator1 * | var_evaluator, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
IndexEvaluator1 * | var_evaluator, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
Solver::IntVarStrategy | var_str, | |||
IndexEvaluator2 * | val_eval | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::IntVarStrategy | var_str, | |||
IndexEvaluator2 * | val_eval | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
IndexEvaluator1 * | var_evaluator, | |||
IndexEvaluator2 * | val_eval | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
IndexEvaluator1 * | var_evaluator, | |||
IndexEvaluator2 * | val_eval | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
Solver::IntVarStrategy | var_str, | |||
IndexEvaluator2 * | val_eval, | |||
IndexEvaluator1 * | tie_breaker | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::IntVarStrategy | var_str, | |||
IndexEvaluator2 * | val_eval, | |||
IndexEvaluator1 * | tie_breaker | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
IndexEvaluator1 * | var_evaluator, | |||
IndexEvaluator2 * | val_eval, | |||
IndexEvaluator1 * | tie_breaker | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
IndexEvaluator1 * | var_evaluator, | |||
IndexEvaluator2 * | val_eval, | |||
IndexEvaluator1 * | tie_breaker | |||
) |
DecisionBuilder * operations_research::Solver::MakeDefaultPhase | ( | const IntVar *const * | vars, | |
int | size | |||
) |
Definition at line 1146 of file default_search.cc.
DecisionBuilder * operations_research::Solver::MakeDefaultPhase | ( | const std::vector< IntVar * > & | vars | ) |
DecisionBuilder * operations_research::Solver::MakeDefaultPhase | ( | const IntVar *const * | vars, | |
int | size, | |||
const DefaultPhaseParameters & | parameters | |||
) |
Definition at line 1136 of file default_search.cc.
DecisionBuilder * operations_research::Solver::MakeDefaultPhase | ( | const std::vector< IntVar * > & | vars, | |
const DefaultPhaseParameters & | parameters | |||
) |
Definition at line 1130 of file default_search.cc.
DecisionBuilder * operations_research::Solver::MakePhase | ( | IntVar *const | v0, | |
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | IntVar *const | v0, | |
IntVar *const | v1, | |||
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | IntVar *const | v0, | |
IntVar *const | v1, | |||
IntVar *const | v2, | |||
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | IntVar *const | v0, | |
IntVar *const | v1, | |||
IntVar *const | v2, | |||
IntVar *const | v3, | |||
Solver::IntVarStrategy | var_str, | |||
Solver::IntValueStrategy | val_str | |||
) |
Decision * operations_research::Solver::MakeScheduleOrPostpone | ( | IntervalVar *const | var, | |
int64 | est, | |||
int64 *const | marker | |||
) |
Scheduling Decisions.
namespace
Returns a decision that tries to schedule a task at a given time. On the Apply branch, it will set that interval var as performed and set its start to 'est'. On the Refute branch, it will just update the 'marker' to 'est' + 1. This decision is used in the INTERVAL_SET_TIMES_FORWARD strategy.
Definition at line 406 of file sched_search.cc.
Decision * operations_research::Solver::MakeRankFirstInterval | ( | SequenceVar *const | sequence, | |
int | index | |||
) |
Returns a decision that tries to rank first the ith interval var in the sequence variable.
Definition at line 419 of file sched_search.cc.
Decision * operations_research::Solver::MakeRankLastInterval | ( | SequenceVar *const | sequence, | |
int | index | |||
) |
Returns a decision that tries to rank last the ith interval var in the sequence variable.
Definition at line 425 of file sched_search.cc.
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
IndexEvaluator2 * | evaluator, | |||
Solver::EvaluatorStrategy | str | |||
) |
Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator.
The arguments passed to the evaluator callback are the indices of the variables in vars and the values of these variables. Ownership of the callback is passed to the decision builder.
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
IndexEvaluator2 * | evaluator, | |||
Solver::EvaluatorStrategy | str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntVar * > & | vars, | |
IndexEvaluator2 * | evaluator, | |||
IndexEvaluator1 * | tie_breaker, | |||
Solver::EvaluatorStrategy | str | |||
) |
Returns a decision builder which assigns values to variables which minimize the values returned by the evaluator.
In case of tie breaks, the second callback is used to choose the best index in the array of equivalent pairs with equivalent evaluations. The arguments passed to the evaluator callback are the indices of the variables in vars and the values of these variables. Ownership of the callback is passed to the decision builder.
DecisionBuilder * operations_research::Solver::MakePhase | ( | const IntVar *const * | vars, | |
int | size, | |||
IndexEvaluator2 * | evaluator, | |||
IndexEvaluator1 * | tie_breaker, | |||
Solver::EvaluatorStrategy | str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< IntervalVar * > & | intervals, | |
IntervalStrategy | str | |||
) |
DecisionBuilder * operations_research::Solver::MakePhase | ( | const std::vector< SequenceVar * > & | sequences, | |
SequenceStrategy | str | |||
) |
Definition at line 430 of file sched_search.cc.
DecisionBuilder * operations_research::Solver::MakeDecisionBuilderFromAssignment | ( | Assignment *const | assignment, | |
DecisionBuilder *const | db, | |||
const IntVar *const * | vars, | |||
int | size | |||
) |
DecisionBuilder * operations_research::Solver::MakeConstraintAdder | ( | Constraint *const | ct | ) |
Returns a decision builder that will add the given constraint to the model.
namespace
Definition at line 2377 of file constraint_solver.cc.
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db | ) |
SolveOnce will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point.
namespace
If there are no solutions to this nested tree, then SolveOnce will fail. If there is a solution, it will find it and returns NULL.
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | monitor1 | |||
) |
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2 | |||
) |
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2, | |||
SearchMonitor *const | monitor3 | |||
) |
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db, | |
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2, | |||
SearchMonitor *const | monitor3, | |||
SearchMonitor *const | monitor4 | |||
) |
DecisionBuilder * operations_research::Solver::MakeSolveOnce | ( | DecisionBuilder *const | db, | |
const std::vector< SearchMonitor * > & | monitors | |||
) |
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step | |||
) |
NestedOptimize will collapse a search tree described by a decision builder 'db' and a set of monitors and wrap it into a single point.
namespace
If there are no solutions to this nested tree, then NestedOptimize will fail. If there are solutions, it will find the best as described by the mandatory objective in the solution, as well as the optimization direction, instantiate all variables to this solution, and returns NULL.
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step, | |||
SearchMonitor *const | monitor1 | |||
) |
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step, | |||
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2 | |||
) |
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step, | |||
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2, | |||
SearchMonitor *const | monitor3 | |||
) |
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step, | |||
SearchMonitor *const | monitor1, | |||
SearchMonitor *const | monitor2, | |||
SearchMonitor *const | monitor3, | |||
SearchMonitor *const | monitor4 | |||
) |
DecisionBuilder * operations_research::Solver::MakeNestedOptimize | ( | DecisionBuilder *const | db, | |
Assignment *const | solution, | |||
bool | maximize, | |||
int64 | step, | |||
const std::vector< SearchMonitor * > & | monitors | |||
) |
DecisionBuilder * operations_research::Solver::MakeRestoreAssignment | ( | Assignment * | assignment | ) |
Returns a DecisionBuilder which restores an Assignment (calls void Assignment::Restore()).
namespace
Definition at line 1147 of file assignment.cc.
DecisionBuilder * operations_research::Solver::MakeStoreAssignment | ( | Assignment * | assignment | ) |
Returns a DecisionBuilder which stores an Assignment (calls void Assignment::Store()).
Definition at line 1151 of file assignment.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, | |
Solver::LocalSearchOperators | op | |||
) |
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::LocalSearchOperators | op | |||
) |
Definition at line 2042 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< IntVar * > & | secondary_vars, | |||
Solver::LocalSearchOperators | op | |||
) |
Definition at line 2048 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const IntVar *const * | vars, | |
const IntVar *const * | secondary_vars, | |||
int | size, | |||
Solver::LocalSearchOperators | op | |||
) |
Definition at line 2054 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, | |
Solver::IndexEvaluator3 *const | evaluator, | |||
Solver::EvaluatorLocalSearchOperators | op | |||
) |
Definition at line 2145 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::IndexEvaluator3 *const | evaluator, | |||
Solver::EvaluatorLocalSearchOperators | op | |||
) |
Definition at line 2152 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const std::vector< IntVar * > & | vars, | |
const std::vector< IntVar * > & | secondary_vars, | |||
Solver::IndexEvaluator3 *const | evaluator, | |||
Solver::EvaluatorLocalSearchOperators | op | |||
) |
Definition at line 2160 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeOperator | ( | const IntVar *const * | vars, | |
const IntVar *const * | secondary_vars, | |||
int | size, | |||
Solver::IndexEvaluator3 *const | evaluator, | |||
Solver::EvaluatorLocalSearchOperators | op | |||
) |
Definition at line 2172 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeRandomLNSOperator | ( | const std::vector< IntVar * > & | vars, | |
int | number_of_variables | |||
) |
Creates a large neighborhood search operator which creates fragments (set of relaxed variables) with up to number_of_variables random variables (sampling with replacement is performed meaning that at most number_of_variables variables are selected).
namespace
Warning: this operator will always return neighbors; using it without a search limit will result in a non-ending search. Optionally a random seed can be specified.
Definition at line 472 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeRandomLNSOperator | ( | const std::vector< IntVar * > & | vars, | |
int | number_of_variables, | |||
int32 | seed | |||
) |
Definition at line 477 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeRandomLNSOperator | ( | const IntVar *const * | vars, | |
int | size, | |||
int | number_of_variables | |||
) |
Definition at line 486 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeRandomLNSOperator | ( | const IntVar *const * | vars, | |
int | size, | |||
int | number_of_variables, | |||
int32 | seed | |||
) |
Definition at line 495 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeMoveTowardTargetOperator | ( | const Assignment & | target | ) |
Creates a local search operator that tries to move the assignment of some variables toward a target.
namespace
The target is given as an Assignment. This operator generates neighbors in which the only difference compared to the current state is that one variable that belongs to the target assignment is set to its target value.
Definition at line 568 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeMoveTowardTargetOperator | ( | const std::vector< IntVar * > & | variables, | |
const std::vector< int64 > & | target_values | |||
) |
Creates a local search operator that tries to move the assignment of some variables toward a target.
The target is given either as two vectors: a vector of variables and a vector of associated target values. The two vectors should be of the same length. This operator generates neighbors in which the only difference compared to the current state is that one variable that belongs to the given vector is set to its target value.
Definition at line 584 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops | ) |
Creates a local search operator which concatenates a vector of operators.
namespace
Each operator from the vector is called sequentially. By default, when a neighbor is found the neighborhood exploration restarts from the last active operator (the one which produced the neighbor). This can be overriden by setting restart to true to force the exploration to start from the first operator in the vector. The default behavior can also be overriden using an evaluation callback to set the order in which the operators are explored (the callback is called in LocalSearchOperator::Start()). The first argument of the callback is the index of the operator which produced the last move, the second argument is the index of the operator to be evaluated. Ownership of the callback is taken by ConcatenateOperators.
Example:
const int kPriorities = {10, 100, 10, 0}; int64 Evaluate(int active_operator, int current_operator) { return kPriorities[current_operator]; }
LocalSearchOperator* concat = solver.ConcatenateOperators(operators, NewPermanentCallback(&Evaluate));
The elements of the vector operators will be sorted by increasing priority and explored in that order (tie-breaks are handled by keeping the relative operator order in the vector). This would result in the following order: operators[3], operators[0], operators[2], operators[1].
Definition at line 1960 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, | |
bool | restart | |||
) |
Definition at line 1965 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::ConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops, | |
ResultCallback2< int64, int, int > *const | evaluator | |||
) |
Definition at line 1980 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::RandomConcatenateOperators | ( | const std::vector< LocalSearchOperator * > & | ops | ) |
Randomized version of local search concatenator; calls a random operator at each call to MakeNextNeighbor().
namespace
Definition at line 2030 of file local_search.cc.
LocalSearchOperator * operations_research::Solver::MakeNeighborhoodLimit | ( | LocalSearchOperator *const | op, | |
int64 | limit | |||
) |
Creates a local search operator that wraps another local search operator and limits the number of neighbors explored (i.e.
namespace
calls to MakeNextNeighbor from the current solution (between two calls to Start()). When this limit is reached, MakeNextNeighbor() returns false. The counter is cleared when Start() is called.
Definition at line 1841 of file local_search.cc.
DecisionBuilder * operations_research::Solver::MakeLocalSearchPhase | ( | Assignment *const | assignment, | |
LocalSearchPhaseParameters *const | parameters | |||
) |
Local Search decision builders factories.
Local search is used to improve a given solution. This initial solution can be specified either by an Assignment or by a DecisionBulder, and the corresponding variables, the initial solution being the first solution found by the DecisionBuilder. The LocalSearchPhaseParameters parameter holds the actual definition of the local search phase:
Definition at line 3318 of file local_search.cc.
DecisionBuilder * operations_research::Solver::MakeLocalSearchPhase | ( | const std::vector< IntVar * > & | vars, | |
DecisionBuilder *const | first_solution, | |||
LocalSearchPhaseParameters *const | parameters | |||
) |
Definition at line 3329 of file local_search.cc.
DecisionBuilder * operations_research::Solver::MakeLocalSearchPhase | ( | IntVar *const * | vars, | |
int | size, | |||
DecisionBuilder *const | first_solution, | |||
LocalSearchPhaseParameters *const | parameters | |||
) |
Definition at line 3339 of file local_search.cc.
SolutionPool * operations_research::Solver::MakeDefaultSolutionPool | ( | ) |
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | LocalSearchOperator *const | ls_operator, | |
DecisionBuilder *const | sub_decision_builder | |||
) |
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | LocalSearchOperator *const | ls_operator, | |
DecisionBuilder *const | sub_decision_builder, | |||
SearchLimit *const | limit | |||
) |
Definition at line 2950 of file local_search.cc.
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | LocalSearchOperator *const | ls_operator, | |
DecisionBuilder *const | sub_decision_builder, | |||
SearchLimit *const | limit, | |||
const std::vector< LocalSearchFilter * > & | filters | |||
) |
Definition at line 2961 of file local_search.cc.
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | SolutionPool *const | pool, | |
LocalSearchOperator *const | ls_operator, | |||
DecisionBuilder *const | sub_decision_builder | |||
) |
Definition at line 2973 of file local_search.cc.
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | SolutionPool *const | pool, | |
LocalSearchOperator *const | ls_operator, | |||
DecisionBuilder *const | sub_decision_builder, | |||
SearchLimit *const | limit | |||
) |
Definition at line 2984 of file local_search.cc.
LocalSearchPhaseParameters * operations_research::Solver::MakeLocalSearchPhaseParameters | ( | SolutionPool *const | pool, | |
LocalSearchOperator *const | ls_operator, | |||
DecisionBuilder *const | sub_decision_builder, | |||
SearchLimit *const | limit, | |||
const std::vector< LocalSearchFilter * > & | filters | |||
) |
Definition at line 2996 of file local_search.cc.
LocalSearchFilter * operations_research::Solver::MakeVariableDomainFilter | ( | ) |
LocalSearchFilter * operations_research::Solver::MakeLocalSearchObjectiveFilter | ( | const IntVar *const * | vars, | |
int | size, | |||
Solver::IndexEvaluator2 *const | values, | |||
const IntVar *const | objective, | |||
Solver::LocalSearchFilterBound | filter_enum, | |||
Solver::LocalSearchOperation | op_enum | |||
) |
LocalSearchFilter * operations_research::Solver::MakeLocalSearchObjectiveFilter | ( | const std::vector< IntVar * > & | vars, | |
Solver::IndexEvaluator2 *const | values, | |||
const IntVar *const | objective, | |||
Solver::LocalSearchFilterBound | filter_enum, | |||
Solver::LocalSearchOperation | op_enum | |||
) |
Definition at line 2705 of file local_search.cc.
LocalSearchFilter * operations_research::Solver::MakeLocalSearchObjectiveFilter | ( | const IntVar *const * | vars, | |
const IntVar *const * | secondary_vars, | |||
int | size, | |||
ResultCallback3< int64, int64, int64, int64 > *const | values, | |||
const IntVar *const | objective, | |||
Solver::LocalSearchFilterBound | filter_enum, | |||
Solver::LocalSearchOperation | op_enum | |||
) |
Definition at line 2719 of file local_search.cc.
void operations_research::Solver::TopPeriodicCheck | ( | ) |
Performs PeriodicCheck on the top-level search; can be called from a nested solve to check top-level limits for instance.
Definition at line 1532 of file constraint_solver.cc.
int operations_research::Solver::TopProgressPercent | ( | ) |
Returns a percentage representing the propress of the search before reaching the limits of the top-level search (can be called from a nested solve).
Definition at line 1536 of file constraint_solver.cc.
void operations_research::Solver::PushState | ( | ) |
The PushState and PopState methods manipulates the states of the reversible objects.
They are visible only because they are useful to write unitary tests.
Definition at line 1540 of file constraint_solver.cc.
void operations_research::Solver::PopState | ( | ) |
Definition at line 1545 of file constraint_solver.cc.
int operations_research::Solver::SearchDepth | ( | ) | const |
Gets the search depth of the current active search.
Returns -1 in case there are no active search opened.
Definition at line 1076 of file constraint_solver.cc.
int operations_research::Solver::SearchLeftDepth | ( | ) | const |
Gets the search left depth of the current active search.
Returns -1 in case there are no active search opened.
Definition at line 1080 of file constraint_solver.cc.
int operations_research::Solver::SolveDepth | ( | ) | const |
Gets the number of nested searches.
It returns 0 outside search, 1 during the top level search, 2 if one level of NestedSolve() is used, and more if more solves are nested.
Definition at line 1072 of file constraint_solver.cc.
void operations_research::Solver::SetBranchSelector | ( | ResultCallback1< Solver::DecisionModification, Solver * > *const | bs | ) |
Sets the given branch selector on the current active search.
Definition at line 1056 of file constraint_solver.cc.
DecisionBuilder * operations_research::Solver::MakeApplyBranchSelector | ( | ResultCallback1< Solver::DecisionModification, Solver * > *const | bs | ) |
Creates a decision builder that will set the branch selector.
Definition at line 1067 of file constraint_solver.cc.
void operations_research::Solver::SaveAndSetValue | ( | T * | adr, | |
T | val | |||
) | [inline] |
void operations_research::Solver::SaveAndAdd | ( | T * | adr, | |
T | val | |||
) | [inline] |
int64 operations_research::Solver::Rand64 | ( | int64 | size | ) | [inline] |
Returns a random value between 0 and 'size' - 1;.
Definition at line 2756 of file constraint_solver.h.
int32 operations_research::Solver::Rand32 | ( | int32 | size | ) | [inline] |
Returns a random value between 0 and 'size' - 1;.
Definition at line 2761 of file constraint_solver.h.
void operations_research::Solver::ReSeed | ( | int32 | seed | ) | [inline] |
void operations_research::Solver::AddFailHook | ( | Action * | a | ) |
Adds a fail hook, that is an action that will be called after each failure.
Definition at line 1607 of file constraint_solver.cc.
void operations_research::Solver::ExportProfilingOverview | ( | const string & | filename | ) |
Exports the profiling information in a human readable overview.
The parameter profile_level used to create the solver must be different from NO_PROFILING.
Definition at line 427 of file demon_profiler.cc.
bool operations_research::Solver::CurrentlyInSolve | ( | ) | const |
Returns true whether the current search has been created using a Solve() call instead of a NewSearch 0ne.
It returns false if the solver is not is search at all.
Definition at line 1776 of file constraint_solver.cc.
int operations_research::Solver::constraints | ( | ) | const [inline] |
Counts the number of constraints that have been added to the solver before the search,.
Definition at line 2785 of file constraint_solver.h.
void operations_research::Solver::Accept | ( | ModelVisitor *const | visitor | ) | const |
void operations_research::Solver::Accept | ( | ModelVisitor *const | visitor, | |
const std::vector< SearchMonitor * > & | monitors | |||
) | const |
Decision* operations_research::Solver::balancing_decision | ( | ) | const [inline] |
Definition at line 2794 of file constraint_solver.h.
void operations_research::Solver::set_fail_intercept | ( | Closure *const | c | ) | [inline] |
Internal set_fail_intercept does not take ownership of the closure.
Definition at line 2798 of file constraint_solver.h.
void operations_research::Solver::clear_fail_intercept | ( | ) | [inline] |
Definition at line 2799 of file constraint_solver.h.
DemonProfiler* operations_research::Solver::demon_profiler | ( | ) | const [inline] |
bool operations_research::Solver::HasName | ( | const PropagationBaseObject * | object | ) | const |
Returns whether the object has been named or not.
Definition at line 2520 of file constraint_solver.cc.
Adds a new demon and wraps it inside a DemonProfiler if necessary.
Definition at line 451 of file demon_profiler.cc.
IntervalVar * operations_research::Solver::RegisterIntervalVar | ( | IntervalVar *const | var | ) |
Registers a new IntervalVar and wraps it inside a TraceIntervalVar if necessary.
Search * operations_research::Solver::ActiveSearch | ( | ) | const |
Returns the active search, NULL outside search.
Definition at line 1007 of file constraint_solver.cc.
ModelCache * operations_research::Solver::Cache | ( | ) | const |
bool operations_research::Solver::InstrumentsDemons | ( | ) | const |
Returns whether we are instrumenting demons.
Definition at line 89 of file constraint_solver.cc.
bool operations_research::Solver::IsProfilingEnabled | ( | ) | const |
bool operations_research::Solver::InstrumentsVariables | ( | ) | const |
bool operations_research::Solver::NameAllVariables | ( | ) | const |
string operations_research::Solver::model_name | ( | ) | const |
DependencyGraph * operations_research::Solver::Graph | ( | ) | const |
PropagationMonitor * operations_research::Solver::GetPropagationMonitor | ( | ) | const |
void operations_research::Solver::AddPropagationMonitor | ( | PropagationMonitor *const | monitor | ) |
Adds the propagation monitor to the solver.
This is called internally when a propagation monitor is passed to the Solve() or NewSearch() method.
Definition at line 3222 of file constraint_solver.cc.
friend class BaseIntExpr [friend] |
Definition at line 2836 of file constraint_solver.h.
friend class Constraint [friend] |
Definition at line 2837 of file constraint_solver.h.
friend class DemonProfiler [friend] |
Definition at line 2838 of file constraint_solver.h.
friend class FindOneNeighbor [friend] |
Definition at line 2839 of file constraint_solver.h.
friend class IntVar [friend] |
Definition at line 2840 of file constraint_solver.h.
friend class PropagationBaseObject [friend] |
Definition at line 2841 of file constraint_solver.h.
friend class Queue [friend] |
Definition at line 2842 of file constraint_solver.h.
friend class SearchMonitor [friend] |
Definition at line 2843 of file constraint_solver.h.
friend class SimpleRevFIFO [friend] |
Definition at line 2848 of file constraint_solver.h.
friend class RevImmutableMultiMap [friend] |
Definition at line 2849 of file constraint_solver.h.
Definition at line 851 of file constraint_solver.cc.
Definition at line 1651 of file constraint_solver.cc.
const int operations_research::Solver::kNumPriorities = 3 [static] |