Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
|
Classes | |
class | FailException |
class | IntegerCastInfo |
Static Public Member Functions | |
static com.google.ortools.constraintsolver.ConstraintSolverParameters | defaultSolverParameters () |
static long | memoryUsage () |
Static Public Attributes | |
static final int | kNumPriorities = mainJNI.Solver_kNumPriorities_get() |
static final int | INT_VAR_DEFAULT = mainJNI.Solver_INT_VAR_DEFAULT_get() |
IntVarStrategy. | |
static final int | INT_VAR_SIMPLE = mainJNI.Solver_INT_VAR_SIMPLE_get() |
static final int | CHOOSE_FIRST_UNBOUND = mainJNI.Solver_CHOOSE_FIRST_UNBOUND_get() |
static final int | CHOOSE_RANDOM = mainJNI.Solver_CHOOSE_RANDOM_get() |
static final int | CHOOSE_MIN_SIZE_LOWEST_MIN = mainJNI.Solver_CHOOSE_MIN_SIZE_LOWEST_MIN_get() |
static final int | CHOOSE_MIN_SIZE_HIGHEST_MIN = mainJNI.Solver_CHOOSE_MIN_SIZE_HIGHEST_MIN_get() |
static final int | CHOOSE_MIN_SIZE_LOWEST_MAX = mainJNI.Solver_CHOOSE_MIN_SIZE_LOWEST_MAX_get() |
static final int | CHOOSE_MIN_SIZE_HIGHEST_MAX = mainJNI.Solver_CHOOSE_MIN_SIZE_HIGHEST_MAX_get() |
static final int | CHOOSE_LOWEST_MIN = mainJNI.Solver_CHOOSE_LOWEST_MIN_get() |
static final int | CHOOSE_HIGHEST_MAX = mainJNI.Solver_CHOOSE_HIGHEST_MAX_get() |
static final int | CHOOSE_MIN_SIZE = mainJNI.Solver_CHOOSE_MIN_SIZE_get() |
static final int | CHOOSE_MAX_SIZE = mainJNI.Solver_CHOOSE_MAX_SIZE_get() |
static final int | CHOOSE_MAX_REGRET_ON_MIN = mainJNI.Solver_CHOOSE_MAX_REGRET_ON_MIN_get() |
static final int | CHOOSE_PATH = mainJNI.Solver_CHOOSE_PATH_get() |
static final int | INT_VALUE_DEFAULT = mainJNI.Solver_INT_VALUE_DEFAULT_get() |
IntValueStrategy. | |
static final int | INT_VALUE_SIMPLE = mainJNI.Solver_INT_VALUE_SIMPLE_get() |
static final int | ASSIGN_MIN_VALUE = mainJNI.Solver_ASSIGN_MIN_VALUE_get() |
static final int | ASSIGN_MAX_VALUE = mainJNI.Solver_ASSIGN_MAX_VALUE_get() |
static final int | ASSIGN_RANDOM_VALUE = mainJNI.Solver_ASSIGN_RANDOM_VALUE_get() |
static final int | ASSIGN_CENTER_VALUE = mainJNI.Solver_ASSIGN_CENTER_VALUE_get() |
static final int | SPLIT_LOWER_HALF = mainJNI.Solver_SPLIT_LOWER_HALF_get() |
static final int | SPLIT_UPPER_HALF = mainJNI.Solver_SPLIT_UPPER_HALF_get() |
static final int | CHOOSE_STATIC_GLOBAL_BEST = mainJNI.Solver_CHOOSE_STATIC_GLOBAL_BEST_get() |
EvaluatorStrategy. | |
static final int | CHOOSE_DYNAMIC_GLOBAL_BEST = mainJNI.Solver_CHOOSE_DYNAMIC_GLOBAL_BEST_get() |
static final int | SEQUENCE_DEFAULT = mainJNI.Solver_SEQUENCE_DEFAULT_get() |
SequenceStrategy. | |
static final int | SEQUENCE_SIMPLE = mainJNI.Solver_SEQUENCE_SIMPLE_get() |
static final int | CHOOSE_MIN_SLACK_RANK_FORWARD = mainJNI.Solver_CHOOSE_MIN_SLACK_RANK_FORWARD_get() |
static final int | CHOOSE_RANDOM_RANK_FORWARD = mainJNI.Solver_CHOOSE_RANDOM_RANK_FORWARD_get() |
static final int | INTERVAL_DEFAULT = mainJNI.Solver_INTERVAL_DEFAULT_get() |
IntervalStrategy. | |
static final int | INTERVAL_SIMPLE = mainJNI.Solver_INTERVAL_SIMPLE_get() |
static final int | INTERVAL_SET_TIMES_FORWARD = mainJNI.Solver_INTERVAL_SET_TIMES_FORWARD_get() |
static final int | INTERVAL_SET_TIMES_BACKWARD = mainJNI.Solver_INTERVAL_SET_TIMES_BACKWARD_get() |
static final int | TWOOPT = mainJNI.Solver_TWOOPT_get() |
LocalSearchOperators. | |
static final int | OROPT = mainJNI.Solver_OROPT_get() |
static final int | RELOCATE = mainJNI.Solver_RELOCATE_get() |
static final int | EXCHANGE = mainJNI.Solver_EXCHANGE_get() |
static final int | CROSS = mainJNI.Solver_CROSS_get() |
static final int | MAKEACTIVE = mainJNI.Solver_MAKEACTIVE_get() |
static final int | MAKEINACTIVE = mainJNI.Solver_MAKEINACTIVE_get() |
static final int | MAKECHAININACTIVE = mainJNI.Solver_MAKECHAININACTIVE_get() |
static final int | SWAPACTIVE = mainJNI.Solver_SWAPACTIVE_get() |
static final int | EXTENDEDSWAPACTIVE = mainJNI.Solver_EXTENDEDSWAPACTIVE_get() |
static final int | PATHLNS = mainJNI.Solver_PATHLNS_get() |
static final int | FULLPATHLNS = mainJNI.Solver_FULLPATHLNS_get() |
static final int | UNACTIVELNS = mainJNI.Solver_UNACTIVELNS_get() |
static final int | INCREMENT = mainJNI.Solver_INCREMENT_get() |
static final int | DECREMENT = mainJNI.Solver_DECREMENT_get() |
static final int | SIMPLELNS = mainJNI.Solver_SIMPLELNS_get() |
static final int | LK = mainJNI.Solver_LK_get() |
EvaluatorLocalSearchOperators. | |
static final int | TSPOPT = mainJNI.Solver_TSPOPT_get() |
static final int | TSPLNS = mainJNI.Solver_TSPLNS_get() |
static final int | GE = mainJNI.Solver_GE_get() |
LocalSearchFilterBound. | |
static final int | LE = mainJNI.Solver_LE_get() |
static final int | EQ = mainJNI.Solver_EQ_get() |
static final int | DELAYED_PRIORITY = mainJNI.Solver_DELAYED_PRIORITY_get() |
DemonPriority. | |
static final int | VAR_PRIORITY = mainJNI.Solver_VAR_PRIORITY_get() |
static final int | NORMAL_PRIORITY = mainJNI.Solver_NORMAL_PRIORITY_get() |
static final int | ENDS_AFTER_END = mainJNI.Solver_ENDS_AFTER_END_get() |
BinaryIntervalRelation. | |
static final int | ENDS_AFTER_START = mainJNI.Solver_ENDS_AFTER_START_get() |
static final int | ENDS_AT_END = mainJNI.Solver_ENDS_AT_END_get() |
static final int | ENDS_AT_START = mainJNI.Solver_ENDS_AT_START_get() |
static final int | STARTS_AFTER_END = mainJNI.Solver_STARTS_AFTER_END_get() |
static final int | STARTS_AFTER_START = mainJNI.Solver_STARTS_AFTER_START_get() |
static final int | STARTS_AT_END = mainJNI.Solver_STARTS_AT_END_get() |
static final int | STARTS_AT_START = mainJNI.Solver_STARTS_AT_START_get() |
static final int | STAYS_IN_SYNC = mainJNI.Solver_STAYS_IN_SYNC_get() |
static final int | ENDS_AFTER = mainJNI.Solver_ENDS_AFTER_get() |
UnaryIntervalRelation. | |
static final int | ENDS_AT = mainJNI.Solver_ENDS_AT_get() |
static final int | ENDS_BEFORE = mainJNI.Solver_ENDS_BEFORE_get() |
static final int | STARTS_AFTER = mainJNI.Solver_STARTS_AFTER_get() |
static final int | STARTS_AT = mainJNI.Solver_STARTS_AT_get() |
static final int | STARTS_BEFORE = mainJNI.Solver_STARTS_BEFORE_get() |
static final int | CROSS_DATE = mainJNI.Solver_CROSS_DATE_get() |
static final int | AVOID_DATE = mainJNI.Solver_AVOID_DATE_get() |
static final int | NO_CHANGE = mainJNI.Solver_NO_CHANGE_get() |
DecisionModification. | |
static final int | KEEP_LEFT = mainJNI.Solver_KEEP_LEFT_get() |
static final int | KEEP_RIGHT = mainJNI.Solver_KEEP_RIGHT_get() |
static final int | KILL_BOTH = mainJNI.Solver_KILL_BOTH_get() |
static final int | SWITCH_BRANCHES = mainJNI.Solver_SWITCH_BRANCHES_get() |
static final int | SENTINEL = mainJNI.Solver_SENTINEL_get() |
MarkerType. | |
static final int | SIMPLE_MARKER = mainJNI.Solver_SIMPLE_MARKER_get() |
static final int | CHOICE_POINT = mainJNI.Solver_CHOICE_POINT_get() |
static final int | REVERSIBLE_ACTION = mainJNI.Solver_REVERSIBLE_ACTION_get() |
static final int | OUTSIDE_SEARCH = mainJNI.Solver_OUTSIDE_SEARCH_get() |
SolverState. | |
static final int | IN_ROOT_NODE = mainJNI.Solver_IN_ROOT_NODE_get() |
static final int | IN_SEARCH = mainJNI.Solver_IN_SEARCH_get() |
static final int | AT_SOLUTION = mainJNI.Solver_AT_SOLUTION_get() |
static final int | NO_MORE_SOLUTIONS = mainJNI.Solver_NO_MORE_SOLUTIONS_get() |
static final int | PROBLEM_INFEASIBLE = mainJNI.Solver_PROBLEM_INFEASIBLE_get() |
static final int | NOT_SET = mainJNI.Solver_NOT_SET_get() |
OptimizationDirection. | |
static final int | MAXIMIZATION = mainJNI.Solver_MAXIMIZATION_get() |
static final int | MINIMIZATION = mainJNI.Solver_MINIMIZATION_get() |
Protected Member Functions | |
Solver (long cPtr, boolean cMemoryOwn) | |
void | finalize () |
Static Protected Member Functions | |
static long | getCPtr (Solver obj) |
static long | swigRelease (Solver obj) |
Protected Attributes | |
transient boolean | swigCMemOwn |
Solver Class
A solver represents the main computation engine. It implements the entire
range of Constraint Programming protocols:
Definition at line 76 of file Solver.java.
|
protected |
Definition at line 80 of file Solver.java.
com.google.ortools.constraintsolver.Solver.Solver | ( | String | name | ) |
Solver API
Definition at line 298 of file Solver.java.
com.google.ortools.constraintsolver.Solver.Solver | ( | String | name, |
com.google.ortools.constraintsolver.ConstraintSolverParameters | parameters ) |
Definition at line 302 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.accept | ( | ModelVisitor | visitor | ) |
Accepts the given model visitor.
Definition at line 4061 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.acceptedNeighbors | ( | ) |
The number of accepted neighbors.
Definition at line 719 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.addCastConstraint | ( | CastConstraint | constraint, |
IntVar | target_var, | ||
IntExpr | expr ) |
Adds 'constraint' 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 386 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.addConstraint | ( | Constraint | c | ) |
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 thisDefinition at line 377 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.addLocalSearchMonitor | ( | LocalSearchMonitor | monitor | ) |
Adds the local search monitor to the solver. This is called internally
when a propagation monitor is passed to the Solve() or NewSearch() method.
Definition at line 4210 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.addPropagationMonitor | ( | PropagationMonitor | 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 4194 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.balancing_decision | ( | ) |
Definition at line 4065 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.branches | ( | ) |
The number of branches explored since the creation of the solver.
Definition at line 658 of file Solver.java.
ModelCache com.google.ortools.constraintsolver.Solver.cache | ( | ) |
Returns the cache of the model.
Definition at line 4135 of file Solver.java.
Internal. If the variables is the result of expr->Var(), this
method returns expr, nullptr otherwise.
Definition at line 4253 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.checkAssignment | ( | Assignment | solution | ) |
Checks whether the given assignment satisfies all relevant constraints.
Definition at line 606 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.checkConstraint | ( | Constraint | ct | ) |
Checks whether adding this constraint will lead to an immediate
failure. It will return false if the model is already inconsistent, or if
adding the constraint makes it inconsistent.
Definition at line 615 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.checkFail | ( | ) |
Definition at line 4277 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.clear_fail_intercept | ( | ) |
Internal
Definition at line 4073 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.ClearLocalSearchState | ( | ) |
Clears the local search state.
Definition at line 4225 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.ClearNeighbors | ( | ) |
Manipulate neighbors count; to be used for testing purposes only.
TODO(user): Find a workaround to avoid exposing this.
Definition at line 701 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.compose | ( | DecisionBuilder | db1, |
DecisionBuilder | db2 ) |
Creates a decision builder which sequentially composes decision builders.
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 |
Definition at line 3182 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.compose | ( | DecisionBuilder | db1, |
DecisionBuilder | db2, | ||
DecisionBuilder | db3 ) |
Definition at line 3192 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.compose | ( | DecisionBuilder | db1, |
DecisionBuilder | db2, | ||
DecisionBuilder | db3, | ||
DecisionBuilder | db4 ) |
Definition at line 3203 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.compose | ( | DecisionBuilder[] | dbs | ) |
Definition at line 3215 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.concatenateOperators | ( | LocalSearchOperator[] | ops | ) |
Creates a local search operator which concatenates a vector of operators.
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 overridden by setting restart to true to force the exploration
to start from the first operator in the vector.
The default behavior can also be overridden 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_t 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 3714 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.concatenateOperators | ( | LocalSearchOperator[] | ops, |
boolean | restart ) |
Definition at line 3719 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.concatenateOperators | ( | LocalSearchOperator[] | ops, |
IntIntToLongFunction | evaluator ) |
Definition at line 3724 of file Solver.java.
SWIGTYPE_p_operations_research__ConstraintSolverParameters com.google.ortools.constraintsolver.Solver.const_parameters | ( | ) |
Definition at line 322 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.constraints | ( | ) |
Counts the number of constraints that have been added
to the solver before the search.
Definition at line 4054 of file Solver.java.
String com.google.ortools.constraintsolver.Solver.context | ( | ) |
Gets the current context of the search.
Definition at line 748 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.currentlyInSolve | ( | ) |
Returns true whether the current search has been
created using a Solve() call instead of a NewSearch one. It
returns false if the solver is not in search at all.
Definition at line 4046 of file Solver.java.
|
static |
Create a ConstraintSolverParameters proto with all the default values.
Definition at line 329 of file Solver.java.
synchronized void com.google.ortools.constraintsolver.Solver.delete | ( | ) |
Definition at line 106 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.demon_runs | ( | int | p | ) |
The number of demons executed during search for a given priority.
Definition at line 679 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.endSearch | ( | ) |
Definition at line 548 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.exportProfilingOverview | ( | String | filename | ) |
Exports the profiling information in a human readable overview.
The parameter profile_level used to create the solver must be
set to true.
Definition at line 4030 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.fail | ( | ) |
Abandon the current branch in the search tree. A backtrack will follow.
Definition at line 629 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.fail_stamp | ( | ) |
The fail_stamp() is incremented after each backtrack.
Definition at line 734 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.failures | ( | ) |
The number of failures encountered since the creation of the solver.
Definition at line 686 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.filteredNeighbors | ( | ) |
The number of filtered neighbors (neighbors accepted by filters).
Definition at line 712 of file Solver.java.
|
protected |
Definition at line 102 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.finishCurrentSearch | ( | ) |
Tells the solver to kill or restart the current search.
Definition at line 4261 of file Solver.java.
|
staticprotected |
Definition at line 85 of file Solver.java.
LocalSearchMonitor com.google.ortools.constraintsolver.Solver.getLocalSearchMonitor | ( | ) |
Returns the local search monitor.
Definition at line 4201 of file Solver.java.
Assignment com.google.ortools.constraintsolver.Solver.GetOrCreateLocalSearchState | ( | ) |
Returns (or creates) an assignment representing the state of local search.
Definition at line 4217 of file Solver.java.
PropagationMonitor com.google.ortools.constraintsolver.Solver.getPropagationMonitor | ( | ) |
Returns the propagation monitor.
Definition at line 4185 of file Solver.java.
long[] com.google.ortools.constraintsolver.Solver.getTmpVector | ( | ) |
Unsafe temporary vector. It is used to avoid leaks in operations
that need storage and that may fail. See IntVar::SetValues() for
instance. It is not locked; do not use in a multi-threaded or reentrant
setup.
Definition at line 4245 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.hasName | ( | PropagationBaseObject | object | ) |
Returns whether the object has been named or not.
Definition at line 4095 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.IncrementNeighbors | ( | ) |
Definition at line 705 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.instrumentsDemons | ( | ) |
Returns whether we are instrumenting demons.
Definition at line 4143 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.instrumentsVariables | ( | ) |
Returns whether we are tracing variables.
Definition at line 4164 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.isLocalSearchProfilingEnabled | ( | ) |
Returns whether we are profiling local search.
Definition at line 4157 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.isProfilingEnabled | ( | ) |
Returns whether we are profiling the solver.
Definition at line 4150 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.keepAliveDecisionBuilder | ( | DecisionBuilder | db | ) |
Definition at line 200 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.keepAliveDecisionBuilder | ( | DecisionBuilder[] | dbs | ) |
Definition at line 206 of file Solver.java.
String com.google.ortools.constraintsolver.Solver.localSearchProfile | ( | ) |
Returns local search profiling information in a human readable format.
Definition at line 4037 of file Solver.java.
|expr|
Definition at line 942 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeAbsEquality | ( | IntVar | var, |
IntVar | abs_var ) |
Creates the constraint abs(var) == abs_var.
Definition at line 1596 of file Solver.java.
LocalSearchFilter com.google.ortools.constraintsolver.Solver.MakeAcceptFilter | ( | ) |
Local Search Filters
Definition at line 3925 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeAllDifferent | ( | IntVar[] | vars | ) |
All variables are pairwise different. This corresponds to the
stronger version of the propagation algorithm.
Definition at line 1841 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeAllDifferent | ( | IntVar[] | vars, |
boolean | 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 1851 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeAllDifferentExcept | ( | IntVar[] | vars, |
long | escape_value ) |
All variables are pairwise different, unless they are assigned to
the escape value.
Definition at line 1860 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeAllowedAssignment | ( | IntVar[] | vars, |
IntTupleSet | tuples ) |
This method creates a constraint where the graph of the relation
between the variables is given in extension. There are 'arity'
variables involved in the relation and the graph is given by a
integer tuple set.
Definition at line 2099 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeAllSolutionCollector | ( | ) |
Collect all solutions of the search. The variables will need to
be added later.
Definition at line 2651 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeAllSolutionCollector | ( | Assignment | assignment | ) |
Collect all solutions of the search.
Definition at line 2642 of file Solver.java.
Assignment com.google.ortools.constraintsolver.Solver.makeAssignment | ( | ) |
This method creates an empty assignment.
Definition at line 2522 of file Solver.java.
Assignment com.google.ortools.constraintsolver.Solver.makeAssignment | ( | Assignment | a | ) |
This method creates an assignment which is a copy of 'a'.
Definition at line 2530 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeAssignVariablesValues | ( | IntVar[] | vars, |
long[] | values ) |
Definition at line 3147 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.MakeAssignVariablesValuesOrDoNothing | ( | IntVar[] | vars, |
long[] | values ) |
Definition at line 3152 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.MakeAssignVariablesValuesOrFail | ( | IntVar[] | vars, |
long[] | values ) |
Definition at line 3157 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeAssignVariableValue | ( | IntVar | var, |
long | val ) |
Decisions.
Definition at line 3117 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.MakeAssignVariableValueOrDoNothing | ( | IntVar | var, |
long | value ) |
Definition at line 3142 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeAssignVariableValueOrFail | ( | IntVar | var, |
long | value ) |
Definition at line 3137 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeAtSolutionCallback | ( | Runnable | callback | ) |
Definition at line 3065 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.MakeBestLexicographicValueSolutionCollector | ( | Assignment | assignment, |
SWIGTYPE_p_std__vectorT_bool_t | maximize ) |
Same as above, but supporting lexicographic objectives; 'maximize'
specifies the optimization direction for each objective in 'assignment'.
Definition at line 2584 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.MakeBestLexicographicValueSolutionCollector | ( | SWIGTYPE_p_std__vectorT_bool_t | maximize | ) |
Same as above, but supporting lexicographic objectives; 'maximize'
specifies the optimization direction for each objective.
Definition at line 2605 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeBestValueSolutionCollector | ( | Assignment | assignment, |
boolean | maximize ) |
Collect the solution corresponding to the optimal value of the objective
of 'assignment'; if 'assignment' 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).
Definition at line 2575 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeBestValueSolutionCollector | ( | boolean | maximize | ) |
Collect the solution corresponding to the optimal value of the
objective of the internal assignment; if this assignment 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 and objective(s) will need to be added later.
Definition at line 2596 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeBetweenCt | ( | IntExpr | expr, |
long | l, | ||
long | u ) |
(l <= expr <= u)
Definition at line 1642 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeBoolVar | ( | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 822 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeBoolVar | ( | String | name | ) |
MakeBoolVar will create a variable with a {0, 1} domain.
Definition at line 814 of file Solver.java.
IntVar[] com.google.ortools.constraintsolver.Solver.makeBoolVarArray | ( | int | count | ) |
Definition at line 147 of file Solver.java.
IntVar[] com.google.ortools.constraintsolver.Solver.makeBoolVarArray | ( | int | count, |
String | name ) |
Definition at line 155 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeBranchesLimit | ( | long | branches | ) |
Creates a search limit that constrains the number of branches
explored in the search tree.
Definition at line 2853 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCircuit | ( | IntVar[] | nexts | ) |
Force the "nexts" variable to create a complete Hamiltonian path.
Definition at line 2013 of file Solver.java.
Demon com.google.ortools.constraintsolver.Solver.makeClosureDemon | ( | Runnable | closure | ) |
Creates a demon from a closure.
Definition at line 1634 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeConditionalExpression | ( | IntVar | condition, |
IntExpr | expr, | ||
long | unperformed_value ) |
Conditional Expr condition ? expr : unperformed_value
Definition at line 1138 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeConstantRestart | ( | int | frequency | ) |
This search monitor will restart the search periodically after 'frequency'
failures.
Definition at line 2831 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeConstraintAdder | ( | Constraint | ct | ) |
Returns a decision builder that will add the given constraint to
the model.
Definition at line 3457 of file Solver.java.
Demon com.google.ortools.constraintsolver.Solver.makeConstraintInitialPropagateCallback | ( | Constraint | ct | ) |
This method is a specialized case of the MakeConstraintDemon
method to call the InitiatePropagate of the constraint 'ct'.
Definition at line 1616 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeConvexPiecewiseExpr | ( | IntExpr | expr, |
long | early_cost, | ||
long | early_date, | ||
long | late_date, | ||
long | late_cost ) |
Convex piecewise function.
Definition at line 1102 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCount | ( | IntVar[] | vars, |
long | value, | ||
IntVar | max_count ) |
|{i | vars[i] == value}| == max_count
Definition at line 1748 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCount | ( | IntVar[] | vars, |
long | value, | ||
long | max_count ) |
|{i | vars[i] == value}| == max_count
Definition at line 1740 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCover | ( | IntervalVar[] | vars, |
IntervalVar | target_var ) |
This constraint states that the target_var is the convex hull of
the intervals. If none of the interval variables is performed,
then the target var is unperformed too. Also, if the target
variable is unperformed, then all the intervals variables are
unperformed too.
Definition at line 2506 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
int[] | demands, | ||
IntVar | capacity, | ||
String | name ) |
This constraint enforces 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 2466 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
int[] | demands, | ||
long | capacity, | ||
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 2434 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
IntVar[] | demands, | ||
IntVar | capacity, | ||
String | name ) |
This constraint enforces that, for any integer t, the sum of demands
corresponding to an interval containing t does not exceed the given
capacity.
Intervals and demands should be vectors of equal size.
Demands should be positive.
Definition at line 2494 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
IntVar[] | demands, | ||
long | capacity, | ||
String | name ) |
This constraint enforces that, for any integer t, the sum of demands
corresponding to an interval containing t does not exceed the given
capacity.
Intervals and demands should be vectors of equal size.
Demands should be positive.
Definition at line 2480 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
long[] | demands, | ||
IntVar | capacity, | ||
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 2450 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeCumulative | ( | IntervalVar[] | intervals, |
long[] | demands, | ||
long | capacity, | ||
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 2418 of file Solver.java.
SearchLimit com.google.ortools.constraintsolver.Solver.makeCustomLimit | ( | BooleanSupplier | limiter | ) |
Callback-based search limit. Search stops when limiter returns true; if
this happens at a leaf the corresponding solution will be rejected.
Definition at line 2976 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeDecision | ( | Consumer< Solver > | apply, |
Consumer< Solver > | refute ) |
Definition at line 3167 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeDecisionBuilderFromAssignment | ( | Assignment | assignment, |
DecisionBuilder | db, | ||
IntVar[] | vars ) |
Returns a decision builder for which the left-most leaf corresponds
to assignment, the rest of the tree being explored using 'db'.
Definition at line 3444 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeDefaultPhase | ( | IntVar[] | vars | ) |
Definition at line 3326 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeDefaultPhase | ( | IntVar[] | vars, |
DefaultPhaseParameters | parameters ) |
Definition at line 3331 of file Solver.java.
com.google.ortools.constraintsolver.RegularLimitParameters com.google.ortools.constraintsolver.Solver.makeDefaultRegularLimitParameters | ( | ) |
Creates a regular limit proto containing default values.
Definition at line 2929 of file Solver.java.
SolutionPool com.google.ortools.constraintsolver.Solver.makeDefaultSolutionPool | ( | ) |
Solution Pool.
Definition at line 3860 of file Solver.java.
Demon com.google.ortools.constraintsolver.Solver.makeDelayedConstraintInitialPropagateCallback | ( | Constraint | 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 1626 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDelayedPathCumul | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
IntVar[] | cumuls, | ||
IntVar[] | transits ) |
Delayed version of the same constraint: propagation on the nexts variables
is delayed until all constraints have propagated.
Definition at line 2042 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDeviation | ( | IntVar[] | vars, |
IntVar | deviation_var, | ||
long | total_sum ) |
Deviation constraint:
sum_i |n * vars[i] - total_sum| <= deviation_var and
sum_i vars[i] == total_sum
n = #vars
Definition at line 1832 of file Solver.java.
left - right
Definition at line 886 of file Solver.java.
value - expr
Definition at line 894 of file Solver.java.
DisjunctiveConstraint com.google.ortools.constraintsolver.Solver.makeDisjunctiveConstraint | ( | IntervalVar[] | intervals, |
String | name ) |
This constraint forces all interval vars into an non-overlapping
sequence. Intervals with zero duration can be scheduled anywhere.
Definition at line 2392 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
int[] | card_min, | ||
int[] | card_max ) |
Aggregated version of count with bounded cardinalities:
forall j in 0 .. card_size - 1:
card_min[j] <= |{i | v[i] == j}| <= card_max[j]
Definition at line 1801 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
int[] | values, | ||
int[] | card_min, | ||
int[] | card_max ) |
Aggregated version of count with bounded cardinalities:
forall j in 0 .. card_size - 1:
card_min[j] <= |{i | v[i] == values[j]}| <= card_max[j]
Definition at line 1821 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
int[] | values, | ||
IntVar[] | cards ) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]
Definition at line 1764 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
IntVar[] | cards ) |
Aggregated version of count: |{i | v[i] == j}| == cards[j]
Definition at line 1772 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
long | card_min, | ||
long | card_max, | ||
long | 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 1781 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
long[] | card_min, | ||
long[] | card_max ) |
Aggregated version of count with bounded cardinalities:
forall j in 0 .. card_size - 1:
card_min[j] <= |{i | v[i] == j}| <= card_max[j]
Definition at line 1791 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
long[] | values, | ||
IntVar[] | cards ) |
Aggregated version of count: |{i | v[i] == values[j]}| == cards[j]
Definition at line 1756 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeDistribute | ( | IntVar[] | vars, |
long[] | values, | ||
long[] | card_min, | ||
long[] | card_max ) |
Aggregated version of count with bounded cardinalities:
forall j in 0 .. card_size - 1:
card_min[j] <= |{i | v[i] == values[j]}| <= card_max[j]
Definition at line 1811 of file Solver.java.
expr / value (integer division)
Definition at line 926 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeDiv | ( | IntExpr | numerator, |
IntExpr | denominator ) |
numerator / denominator (integer division). Terms need to be positive.
Definition at line 934 of file Solver.java.
values[index]
Definition at line 974 of file Solver.java.
vars[expr]
Definition at line 1013 of file Solver.java.
values[index]
Definition at line 966 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeElement | ( | LongBinaryOperator | values, |
IntVar | index1, | ||
IntVar | index2 ) |
2D version of function-based element expression, values(expr1, expr2).
Definition at line 1005 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeElement | ( | LongUnaryOperator | values, |
IntVar | index ) |
Function-based element. The constraint takes ownership of the
callback. The callback must be able to cope with any possible
value in the domain of 'index' (potentially negative ones too).
Definition at line 984 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeElementEquality | ( | int[] | vals, |
IntVar | index, | ||
IntVar | target ) |
Definition at line 1578 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeElementEquality | ( | IntVar[] | vars, |
IntVar | index, | ||
IntVar | target ) |
Definition at line 1583 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeElementEquality | ( | IntVar[] | vars, |
IntVar | index, | ||
long | target ) |
Definition at line 1588 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeElementEquality | ( | long[] | vals, |
IntVar | index, | ||
IntVar | target ) |
Definition at line 1573 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeEnterSearchCallback | ( | Runnable | callback | ) |
--— Callback-based search monitors --—
Definition at line 3055 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeEquality | ( | IntervalVar | var1, |
IntervalVar | var2 ) |
This constraints states that the two interval variables are equal.
Definition at line 2514 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeEquality | ( | IntExpr | expr, |
int | value ) |
expr == value
Definition at line 1215 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeEquality | ( | IntExpr | expr, |
long | value ) |
expr == value
Definition at line 1207 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeEquality | ( | IntExpr | left, |
IntExpr | right ) |
left == right
Definition at line 1199 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeExitSearchCallback | ( | Runnable | callback | ) |
Definition at line 3060 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeFailDecision | ( | ) |
Definition at line 3162 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeFailuresLimit | ( | long | failures | ) |
Creates a search limit that constrains the number of failures
that can happen when exploring the search tree.
Definition at line 2862 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeFalseConstraint | ( | ) |
This constraint always fails.
Definition at line 1154 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeFalseConstraint | ( | String | explanation | ) |
Definition at line 1159 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeFirstSolutionCollector | ( | ) |
Collect the first solution of the search. The variables will need to
be added later.
Definition at line 2547 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeFirstSolutionCollector | ( | Assignment | assignment | ) |
Collect the first solution of the search.
Definition at line 2538 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationEndSyncedOnEndIntervalVar | ( | IntervalVar | interval_var, |
long | duration, | ||
long | offset ) |
Creates an interval var with a fixed duration whose end is
synchronized with the end of another interval, with a given
offset. The performed status is also in sync with the performed
status of the given interval variable.
Definition at line 2288 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationEndSyncedOnStartIntervalVar | ( | IntervalVar | interval_var, |
long | duration, | ||
long | offset ) |
Creates an interval var with a fixed duration whose end is
synchronized with the start of another interval, with a given
offset. The performed status is also in sync with the performed
status of the given interval variable.
Definition at line 2277 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationIntervalVar | ( | IntVar | start_variable, |
long | duration, | ||
IntVar | performed_variable, | ||
String | name ) |
Creates an interval var with a fixed duration, and performed_variable.
The duration must be greater than 0.
Definition at line 2218 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationIntervalVar | ( | IntVar | start_variable, |
long | duration, | ||
String | name ) |
Creates a performed interval var with a fixed duration. The duration must
be greater than 0.
Definition at line 2209 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationIntervalVar | ( | long | start_min, |
long | start_max, | ||
long | duration, | ||
boolean | optional, | ||
String | name ) |
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 2200 of file Solver.java.
IntervalVar[] com.google.ortools.constraintsolver.Solver.makeFixedDurationIntervalVarArray | ( | int | count, |
long | start_min, | ||
long | start_max, | ||
long | duration, | ||
boolean | optional ) |
Definition at line 164 of file Solver.java.
IntervalVar[] com.google.ortools.constraintsolver.Solver.makeFixedDurationIntervalVarArray | ( | int | count, |
long | start_min, | ||
long | start_max, | ||
long | duration, | ||
boolean | optional, | ||
String | name ) |
Definition at line 180 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationStartSyncedOnEndIntervalVar | ( | IntervalVar | interval_var, |
long | duration, | ||
long | offset ) |
Creates an interval var with a fixed duration whose start is
synchronized with the end of another interval, with a given
offset. The performed status is also in sync with the performed
status of the given interval variable.
Definition at line 2266 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedDurationStartSyncedOnStartIntervalVar | ( | IntervalVar | interval_var, |
long | duration, | ||
long | offset ) |
Creates an interval var with a fixed duration whose start is
synchronized with the start of another interval, with a given
offset. The performed status is also in sync with the performed
status of the given interval variable.
Definition at line 2255 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeFixedInterval | ( | long | start, |
long | duration, | ||
String | name ) |
Creates a fixed and performed interval.
Definition at line 2226 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeGenericTabuSearch | ( | boolean | maximize, |
IntVar | v, | ||
long | step, | ||
IntVar[] | tabu_vars, | ||
long | forbid_tenure ) |
Creates a Tabu Search based on the vars |vars|.
A solution is "tabu" if all the vars in |vars| keep their value.
Definition at line 2771 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreater | ( | IntExpr | expr, |
int | value ) |
expr > value
Definition at line 1439 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreater | ( | IntExpr | expr, |
long | value ) |
expr > value
Definition at line 1431 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreater | ( | IntExpr | left, |
IntExpr | right ) |
left > right
Definition at line 1423 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreaterOrEqual | ( | IntExpr | expr, |
int | value ) |
expr >= value
Definition at line 1383 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreaterOrEqual | ( | IntExpr | expr, |
long | value ) |
expr >= value
Definition at line 1375 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeGreaterOrEqual | ( | IntExpr | left, |
IntExpr | right ) |
left >= right
Definition at line 1367 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeGuidedLocalSearch | ( | boolean | maximize, |
IntVar | objective, | ||
LongBinaryOperator | objective_function, | ||
long | step, | ||
IntVar[] | vars, | ||
double | penalty_factor ) |
Creates a Guided Local Search monitor.
Description here: http://en.wikipedia.org/wiki/Guided_Local_Search
Definition at line 2802 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeGuidedLocalSearch | ( | boolean | maximize, |
IntVar | objective, | ||
LongBinaryOperator | objective_function, | ||
long | step, | ||
IntVar[] | vars, | ||
double | penalty_factor, | ||
boolean | reset_penalties_on_new_best_solution ) |
Creates a Guided Local Search monitor.
Description here: http://en.wikipedia.org/wiki/Guided_Local_Search
Definition at line 2793 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeGuidedLocalSearch | ( | boolean | maximize, |
IntVar | objective, | ||
LongTernaryOperator | objective_function, | ||
long | step, | ||
IntVar[] | vars, | ||
IntVar[] | secondary_vars, | ||
double | penalty_factor ) |
Definition at line 2812 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeGuidedLocalSearch | ( | boolean | maximize, |
IntVar | objective, | ||
LongTernaryOperator | objective_function, | ||
long | step, | ||
IntVar[] | vars, | ||
IntVar[] | secondary_vars, | ||
double | penalty_factor, | ||
boolean | reset_penalties_on_new_best_solution ) |
Definition at line 2807 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIfThenElseCt | ( | IntVar | condition, |
IntExpr | then_expr, | ||
IntExpr | else_expr, | ||
IntVar | target_var ) |
Special cases with arrays of size two.
Definition at line 1030 of file Solver.java.
ImprovementSearchLimit com.google.ortools.constraintsolver.Solver.MakeImprovementLimit | ( | IntVar | objective_var, |
boolean | maximize, | ||
double | objective_scaling_factor, | ||
double | objective_offset, | ||
double | improvement_rate_coefficient, | ||
int | improvement_rate_solutions_distance ) |
Limits the search based on the improvements of 'objective_var'. Stops the
search when the improvement rate gets lower than a threshold value. This
threshold value is computed based on the improvement rate during the first
phase of the search.
Definition at line 2958 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeIndexExpression | ( | IntVar[] | vars, |
long | value ) |
Returns the expression expr such that vars[expr] == value.
It assumes that vars are all different.
Definition at line 1022 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIndexOfConstraint | ( | IntVar[] | vars, |
IntVar | index, | ||
long | target ) |
This constraint is a special case of the element constraint with
an array of integer variables, where the variables are all
different and the index variable is constrained such that
vars[index] == target.
Definition at line 1607 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIndexOfFirstMaxValueConstraint | ( | IntVar | index, |
IntVar[] | vars ) |
Creates a constraint that binds the index variable to the index of the
first variable with the maximum value.
Definition at line 1936 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIndexOfFirstMinValueConstraint | ( | IntVar | index, |
IntVar[] | vars ) |
Creates a constraint that binds the index variable to the index of the
first variable with the minimum value.
Definition at line 1945 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntConst | ( | long | val | ) |
IntConst will create a constant expression.
Definition at line 838 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntConst | ( | long | val, |
String | name ) |
IntConst will create a constant expression.
Definition at line 830 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeIntervalRelaxedMax | ( | IntervalVar | interval_var | ) |
Creates and returns an interval variable that wraps around the given one,
relaxing the max start and end. Relaxing means making unbounded when
optional. If the variable is non optional, this method 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 for implementing propagators that may only modify
the start min or end min.
Definition at line 2336 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeIntervalRelaxedMin | ( | IntervalVar | 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 method 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 2312 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeIntervalVar | ( | long | start_min, |
long | start_max, | ||
long | duration_min, | ||
long | duration_max, | ||
long | end_min, | ||
long | end_max, | ||
boolean | optional, | ||
String | name ) |
Creates an interval var by specifying the bounds on start,
duration, and end.
Definition at line 2235 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIntervalVarRelation | ( | IntervalVar | t, |
int | r, | ||
long | d ) |
This method creates a relation between an interval var and a
date.
Definition at line 2345 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIntervalVarRelation | ( | IntervalVar | t1, |
int | r, | ||
IntervalVar | t2 ) |
This method creates a relation between two interval vars.
Definition at line 2353 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIntervalVarRelationWithDelay | ( | IntervalVar | t1, |
int | r, | ||
IntervalVar | t2, | ||
long | delay ) |
This method creates a relation between two interval vars.
The given delay is added to the second interval.
i.e.: t1 STARTS_AFTER_END of t2 with a delay of 2
means t1 will start at least two units of time after the end of t2.
Definition at line 2364 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | int[] | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 806 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | int[] | values, |
String | name ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 782 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | long | min, |
long | max ) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 790 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | long | min, |
long | max, | ||
String | name ) |
MakeIntVar will create the best range based int var for the bounds given.
Definition at line 766 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | long[] | values | ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 798 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIntVar | ( | long[] | values, |
String | name ) |
MakeIntVar will create a variable with the given sparse domain.
Definition at line 774 of file Solver.java.
IntVar[] com.google.ortools.constraintsolver.Solver.makeIntVarArray | ( | int | count, |
long | min, | ||
long | max ) |
Definition at line 130 of file Solver.java.
IntVar[] com.google.ortools.constraintsolver.Solver.makeIntVarArray | ( | int | count, |
long | min, | ||
long | max, | ||
String | name ) |
Definition at line 138 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeInversePermutationConstraint | ( | IntVar[] | left, |
IntVar[] | right ) |
Creates a constraint that enforces that 'left' and 'right' both
represent permutations of [0..left.size()-1], and that 'right' is
the inverse permutation of 'left', i.e. for all i in
[0..left.size()-1], right[left[i]] = i.
Definition at line 1927 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsBetweenCt | ( | IntExpr | expr, |
long | l, | ||
long | u, | ||
IntVar | b ) |
b == (l <= expr <= u)
Definition at line 1661 of file Solver.java.
Definition at line 1666 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsDifferentCstCt | ( | IntExpr | v1, |
IntExpr | v2, | ||
IntVar | b ) |
b == (v1 != v2)
Definition at line 1247 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsDifferentCstCt | ( | IntExpr | var, |
long | value, | ||
IntVar | boolvar ) |
boolvar == (var != value)
Definition at line 1223 of file Solver.java.
status var of (v1 != v2)
Definition at line 1239 of file Solver.java.
status var of (var != value)
Definition at line 1231 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsEqualCstCt | ( | IntExpr | var, |
long | value, | ||
IntVar | boolvar ) |
boolvar == (var == value)
Definition at line 1167 of file Solver.java.
status var of (var == value)
Definition at line 1175 of file Solver.java.
status var of (v1 == v2)
Definition at line 1191 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsEqualVar | ( | IntExpr | v1, |
IntExpr | v2, | ||
IntVar | b ) |
b == (v1 == v2)
Definition at line 1183 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsGreaterCstCt | ( | IntExpr | v, |
long | c, | ||
IntVar | b ) |
b == (v > c)
Definition at line 1391 of file Solver.java.
status var of (var > value)
Definition at line 1399 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsGreaterCt | ( | IntExpr | left, |
IntExpr | right, | ||
IntVar | b ) |
b == (left > right)
Definition at line 1415 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsGreaterOrEqualCstCt | ( | IntExpr | var, |
long | value, | ||
IntVar | boolvar ) |
boolvar == (var >= value)
Definition at line 1335 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIsGreaterOrEqualCstVar | ( | IntExpr | var, |
long | value ) |
status var of (var >= value)
Definition at line 1343 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsGreaterOrEqualCt | ( | IntExpr | left, |
IntExpr | right, | ||
IntVar | b ) |
b == (left >= right)
Definition at line 1359 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIsGreaterOrEqualVar | ( | IntExpr | left, |
IntExpr | right ) |
status var of (left >= right)
Definition at line 1351 of file Solver.java.
status var of (left > right)
Definition at line 1407 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsLessCstCt | ( | IntExpr | v, |
long | c, | ||
IntVar | b ) |
b == (v < c)
Definition at line 1447 of file Solver.java.
status var of (var < value)
Definition at line 1455 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsLessCt | ( | IntExpr | left, |
IntExpr | right, | ||
IntVar | b ) |
b == (left < right)
Definition at line 1471 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsLessOrEqualCstCt | ( | IntExpr | var, |
long | value, | ||
IntVar | boolvar ) |
boolvar == (var <= value)
Definition at line 1279 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIsLessOrEqualCstVar | ( | IntExpr | var, |
long | value ) |
status var of (var <= value)
Definition at line 1287 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsLessOrEqualCt | ( | IntExpr | left, |
IntExpr | right, | ||
IntVar | b ) |
b == (left <= right)
Definition at line 1303 of file Solver.java.
IntVar com.google.ortools.constraintsolver.Solver.makeIsLessOrEqualVar | ( | IntExpr | left, |
IntExpr | right ) |
status var of (left <= right)
Definition at line 1295 of file Solver.java.
status var of (left < right)
Definition at line 1463 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.MakeIsLexicalLessOrEqualWithOffsetsCt | ( | IntVar[] | left, |
IntVar[] | right, | ||
long[] | offsets, | ||
IntVar | boolvar ) |
Definition at line 1916 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsMemberCt | ( | IntExpr | expr, |
int[] | values, | ||
IntVar | boolvar ) |
Definition at line 1722 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeIsMemberCt | ( | IntExpr | expr, |
long[] | values, | ||
IntVar | boolvar ) |
boolvar == (expr in set)
Definition at line 1717 of file Solver.java.
Definition at line 1732 of file Solver.java.
Definition at line 1727 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeLastSolutionCollector | ( | ) |
Collect the last solution of the search. The variables will need to
be added later.
Definition at line 2564 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeLastSolutionCollector | ( | Assignment | assignment | ) |
Collect the last solution of the search.
Definition at line 2555 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLess | ( | IntExpr | expr, |
int | value ) |
expr < value
Definition at line 1495 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLess | ( | IntExpr | expr, |
long | value ) |
expr < value
Definition at line 1487 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLess | ( | IntExpr | left, |
IntExpr | right ) |
left < right
Definition at line 1479 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLessOrEqual | ( | IntExpr | expr, |
int | value ) |
expr <= value
Definition at line 1327 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLessOrEqual | ( | IntExpr | expr, |
long | value ) |
expr <= value
Definition at line 1319 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLessOrEqual | ( | IntExpr | left, |
IntExpr | right ) |
left <= right
Definition at line 1311 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLexicalLess | ( | IntVar[] | left, |
IntVar[] | right ) |
Creates a constraint that enforces that left is lexicographically less
than right.
Definition at line 1891 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeLexicalLessOrEqual | ( | IntVar[] | left, |
IntVar[] | right ) |
Creates a constraint that enforces that left is lexicographically less
than or equal to right.
Definition at line 1900 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.MakeLexicalLessOrEqualWithOffsets | ( | IntVar[] | left, |
IntVar[] | right, | ||
long[] | offsets ) |
Creates a constraint that enforces that left is lexicographically less
than or equal to right with an offset. This means that for the first index
i such that left[i] is not in [right[i] - (offset[i] - 1), right[i]],
left[i] + offset[i] <= right[i]. Offset values must be > 0.
Definition at line 1911 of file Solver.java.
ImprovementSearchLimit com.google.ortools.constraintsolver.Solver.MakeLexicographicImprovementLimit | ( | IntVar[] | objective_vars, |
SWIGTYPE_p_std__vectorT_bool_t | maximize, | ||
double[] | objective_scaling_factors, | ||
double[] | objective_offsets, | ||
double | improvement_rate_coefficient, | ||
int | improvement_rate_solutions_distance ) |
Same as MakeImprovementLimit on a lexicographic objective based on
'objective_vars' and related arguments.
Definition at line 2967 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.MakeLexicographicOptimize | ( | SWIGTYPE_p_std__vectorT_bool_t | maximize, |
IntVar[] | variables, | ||
long[] | steps ) |
Creates a lexicographic objective, following the order of the variables
given. Each variable has a corresponding optimization direction and step.
Definition at line 2734 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.MakeLexicographicSimulatedAnnealing | ( | SWIGTYPE_p_std__vectorT_bool_t | maximize, |
IntVar[] | vars, | ||
long[] | steps, | ||
long[] | initial_temperatures ) |
Definition at line 2784 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.MakeLexicographicTabuSearch | ( | SWIGTYPE_p_std__vectorT_bool_t | maximize, |
IntVar[] | objectives, | ||
long[] | steps, | ||
IntVar[] | vars, | ||
long | keep_tenure, | ||
long | forbid_tenure, | ||
double | tabu_factor ) |
Definition at line 2762 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | com.google.ortools.constraintsolver.RegularLimitParameters | proto | ) |
Creates a search limit from its protobuf description
Definition at line 2906 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | long | time, |
long | branches, | ||
long | failures, | ||
long | solutions ) |
Definition at line 2921 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | long | time, |
long | branches, | ||
long | failures, | ||
long | solutions, | ||
boolean | smart_time_check ) |
Definition at line 2916 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | long | time, |
long | branches, | ||
long | failures, | ||
long | solutions, | ||
boolean | smart_time_check, | ||
boolean | cumulative ) |
Definition at line 2911 of file Solver.java.
SearchLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | SearchLimit | limit_1, |
SearchLimit | limit_2 ) |
Creates a search limit that is reached when either of the underlying limit
is reached. That is, the returned limit is more stringent than both
argument limits.
Definition at line 2947 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | SWIGTYPE_p_absl__Duration | time, |
long | branches, | ||
long | failures, | ||
long | solutions ) |
Limits the search with the 'time', 'branches', 'failures' and
'solutions' limits. 'smart_time_check' reduces the calls to the wall
Definition at line 2898 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | SWIGTYPE_p_absl__Duration | time, |
long | branches, | ||
long | failures, | ||
long | solutions, | ||
boolean | smart_time_check ) |
Limits the search with the 'time', 'branches', 'failures' and
'solutions' limits. 'smart_time_check' reduces the calls to the wall
Definition at line 2889 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeLimit | ( | SWIGTYPE_p_absl__Duration | time, |
long | branches, | ||
long | failures, | ||
long | solutions, | ||
boolean | smart_time_check, | ||
boolean | cumulative ) |
Limits the search with the 'time', 'branches', 'failures' and
'solutions' limits. 'smart_time_check' reduces the calls to the wall
Definition at line 2880 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeLocalSearchPhase | ( | Assignment | assignment, |
LocalSearchPhaseParameters | 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 3799 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeLocalSearchPhase | ( | IntVar[] | vars, |
DecisionBuilder | first_solution, | ||
DecisionBuilder | first_solution_sub_decision_builder, | ||
LocalSearchPhaseParameters | parameters ) |
Variant with a sub_decison_builder specific to the first solution.
Definition at line 3816 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeLocalSearchPhase | ( | IntVar[] | vars, |
DecisionBuilder | first_solution, | ||
LocalSearchPhaseParameters | parameters ) |
Definition at line 3804 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeLocalSearchPhase | ( | SequenceVar[] | vars, |
DecisionBuilder | first_solution, | ||
LocalSearchPhaseParameters | parameters ) |
Definition at line 3826 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder ) |
Local Search Phase Parameters
Definition at line 3868 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder, | ||
RegularLimit | limit ) |
Definition at line 3877 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder, | ||
RegularLimit | limit, | ||
LocalSearchFilterManager | filter_manager ) |
Definition at line 3886 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
SolutionPool | pool, | ||
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder ) |
Definition at line 3895 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
SolutionPool | pool, | ||
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder, | ||
RegularLimit | limit ) |
Definition at line 3904 of file Solver.java.
LocalSearchPhaseParameters com.google.ortools.constraintsolver.Solver.makeLocalSearchPhaseParameters | ( | IntVar | objective, |
SolutionPool | pool, | ||
LocalSearchOperator | ls_operator, | ||
DecisionBuilder | sub_decision_builder, | ||
RegularLimit | limit, | ||
LocalSearchFilterManager | filter_manager ) |
Definition at line 3913 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeLubyRestart | ( | int | scale_factor | ) |
This search monitor will restart the search periodically.
At the iteration n, it will restart after scale_factor * Luby(n) failures
where Luby is the Luby Strategy (i.e. 1 1 2 1 1 2 4 1 1 2 1 1 2 4 8...).
Definition at line 2822 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeMapDomain | ( | IntVar | var, |
IntVar[] | actives ) |
This constraint maps the domain of 'var' onto the array of
variables 'actives'. That is
for all i in [0 .. size - 1]: actives[i] == 1 <=> var->Contains(i);
Definition at line 2088 of file Solver.java.
std::max(expr, value)
Definition at line 1094 of file Solver.java.
std::max(expr, value)
Definition at line 1086 of file Solver.java.
std::max(left, right)
Definition at line 1078 of file Solver.java.
std::max(vars)
Definition at line 1070 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeMaxEquality | ( | IntVar[] | vars, |
IntVar | max_var ) |
Definition at line 1568 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeMaximize | ( | IntVar | v, |
long | step ) |
Creates a maximization objective.
Definition at line 2667 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeMemberCt | ( | IntExpr | expr, |
int[] | values ) |
Definition at line 1680 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeMemberCt | ( | IntExpr | expr, |
long[] | values ) |
expr in set. Propagation is lazy, i.e. this constraint does not
creates holes in the domain of the variable.
Definition at line 1675 of file Solver.java.
std::min(expr, value)
Definition at line 1062 of file Solver.java.
std::min(expr, value)
Definition at line 1054 of file Solver.java.
std::min (left, right)
Definition at line 1046 of file Solver.java.
std::min(vars)
Definition at line 1038 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeMinEquality | ( | IntVar[] | vars, |
IntVar | min_var ) |
Definition at line 1563 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeMinimize | ( | IntVar | v, |
long | step ) |
Creates a minimization objective.
Definition at line 2659 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.makeMirrorInterval | ( | IntervalVar | 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.
Definition at line 2244 of file Solver.java.
Modulo expression x % mod (with the python convention for modulo).
Definition at line 1130 of file Solver.java.
General piecewise-linear function expression, built from f(x) where f is
piecewise-linear. The resulting expression is f(expr).
expressions.
Modulo expression x % mod (with the python convention for modulo).
Definition at line 1122 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeMonotonicElement | ( | LongUnaryOperator | values, |
boolean | increasing, | ||
IntVar | index ) |
Function based element. The constraint takes ownership of the
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 997 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeMoveTowardTargetOperator | ( | Assignment | target | ) |
Creates a local search operator that tries to move the assignment of some
variables toward a target. 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 3665 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeMoveTowardTargetOperator | ( | IntVar[] | variables, |
long[] | 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 3678 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.MakeNBestLexicographicValueSolutionCollector | ( | Assignment | assignment, |
int | solution_count, | ||
SWIGTYPE_p_std__vectorT_bool_t | maximize ) |
Same as above but supporting lexicographic objectives; 'maximize'
specifies the optimization direction for each objective.
Definition at line 2629 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.MakeNBestLexicographicValueSolutionCollector | ( | int | solution_count, |
SWIGTYPE_p_std__vectorT_bool_t | maximize ) |
Definition at line 2634 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeNBestValueSolutionCollector | ( | Assignment | assignment, |
int | solution_count, | ||
boolean | maximize ) |
Same as MakeBestValueSolutionCollector but collects the best
solution_count solutions. Collected solutions are sorted in increasing
optimality order (the best solution is the last one).
Definition at line 2615 of file Solver.java.
SolutionCollector com.google.ortools.constraintsolver.Solver.makeNBestValueSolutionCollector | ( | int | solution_count, |
boolean | maximize ) |
Definition at line 2620 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeNeighborhoodLimit | ( | LocalSearchOperator | op, |
long | limit ) |
Creates a local search operator that wraps another local search
operator and limits the number of neighbors explored (i.e., 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 3769 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | 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. 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 return nullptr.
Definition at line 3531 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | step, | ||
SearchMonitor | monitor1 ) |
Definition at line 3540 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | step, | ||
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2 ) |
Definition at line 3549 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | step, | ||
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2, | ||
SearchMonitor | monitor3 ) |
Definition at line 3558 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | step, | ||
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2, | ||
SearchMonitor | monitor3, | ||
SearchMonitor | monitor4 ) |
Definition at line 3567 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeNestedOptimize | ( | DecisionBuilder | db, |
Assignment | solution, | ||
boolean | maximize, | ||
long | step, | ||
SearchMonitor[] | monitors ) |
Definition at line 3576 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNoCycle | ( | IntVar[] | nexts, |
IntVar[] | active ) |
Prevent cycles. The "nexts" variables represent 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 "nexts" variables represent paths (and performs a faster propagation);
otherwise the constraint assumes they represent a forest.
Definition at line 2000 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNoCycle | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
LongPredicate | sink_handler ) |
Prevent cycles. The "nexts" variables represent 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 "nexts" variables represent paths (and performs a faster propagation);
otherwise the constraint assumes they represent a forest.
Definition at line 1984 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNoCycle | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
LongPredicate | sink_handler, | ||
boolean | assume_paths ) |
Definition at line 2005 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonEquality | ( | IntExpr | expr, |
int | value ) |
expr != value
Definition at line 1271 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonEquality | ( | IntExpr | expr, |
long | value ) |
expr != value
Definition at line 1263 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonEquality | ( | IntExpr | left, |
IntExpr | right ) |
left != right
Definition at line 1255 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
IntVar[] | x_size, | ||
IntVar[] | y_size ) |
This constraint states that all the boxes must not overlap.
The coordinates of box i are:
(x_vars[i], y_vars[i]),
(x_vars[i], y_vars[i] + y_size[i]),
(x_vars[i] + x_size[i], y_vars[i]),
(x_vars[i] + x_size[i], y_vars[i] + y_size[i]).
The sizes must be non-negative. Boxes with a zero dimension can be
pushed like any box.
Definition at line 2142 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
SWIGTYPE_p_absl__SpanT_int_const_t | x_size, | ||
SWIGTYPE_p_absl__SpanT_int_const_t | y_size ) |
Definition at line 2152 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
SWIGTYPE_p_absl__SpanT_long_const_t | x_size, | ||
SWIGTYPE_p_absl__SpanT_long_const_t | y_size ) |
Definition at line 2147 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingNonStrictBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
IntVar[] | x_size, | ||
IntVar[] | y_size ) |
This constraint states that all the boxes must not overlap.
The coordinates of box i are:
(x_vars[i], y_vars[i]),
(x_vars[i], y_vars[i] + y_size[i]),
(x_vars[i] + x_size[i], y_vars[i]),
(x_vars[i] + x_size[i], y_vars[i] + y_size[i]).
The sizes must be positive.
Boxes with a zero dimension can be placed anywhere.
Definition at line 2167 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingNonStrictBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
SWIGTYPE_p_absl__SpanT_int_const_t | x_size, | ||
SWIGTYPE_p_absl__SpanT_int_const_t | y_size ) |
Definition at line 2177 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNonOverlappingNonStrictBoxesConstraint | ( | IntVar[] | x_vars, |
IntVar[] | y_vars, | ||
SWIGTYPE_p_absl__SpanT_long_const_t | x_size, | ||
SWIGTYPE_p_absl__SpanT_long_const_t | y_size ) |
Definition at line 2172 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNotBetweenCt | ( | IntExpr | expr, |
long | l, | ||
long | u ) |
(expr < l || expr > u)
This constraint is lazy as it will not make holes in the domain of
variables. It will propagate only when expr->Min() >= l
or expr->Max() <= u.
Definition at line 1653 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNotMemberCt | ( | IntExpr | expr, |
int[] | starts, | ||
int[] | ends ) |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1709 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNotMemberCt | ( | IntExpr | expr, |
int[] | values ) |
Definition at line 1693 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNotMemberCt | ( | IntExpr | expr, |
long[] | starts, | ||
long[] | ends ) |
expr should not be in the list of forbidden intervals [start[i]..end[i]].
Definition at line 1701 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNotMemberCt | ( | IntExpr | expr, |
long[] | values ) |
expr not in set.
Definition at line 1688 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNullIntersect | ( | IntVar[] | first_vars, |
IntVar[] | second_vars ) |
Creates a constraint that states that all variables in the first
vector are different from all variables in the second
group. Thus the set of values in the first vector does not
intersect with the set of values in the second vector.
Definition at line 1956 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeNullIntersectExcept | ( | IntVar[] | first_vars, |
IntVar[] | second_vars, | ||
long | escape_value ) |
Creates a constraint that states that all variables in the first
vector are different from all variables from the second group,
unless they are assigned to the escape value. Thus the set of
values in the first vector minus the escape value does not
intersect with the set of values in the second vector.
Definition at line 1968 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
int | op ) |
Local Search Operators.
Definition at line 3614 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
int | op, | ||
SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t | get_neighbors ) |
Local Search Operators.
Definition at line 3606 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
IntVar[] | secondary_vars, | ||
int | op ) |
Definition at line 3624 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
IntVar[] | secondary_vars, | ||
int | op, | ||
SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t | get_neighbors ) |
Definition at line 3619 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
IntVar[] | secondary_vars, | ||
LongTernaryOperator | evaluator, | ||
int | op ) |
Definition at line 3634 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeOperator | ( | IntVar[] | vars, |
LongTernaryOperator | evaluator, | ||
int | op ) |
Definition at line 3629 of file Solver.java.
-expr
Definition at line 902 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeOptimize | ( | boolean | maximize, |
IntVar | v, | ||
long | step ) |
Creates a objective with a given sense (true = maximization).
Definition at line 2675 of file Solver.java.
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.
Definition at line 2189 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makePathConnected | ( | IntVar[] | nexts, |
long[] | sources, | ||
long[] | sinks, | ||
IntVar[] | status ) |
Constraint enforcing that status[i] is true iff there's a path defined on
next variables from sources[i] to sinks[i].
Check whether more propagation is needed.
Definition at line 2078 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makePathCumul | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
IntVar[] | cumuls, | ||
IntVar[] | slacks, | ||
LongBinaryOperator | transit_evaluator ) |
Creates a constraint which accumulates values along a path such that:
cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]) + slacks[i].
Active variables indicate if the corresponding next variable is active;
this could be useful to model unperformed nodes in a routing problem.
Ownership of transit_evaluator is taken and it must be a repeatable
callback.
Definition at line 2068 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makePathCumul | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
IntVar[] | cumuls, | ||
IntVar[] | transits ) |
Creates a constraint which accumulates values along a path such that:
cumuls[next[i]] = cumuls[i] + transits[i].
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 2033 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makePathCumul | ( | IntVar[] | nexts, |
IntVar[] | active, | ||
IntVar[] | cumuls, | ||
LongBinaryOperator | transit_evaluator ) |
Creates a constraint which accumulates values along a path such that:
cumuls[next[i]] = cumuls[i] + transit_evaluator(i, next[i]).
Active variables indicate if the corresponding next variable is active;
this could be useful to model unperformed nodes in a routing problem.
Ownership of transit_evaluator is taken and it must be a repeatable
callback.
Definition at line 2055 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntervalVar[] | intervals, |
int | str ) |
Scheduling phases.
Definition at line 3430 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar | v0, |
int | var_str, | ||
int | val_str ) |
Shortcuts for small arrays.
Definition at line 3339 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar | v0, |
IntVar | v1, | ||
int | var_str, | ||
int | val_str ) |
Definition at line 3344 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar | v0, |
IntVar | v1, | ||
IntVar | v2, | ||
int | var_str, | ||
int | val_str ) |
Definition at line 3349 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar | v0, |
IntVar | v1, | ||
IntVar | v2, | ||
IntVar | v3, | ||
int | var_str, | ||
int | val_str ) |
Definition at line 3354 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
int | var_str, | ||
int | val_str ) |
Phases on IntVar arrays.
for all other functions that have several homonyms in this .h).
Definition at line 3287 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
int | var_str, | ||
LongBinaryOperator | value_evaluator ) |
Definition at line 3297 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
int | var_str, | ||
LongBinaryOperator | value_evaluator, | ||
LongUnaryOperator | tie_breaker ) |
Definition at line 3316 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
int | var_str, | ||
LongTernaryPredicate | var_val1_val2_comparator ) |
var_val1_val2_comparator(var, val1, val2) is true iff assigning value
"val1" to variable "var" is better than assigning value "val2".
Definition at line 3306 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
LongBinaryOperator | eval, | ||
int | 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.
Definition at line 3408 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
LongBinaryOperator | eval, | ||
LongUnaryOperator | tie_breaker, | ||
int | 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.
Definition at line 3422 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
LongUnaryOperator | var_evaluator, | ||
int | val_str ) |
Definition at line 3292 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
LongUnaryOperator | var_evaluator, | ||
LongBinaryOperator | value_evaluator ) |
Definition at line 3311 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | IntVar[] | vars, |
LongUnaryOperator | var_evaluator, | ||
LongBinaryOperator | value_evaluator, | ||
LongUnaryOperator | tie_breaker ) |
Definition at line 3321 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makePhase | ( | SequenceVar[] | sequences, |
int | str ) |
Definition at line 3435 of file Solver.java.
expr ^ n (n > 0)
Definition at line 958 of file Solver.java.
ModelVisitor com.google.ortools.constraintsolver.Solver.makePrintModelVisitor | ( | ) |
Prints the model.
Definition at line 3073 of file Solver.java.
expr * value
Definition at line 918 of file Solver.java.
left * right
Definition at line 910 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.MakeProfiledDecisionBuilderWrapper | ( | DecisionBuilder | db | ) |
Activates profiling on a decision builder.
Definition at line 4284 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeRandomLnsOperator | ( | 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). 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 3648 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.makeRandomLnsOperator | ( | IntVar[] | vars, |
int | number_of_variables, | ||
int | seed ) |
Definition at line 3653 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeRankFirstInterval | ( | SequenceVar | sequence, |
int | index ) |
Returns a decision that tries to rank first the ith interval var
in the sequence variable.
Definition at line 3387 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeRankLastInterval | ( | SequenceVar | sequence, |
int | index ) |
Returns a decision that tries to rank last the ith interval var
in the sequence variable.
Definition at line 3396 of file Solver.java.
LocalSearchFilter com.google.ortools.constraintsolver.Solver.MakeRejectFilter | ( | ) |
Definition at line 3930 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeRestoreAssignment | ( | Assignment | assignment | ) |
Returns a DecisionBuilder which restores an Assignment
(calls void Assignment::Restore())
Definition at line 3589 of file Solver.java.
scalar product
Definition at line 878 of file Solver.java.
scalar product
Definition at line 870 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdEquality | ( | IntVar[] | vars, |
int[] | coefficients, | ||
IntVar | target ) |
Definition at line 1538 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdEquality | ( | IntVar[] | vars, |
int[] | coefficients, | ||
long | cst ) |
Definition at line 1528 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdEquality | ( | IntVar[] | vars, |
long[] | coefficients, | ||
IntVar | target ) |
Definition at line 1533 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdEquality | ( | IntVar[] | vars, |
long[] | coefficients, | ||
long | cst ) |
Definition at line 1523 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdGreaterOrEqual | ( | IntVar[] | vars, |
int[] | coeffs, | ||
long | cst ) |
Definition at line 1548 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdGreaterOrEqual | ( | IntVar[] | vars, |
long[] | coeffs, | ||
long | cst ) |
Definition at line 1543 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdLessOrEqual | ( | IntVar[] | vars, |
int[] | coefficients, | ||
long | cst ) |
Definition at line 1558 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeScalProdLessOrEqual | ( | IntVar[] | vars, |
long[] | coefficients, | ||
long | cst ) |
Definition at line 1553 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeScheduleOrExpedite | ( | IntervalVar | var, |
long | est, | ||
SWIGTYPE_p_long | marker ) |
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 end to 'est'. On the Refute branch, it will just update the
'marker' to 'est' - 1. This decision is used in the
INTERVAL_SET_TIMES_BACKWARD strategy.
Definition at line 3378 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeScheduleOrPostpone | ( | IntervalVar | var, |
long | est, | ||
SWIGTYPE_p_long | marker ) |
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 3366 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period | ) |
The SearchMonitors below will display a periodic search log
on LOG(INFO) every branch_period branches explored.
Definition at line 2985 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
IntVar | var ) |
At each solution, this monitor also display the var value.
Definition at line 2993 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
IntVar | var, | ||
Supplier< String > | display_callback ) |
At each solution, this monitor will display the 'var' value and the
result of display_callback
.
Definition at line 3011 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
IntVar[] | vars, | ||
Supplier< String > | display_callback ) |
At each solution, this monitor will display the 'vars' values and the
result of display_callback
.
Definition at line 3020 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
OptimizeVar | opt_var ) |
OptimizeVar Search Logs
At each solution, this monitor will also display the 'opt_var' value.
Definition at line 3029 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
OptimizeVar | opt_var, | ||
Supplier< String > | display_callback ) |
Creates a search monitor that will also print the result of the
display callback.
Definition at line 3038 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchLog | ( | int | branch_period, |
Supplier< String > | display_callback ) |
At each solution, this monitor will also display result of
display_callback
.
Definition at line 3002 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSearchTrace | ( | String | prefix | ) |
Creates a search monitor that will trace precisely the behavior of the
search. Use this only for low level debugging.
Definition at line 3047 of file Solver.java.
IntExpr com.google.ortools.constraintsolver.Solver.makeSemiContinuousExpr | ( | IntExpr | expr, |
long | fixed_charge, | ||
long | step ) |
Semi continuous Expression (x <= 0 -> f(x) = 0; x > 0 -> f(x) = ax + b)
a >= 0 and b >= 0
Definition at line 1111 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeSimulatedAnnealing | ( | boolean | maximize, |
IntVar | v, | ||
long | step, | ||
long | initial_temperature ) |
Creates a Simulated Annealing monitor.
Definition at line 2779 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeSolutionsLimit | ( | long | solutions | ) |
Creates a search limit that constrains the number of solutions found
during the search.
Definition at line 2871 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | 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.
If there are no solutions to this nested tree, then SolveOnce will
fail. If there is a solution, it will find it and returns nullptr.
Definition at line 3468 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | db, |
SearchMonitor | monitor1 ) |
Definition at line 3477 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | db, |
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2 ) |
Definition at line 3486 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | db, |
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2, | ||
SearchMonitor | monitor3 ) |
Definition at line 3495 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | db, |
SearchMonitor | monitor1, | ||
SearchMonitor | monitor2, | ||
SearchMonitor | monitor3, | ||
SearchMonitor | monitor4 ) |
Definition at line 3504 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeSolveOnce | ( | DecisionBuilder | db, |
SearchMonitor[] | monitors ) |
Definition at line 3513 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSortingConstraint | ( | IntVar[] | vars, |
IntVar[] | sorted ) |
Creates a constraint binding the arrays of variables "vars" and
"sorted_vars": sorted_vars[0] must be equal to the minimum of all
variables in vars, and so on: the value of sorted_vars[i] must be
equal to the i-th value of variables invars.
This constraint propagates in both directions: from "vars" to
"sorted_vars" and vice-versa.
Behind the scenes, this constraint maintains that:
Definition at line 1882 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeSplitVariableDomain | ( | IntVar | var, |
long | val, | ||
boolean | start_with_lower_half ) |
Definition at line 3132 of file Solver.java.
expr * expr
Definition at line 950 of file Solver.java.
ModelVisitor com.google.ortools.constraintsolver.Solver.makeStatisticsModelVisitor | ( | ) |
Displays some nice statistics on the model.
Definition at line 3081 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.makeStoreAssignment | ( | Assignment | assignment | ) |
Returns a DecisionBuilder which stores an Assignment
(calls void Assignment::Store())
Definition at line 3598 of file Solver.java.
DisjunctiveConstraint com.google.ortools.constraintsolver.Solver.makeStrictDisjunctiveConstraint | ( | IntervalVar[] | intervals, |
String | name ) |
This constraint forces all interval vars into an non-overlapping
sequence. Intervals with zero durations cannot overlap with over
intervals.
Definition at line 2402 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSubCircuit | ( | IntVar[] | nexts | ) |
Force the "nexts" variable to create a complete Hamiltonian path
for those that do not loop upon themselves.
Definition at line 2022 of file Solver.java.
expr + value.
Definition at line 854 of file Solver.java.
left + right.
Definition at line 846 of file Solver.java.
sum of all vars.
Definition at line 862 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSumEquality | ( | IntVar[] | vars, |
IntVar | var ) |
Definition at line 1518 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSumEquality | ( | IntVar[] | vars, |
long | cst ) |
Definition at line 1513 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSumGreaterOrEqual | ( | IntVar[] | vars, |
long | cst ) |
Definition at line 1508 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeSumLessOrEqual | ( | IntVar[] | vars, |
long | cst ) |
Variation on arrays.
Definition at line 1503 of file Solver.java.
IntVarLocalSearchFilter com.google.ortools.constraintsolver.Solver.makeSumObjectiveFilter | ( | IntVar[] | vars, |
IntVar[] | secondary_vars, | ||
LongTernaryOperator | values, | ||
int | filter_enum ) |
Definition at line 3945 of file Solver.java.
IntVarLocalSearchFilter com.google.ortools.constraintsolver.Solver.makeSumObjectiveFilter | ( | IntVar[] | vars, |
LongBinaryOperator | values, | ||
int | filter_enum ) |
Definition at line 3940 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSymmetryManager | ( | SymmetryBreaker | v1 | ) |
Definition at line 3094 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSymmetryManager | ( | SymmetryBreaker | v1, |
SymmetryBreaker | v2 ) |
Definition at line 3099 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSymmetryManager | ( | SymmetryBreaker | v1, |
SymmetryBreaker | v2, | ||
SymmetryBreaker | v3 ) |
Definition at line 3104 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSymmetryManager | ( | SymmetryBreaker | v1, |
SymmetryBreaker | v2, | ||
SymmetryBreaker | v3, | ||
SymmetryBreaker | v4 ) |
Definition at line 3109 of file Solver.java.
SearchMonitor com.google.ortools.constraintsolver.Solver.makeSymmetryManager | ( | SymmetryBreaker[] | visitors | ) |
Symmetry Breaking.
Definition at line 3089 of file Solver.java.
ObjectiveMonitor com.google.ortools.constraintsolver.Solver.makeTabuSearch | ( | boolean | maximize, |
IntVar | objective, | ||
long | step, | ||
IntVar[] | vars, | ||
long | keep_tenure, | ||
long | forbid_tenure, | ||
double | tabu_factor ) |
MetaHeuristics which try to get the search out of local optima.
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:
Definition at line 2757 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeTemporalDisjunction | ( | IntervalVar | t1, |
IntervalVar | t2 ) |
This constraint implements a temporal disjunction between two
interval vars.
Definition at line 2383 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeTemporalDisjunction | ( | IntervalVar | t1, |
IntervalVar | t2, | ||
IntVar | alt ) |
This constraint implements a temporal disjunction between two
interval vars t1 and t2. 'alt' indicates which alternative was
chosen (alt == 0 is equivalent to t1 before t2).
Definition at line 2374 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeTimeLimit | ( | long | time_in_ms | ) |
Definition at line 2844 of file Solver.java.
RegularLimit com.google.ortools.constraintsolver.Solver.makeTimeLimit | ( | SWIGTYPE_p_absl__Duration | time | ) |
Creates a search limit that constrains the running time.
Definition at line 2839 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeTransitionConstraint | ( | IntVar[] | vars, |
IntTupleSet | transition_table, | ||
long | initial_state, | ||
int[] | final_states ) |
This constraint create a finite automaton that will check the
sequence of variables vars. It uses a transition table called
'transition_table'. 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.
Definition at line 2127 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeTransitionConstraint | ( | IntVar[] | vars, |
IntTupleSet | transition_table, | ||
long | initial_state, | ||
long[] | final_states ) |
This constraint create a finite automaton that will check the
sequence of variables vars. It uses a transition table called
'transition_table'. 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.
Definition at line 2113 of file Solver.java.
Constraint com.google.ortools.constraintsolver.Solver.makeTrueConstraint | ( | ) |
This constraint always succeeds.
Definition at line 1146 of file Solver.java.
LocalSearchFilter com.google.ortools.constraintsolver.Solver.makeVariableDomainFilter | ( | ) |
Definition at line 3935 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeVariableGreaterOrEqualValue | ( | IntVar | var, |
long | value ) |
Definition at line 3127 of file Solver.java.
Decision com.google.ortools.constraintsolver.Solver.makeVariableLessOrEqualValue | ( | IntVar | var, |
long | value ) |
Definition at line 3122 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedMaximize | ( | IntVar[] | sub_objectives, |
int[] | weights, | ||
long | step ) |
Creates a maximization weigthed objective.
Definition at line 2709 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedMaximize | ( | IntVar[] | sub_objectives, |
long[] | weights, | ||
long | step ) |
Creates a maximization weigthed objective.
Definition at line 2701 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedMinimize | ( | IntVar[] | sub_objectives, |
int[] | weights, | ||
long | step ) |
Creates a minimization weighted objective. The actual objective is
scalar_prod(sub_objectives, weights).
Definition at line 2693 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedMinimize | ( | IntVar[] | sub_objectives, |
long[] | weights, | ||
long | step ) |
Creates a minimization weighted objective. The actual objective is
scalar_prod(sub_objectives, weights).
Definition at line 2684 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedOptimize | ( | boolean | maximize, |
IntVar[] | sub_objectives, | ||
int[] | weights, | ||
long | step ) |
Creates a weighted objective with a given sense (true = maximization).
Definition at line 2725 of file Solver.java.
OptimizeVar com.google.ortools.constraintsolver.Solver.makeWeightedOptimize | ( | boolean | maximize, |
IntVar[] | sub_objectives, | ||
long[] | weights, | ||
long | step ) |
Creates a weighted objective with a given sense (true = maximization).
Definition at line 2717 of file Solver.java.
|
static |
Current memory usage in bytes
Definition at line 643 of file Solver.java.
String com.google.ortools.constraintsolver.Solver.model_name | ( | ) |
Returns the name of the model.
Definition at line 4178 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.MultiArmedBanditConcatenateOperators | ( | LocalSearchOperator[] | ops, |
double | memory_coefficient, | ||
double | exploration_coefficient, | ||
boolean | maximize ) |
Creates a local search operator which concatenates a vector of operators.
Uses Multi-Armed Bandit approach for choosing the next operator to use.
Sorts operators based on Upper Confidence Bound Algorithm which evaluates
each operator as sum of average improvement and exploration function.
Updates the order of operators when accepts a neighbor with objective
improvement.
Definition at line 3757 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.nameAllVariables | ( | ) |
Returns whether all variables should be named.
Definition at line 4171 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.neighbors | ( | ) |
The number of neighbors created.
Definition at line 693 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db | ) |
Definition at line 500 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db, |
SearchMonitor | m1 ) |
Definition at line 508 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2 ) |
Definition at line 516 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2, | ||
SearchMonitor | m3 ) |
Definition at line 524 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2, | ||
SearchMonitor | m3, | ||
SearchMonitor | m4 ) |
Definition at line 532 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.newSearch | ( | DecisionBuilder | db, |
SearchMonitor[] | monitors ) |
Decomposed search.
The code for a top level search should look like
solver->NewSearch(db);
while (solver->NextSolution()) {
.. use the current solution
}
solver()->EndSearch();
Definition at line 492 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.nextSolution | ( | ) |
Definition at line 540 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.optimization_direction | ( | ) |
The direction of optimization, getter and setter.
Definition at line 755 of file Solver.java.
com.google.ortools.constraintsolver.ConstraintSolverParameters com.google.ortools.constraintsolver.Solver.parameters | ( | ) |
Stored Parameters.
Definition at line 309 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.popState | ( | ) |
Definition at line 3976 of file Solver.java.
void com.google.ortools.constraintsolver.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 3972 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.rand32 | ( | int | size | ) |
Returns a random value between 0 and 'size' - 1;
Definition at line 4014 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.rand64 | ( | long | size | ) |
Returns a random value between 0 and 'size' - 1;
Definition at line 4007 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.randomConcatenateOperators | ( | LocalSearchOperator[] | ops | ) |
Randomized version of local search concatenator; calls a random operator
at each call to MakeNextNeighbor().
Definition at line 3733 of file Solver.java.
LocalSearchOperator com.google.ortools.constraintsolver.Solver.randomConcatenateOperators | ( | LocalSearchOperator[] | ops, |
int | seed ) |
Randomized version of local search concatenator; calls a random operator
at each call to MakeNextNeighbor(). The provided seed is used to
initialize the random number generator.
Definition at line 3743 of file Solver.java.
Adds a new demon and wraps it inside a DemonProfiler if necessary.
Definition at line 4102 of file Solver.java.
IntervalVar com.google.ortools.constraintsolver.Solver.registerIntervalVar | ( | IntervalVar | var | ) |
Registers a new IntervalVar and wraps it inside a TraceIntervalVar
if necessary.
Definition at line 4127 of file Solver.java.
Registers a new IntExpr and wraps it inside a TraceIntExpr if necessary.
Definition at line 4110 of file Solver.java.
Registers a new IntVar and wraps it inside a TraceIntVar if necessary.
Definition at line 4118 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.reSeed | ( | int | seed | ) |
Reseed the solver random generator.
Definition at line 4021 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.restartCurrentSearch | ( | ) |
Definition at line 4265 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.restartSearch | ( | ) |
Definition at line 544 of file Solver.java.
Assignment com.google.ortools.constraintsolver.Solver.RunUncheckedLocalSearch | ( | Assignment | initial_solution, |
LocalSearchFilterManager | filter_manager, | ||
LocalSearchOperator | ls_operator, | ||
SearchMonitor[] | monitors, | ||
RegularLimit | limit ) |
Experimental: runs a local search on the given initial solution, checking
the feasibility and the objective value of solutions using the filter
manager only (solutions are never restored in the CP world). Only greedy
descent is supported.
Definition at line 3852 of file Solver.java.
Assignment com.google.ortools.constraintsolver.Solver.RunUncheckedLocalSearch | ( | Assignment | initial_solution, |
LocalSearchFilterManager | filter_manager, | ||
LocalSearchOperator | ls_operator, | ||
SearchMonitor[] | monitors, | ||
RegularLimit | limit, | ||
SWIGTYPE_p_absl__flat_hash_setT_operations_research__IntVar_p_t | touched ) |
Experimental: runs a local search on the given initial solution, checking
the feasibility and the objective value of solutions using the filter
manager only (solutions are never restored in the CP world). Only greedy
descent is supported.
Definition at line 3841 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.searchDepth | ( | ) |
Gets the search depth of the current active search. Returns -1 if
there is no active search opened.
Definition at line 3984 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.searchLeftDepth | ( | ) |
Gets the search left depth of the current active search. Returns -1 if
there is no active search opened.
Definition at line 3992 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.set_context | ( | String | context | ) |
Sets the current context of the search.
Definition at line 741 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.set_optimization_direction | ( | int | direction | ) |
Definition at line 759 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.setTmpVector | ( | long[] | value | ) |
Unsafe temporary vector. It is used to avoid leaks in operations
that need storage and that may fail. See IntVar::SetValues() for
instance. It is not locked; do not use in a multi-threaded or reentrant
setup.
Definition at line 4235 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.SetUseFastLocalSearch | ( | boolean | use_fast_local_search | ) |
enabled for metaheuristics.
Disables/enables fast local search.
Definition at line 4081 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.shouldFail | ( | ) |
These methods are only useful for the SWIG wrappers, which need a way
to externally cause the Solver to fail.
Definition at line 4273 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.solutions | ( | ) |
The number of solutions found since the start of the search.
Definition at line 665 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db | ) |
Definition at line 441 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db, |
SearchMonitor | m1 ) |
Definition at line 449 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2 ) |
Definition at line 457 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2, | ||
SearchMonitor | m3 ) |
Definition at line 465 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2, | ||
SearchMonitor | m3, | ||
SearchMonitor | m4 ) |
Definition at line 473 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solve | ( | DecisionBuilder | db, |
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 nullptr. 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.
This function must be called either from outside of search,
or from within the Next() method of a decision builder.
Solve will terminate whenever any of the following event arise:
A search monitor asks the solver to terminate the search by calling
solver()->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 433 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solveAndCommit | ( | DecisionBuilder | db | ) |
Definition at line 571 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solveAndCommit | ( | DecisionBuilder | db, |
SearchMonitor | m1 ) |
Definition at line 579 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solveAndCommit | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2 ) |
Definition at line 587 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solveAndCommit | ( | DecisionBuilder | db, |
SearchMonitor | m1, | ||
SearchMonitor | m2, | ||
SearchMonitor | m3 ) |
Definition at line 595 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.solveAndCommit | ( | DecisionBuilder | db, |
SearchMonitor[] | monitors ) |
SolveAndCommit 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 difference between a SolveAndCommit() and a Solve() method
call is the fact that SolveAndCommit will not backtrack all
modifications at the end of the search. This method is only
usable during the Next() method of a decision builder.
Definition at line 563 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.solveDepth | ( | ) |
Gets the number of nested searches. It returns 0 outside search,
1 during the top level search, 2 or more in case of nested searches.
Definition at line 4000 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.stamp | ( | ) |
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 727 of file Solver.java.
int com.google.ortools.constraintsolver.Solver.state | ( | ) |
State of the solver.
Definition at line 622 of file Solver.java.
|
staticprotected |
Definition at line 89 of file Solver.java.
void com.google.ortools.constraintsolver.Solver.topPeriodicCheck | ( | ) |
Performs PeriodicCheck on the top-level search; for instance, can be
called from a nested solve to check top-level limits.
Definition at line 3954 of file Solver.java.
int com.google.ortools.constraintsolver.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 3963 of file Solver.java.
String com.google.ortools.constraintsolver.Solver.toString | ( | ) |
misc debug string.
Definition at line 636 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.tryDecisions | ( | DecisionBuilder | db1, |
DecisionBuilder | db2 ) |
Creates a decision builder which will create a search tree where each
decision builder is called from the top of the search tree. 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.
"Try"-builders "recursively". For instance, Try(a,b,c,d) will give a tree
unbalanced to the right, whereas Try(Try(a,b), Try(b,c)) will give a
balanced tree. Investigate if we should only provide the binary version
and/or if we should balance automatically.
Definition at line 3241 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.tryDecisions | ( | DecisionBuilder | db1, |
DecisionBuilder | db2, | ||
DecisionBuilder | db3 ) |
Definition at line 3251 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.tryDecisions | ( | DecisionBuilder | db1, |
DecisionBuilder | db2, | ||
DecisionBuilder | db3, | ||
DecisionBuilder | db4 ) |
Definition at line 3262 of file Solver.java.
DecisionBuilder com.google.ortools.constraintsolver.Solver.tryDecisions | ( | DecisionBuilder[] | dbs | ) |
Definition at line 3274 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.unchecked_solutions | ( | ) |
The number of unchecked solutions found by local search.
Definition at line 672 of file Solver.java.
boolean com.google.ortools.constraintsolver.Solver.UseFastLocalSearch | ( | ) |
Returns true if fast local search is enabled.
Definition at line 4088 of file Solver.java.
long com.google.ortools.constraintsolver.Solver.wallTime | ( | ) |
DEPRECATED: Use Now() instead.
Time elapsed, in ms since the creation of the solver.
Definition at line 651 of file Solver.java.
|
static |
Selects the first possible value which is the closest to the center
of the domain of the selected variable.
The center is defined as (min + max) / 2.
Definition at line 4425 of file Solver.java.
|
static |
Selects the max value of the selected variable.
Definition at line 4415 of file Solver.java.
|
static |
Selects the min value of the selected variable.
Definition at line 4411 of file Solver.java.
|
static |
Selects randomly one of the possible values of the selected variable.
Definition at line 4419 of file Solver.java.
|
static |
After successful NextSolution and before EndSearch.
Definition at line 4889 of file Solver.java.
|
static |
STARTS_AFTER or ENDS_BEFORE, i.e. d is not in t.
t starts after d, i.e. Start(t) >= d.
t ends before d, i.e. End(t) <= d.
Definition at line 4819 of file Solver.java.
|
static |
Definition at line 4866 of file Solver.java.
|
static |
Pairs are compared each time a variable is selected. That way all pairs
are relevant and evaluation is accurate.
This strategy runs in O(number-of-pairs) at each variable selection,
versus O(1) in the static version.
Definition at line 4464 of file Solver.java.
|
static |
Select the first unbound variable.
Variables are considered in the order of the vector of IntVars used
to create the selector.
Definition at line 4316 of file Solver.java.
|
static |
Among unbound variables, select the variable with the highest maximal
value.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4370 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest minimal
value.
In case of a tie, the first one is selected, "first" defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4363 of file Solver.java.
|
static |
Among unbound variables, select the variable with the largest
gap between the first and the second values of the domain.
Definition at line 4387 of file Solver.java.
|
static |
Among unbound variables, select the variable with the highest size.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4382 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest size.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4376 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest size,
i.e., the smallest number of possible values.
In case of a tie, the selected variable is the one with the highest max
value.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4356 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest size,
i.e., the smallest number of possible values.
In case of a tie, the selected variable is the one with the highest min
value.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4338 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest size,
i.e., the smallest number of possible values.
In case of a tie, the selected variables is the one with the lowest max
value.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4347 of file Solver.java.
|
static |
Among unbound variables, select the variable with the smallest size,
i.e., the smallest number of possible values.
In case of a tie, the selected variables is the one with the lowest min
value.
In case of a tie, the first one is selected, first being defined by the
order in the vector of IntVars used to create the selector.
Definition at line 4329 of file Solver.java.
|
static |
Definition at line 4473 of file Solver.java.
|
static |
Selects the next unbound variable on a path, the path being defined by
the variables: var[i] corresponds to the index of the next of i.
Definition at line 4392 of file Solver.java.
|
static |
Randomly select one of the remaining unbound variables.
Definition at line 4320 of file Solver.java.
|
static |
Definition at line 4474 of file Solver.java.
|
static |
EvaluatorStrategy.
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. Pairs are compared at the first call of the selector, and results are
cached. Next calls to the selector use the previous computation, and so
are not up-to-date, e.g. some <variable, value> pairs may not be
possible anymore due to propagation since the first to call.
Definition at line 4457 of file Solver.java.
|
static |
Operator which cross exchanges the starting chains of 2 paths, including
exchanging the whole paths.
First and last nodes are not moved.
Possible neighbors for the paths 1 -> 2 -> 3 -> 4 -> 5 and 6 -> 7 -> 8
(where (1, 5) and (6, 8) are first and last nodes of the paths and can
therefore not be moved):
1 -> [7] -> 3 -> 4 -> 5 6 -> [2] -> 8
1 -> [7] -> 4 -> 5 6 -> [2 -> 3] -> 8
1 -> [7] -> 5 6 -> [2 -> 3 -> 4] -> 8
Definition at line 4561 of file Solver.java.
|
static |
STARTS_BEFORE and ENDS_AFTER at the same time, i.e. d is in t.
t starts before d, i.e. Start(t) <= d.
t ends after d, i.e. End(t) >= d.
Definition at line 4813 of file Solver.java.
|
static |
Operator which defines a neighborhood to decrement values.
The behavior is the same as INCREMENT, except values are decremented
instead of incremented.
Definition at line 4646 of file Solver.java.
|
static |
DemonPriority.
This enum represents the three possible priorities for a demon in the
Solver queue.
Note: this is for advanced users only. DELAYED_PRIORITY is the lowest priority: Demons will be processed after
VAR_PRIORITY and NORMAL_PRIORITY demons.
Definition at line 4723 of file Solver.java.
|
static |
UnaryIntervalRelation.
This enum is used in Solver::MakeIntervalVarRelation to specify the
temporal relation between an interval t and an integer d. t ends after d, i.e. End(t) >= d.
Definition at line 4787 of file Solver.java.
|
static |
BinaryIntervalRelation.
This enum is used in Solver::MakeIntervalVarRelation to specify the
temporal relation between the two intervals t1 and t2. t1 ends after t2 end, i.e. End(t1) >= End(t2) + delay.
Definition at line 4742 of file Solver.java.
|
static |
t1 ends after t2 start, i.e. End(t1) >= Start(t2) + delay.
Definition at line 4746 of file Solver.java.
|
static |
t ends at d, i.e. End(t) == d.
Definition at line 4791 of file Solver.java.
|
static |
t1 ends at t2 end, i.e. End(t1) == End(t2) + delay.
Definition at line 4750 of file Solver.java.
|
static |
t1 ends at t2 start, i.e. End(t1) == Start(t2) + delay.
Definition at line 4754 of file Solver.java.
|
static |
t ends before d, i.e. End(t) <= d.
Definition at line 4795 of file Solver.java.
|
static |
Move is accepted when the current objective value is in the interval
objective.Min .. objective.Max.
Definition at line 4710 of file Solver.java.
|
static |
Operator which exchanges the positions of two nodes.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5
(where (1, 5) are first and last nodes of the path and can therefore not
be moved):
1 -> [3] -> [2] -> 4 -> 5
1 -> [4] -> 3 -> [2] -> 5
1 -> 2 -> [4] -> [3] -> 5
Definition at line 4549 of file Solver.java.
|
static |
Operator which makes an inactive node active and an active one inactive.
It is similar to SwapActiveOperator except that it tries to insert the
inactive node in all possible positions instead of just the position of
the node made inactive.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
(where 1 and 4 are first and last nodes of the path) are:
1 -> [5] -> 3 -> 4 with 2 inactive
1 -> 3 -> [5] -> 4 with 2 inactive
1 -> [5] -> 2 -> 4 with 3 inactive
1 -> 2 -> [5] -> 4 with 3 inactive
Definition at line 4608 of file Solver.java.
|
static |
Operator which relaxes one entire path and all inactive nodes, thus
defining num_paths neighbors.
Definition at line 4623 of file Solver.java.
|
static |
LocalSearchFilterBound.
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. Move is accepted when the current objective value >= objective.Min.
Definition at line 4701 of file Solver.java.
|
static |
Executing the root node.
Definition at line 4881 of file Solver.java.
|
static |
Executing the search code.
Definition at line 4885 of file Solver.java.
|
static |
Operator which defines one neighbor per variable. Each neighbor tries to
increment by one the value of the corresponding variable. When a new
solution is found the neighborhood is rebuilt from scratch, i.e., tries
to increment values in the variable order.
Consider for instance variables x and y. x is incremented one by one to
its max, and when it is not possible to increment x anymore, y is
incremented once. If this is a solution, then next neighbor tries to
increment x.
Definition at line 4640 of file Solver.java.
|
static |
IntValueStrategy.
This enum describes the strategy used to select the next variable value to
set. The default behavior is ASSIGN_MIN_VALUE.
Definition at line 4403 of file Solver.java.
|
static |
The simple selection is ASSIGN_MIN_VALUE.
Definition at line 4407 of file Solver.java.
|
static |
IntVarStrategy.
This enum describes the strategy used to select the next branching
variable at each node during the search. The default behavior is CHOOSE_FIRST_UNBOUND.
Definition at line 4306 of file Solver.java.
|
static |
The simple selection is CHOOSE_FIRST_UNBOUND.
Definition at line 4310 of file Solver.java.
|
static |
IntervalStrategy.
This enum describes the straregy used to select the next interval variable
and its value to be fixed. The default is INTERVAL_SET_TIMES_FORWARD.
Definition at line 4485 of file Solver.java.
|
static |
Selects the variable with the highest ending time of all variables,
and fixes the ending time to this highest values.
Definition at line 4499 of file Solver.java.
|
static |
Selects the variable with the lowest starting time of all variables,
and fixes its starting time to this lowest value.
Definition at line 4494 of file Solver.java.
|
static |
The simple is INTERVAL_SET_TIMES_FORWARD.
Definition at line 4489 of file Solver.java.
|
static |
Right branches are ignored. This is used to make the code faster when
backtrack makes no sense or is not useful.
This is faster as there is no need to create one new node per decision.
Definition at line 4840 of file Solver.java.
|
static |
Left branches are ignored. This is used to make the code faster when
backtrack makes no sense or is not useful.
This is faster as there is no need to create one new node per decision.
Definition at line 4846 of file Solver.java.
|
static |
Backtracks to the previous decisions, i.e. left and right branches are
not applied.
Definition at line 4851 of file Solver.java.
|
static |
Number of priorities for demons.
Definition at line 4296 of file Solver.java.
|
static |
Move is accepted when the current objective value <= objective.Max.
Definition at line 4705 of file Solver.java.
|
static |
EvaluatorLocalSearchOperators.
This enum is used in Solver::MakeOperator associated with an evaluator
to specify the neighborhood to create. Lin-Kernighan local search.
While the accumulated local gain is positive, perform a 2opt or a 3opt
move followed by a series of 2opt moves. Return a neighbor for which the
global gain is positive.
Definition at line 4670 of file Solver.java.
|
static |
Operator which inserts an inactive node into a path.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
(where 1 and 4 are first and last nodes of the path) are:
1 -> [5] -> 2 -> 3 -> 4
1 -> 2 -> [5] -> 3 -> 4
1 -> 2 -> 3 -> [5] -> 4
Definition at line 4570 of file Solver.java.
|
static |
Operator which makes a "chain" of path nodes inactive.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are
first and last nodes of the path) are:
1 -> 3 -> 4 with 2 inactive
1 -> 2 -> 4 with 3 inactive
1 -> 4 with 2 and 3 inactive
Definition at line 4587 of file Solver.java.
|
static |
Operator which makes path nodes inactive.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 (where 1 and 4 are
first and last nodes of the path) are:
1 -> 3 -> 4 with 2 inactive
1 -> 2 -> 4 with 3 inactive
Definition at line 4578 of file Solver.java.
|
static |
Definition at line 4905 of file Solver.java.
|
static |
Definition at line 4906 of file Solver.java.
|
static |
DecisionModification.
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. Keeps the default behavior, i.e. apply left branch first, and then right
branch in case of backtracking.
Definition at line 4834 of file Solver.java.
|
static |
After failed NextSolution and before EndSearch.
Definition at line 4893 of file Solver.java.
|
static |
NORMAL_PRIORITY is the highest priority: Demons will be processed first.
Definition at line 4731 of file Solver.java.
|
static |
|
static |
Relocate: OROPT and RELOCATE.
Operator which moves a sub-chain of a path to another position; the
specified chain length is the fixed length of the chains being moved.
When this length is 1, the operator simply moves a node to another
position.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5, for a chain
length of 2 (where (1, 5) are first and last nodes of the path and can
therefore not be moved):
1 -> 4 -> [2 -> 3] -> 5
1 -> [3 -> 4] -> 2 -> 5
Using Relocate with chain lengths of 1, 2 and 3 together is equivalent
to the OrOpt operator on a path. The OrOpt operator is a limited
version of 3Opt (breaks 3 arcs on a path).
Definition at line 4535 of file Solver.java.
|
static |
SolverState.
This enum represents the state of the solver w.r.t. the search. Before search, after search.
Definition at line 4877 of file Solver.java.
|
static |
Operator which relaxes two sub-chains of three consecutive arcs each.
Each sub-chain is defined by a start node and the next three arcs. Those
six arcs are relaxed to build a new neighbor.
PATHLNS explores all possible pairs of starting nodes and so defines
n^2 neighbors, n being the number of nodes.
Note that the two sub-chains can be part of the same path; they even may
overlap.
Definition at line 4618 of file Solver.java.
|
static |
After search, the model is infeasible.
Definition at line 4897 of file Solver.java.
|
static |
Relocate neighborhood with length of 1 (see OROPT comment).
Definition at line 4539 of file Solver.java.
|
static |
Definition at line 4867 of file Solver.java.
|
static |
MarkerType.
This enum is used internally in private methods Solver::PushState and
Solver::PopState to tag states in the search tree.
Definition at line 4864 of file Solver.java.
|
static |
SequenceStrategy.
Used for scheduling. Not yet implemented.
Definition at line 4471 of file Solver.java.
|
static |
Definition at line 4472 of file Solver.java.
|
static |
Definition at line 4865 of file Solver.java.
|
static |
Operator which defines one neighbor per variable. Each neighbor relaxes
one variable.
When a new solution is found the neighborhood is rebuilt from scratch.
Consider for instance variables x and y. First x is relaxed and the
solver is looking for the best possible solution (with only x relaxed).
Then y is relaxed, and the solver is looking for a new solution.
If a new solution is found, then the next variable to be relaxed is x.
Definition at line 4656 of file Solver.java.
|
static |
Split the domain in two around the center, and choose the lower
part first.
Definition at line 4430 of file Solver.java.
|
static |
Split the domain in two around the center, and choose the lower
part first.
Definition at line 4435 of file Solver.java.
|
static |
t starts after d, i.e. Start(t) >= d.
Definition at line 4799 of file Solver.java.
|
static |
t1 starts after t2 end, i.e. Start(t1) >= End(t2) + delay.
Definition at line 4758 of file Solver.java.
|
static |
t1 starts after t2 start, i.e. Start(t1) >= Start(t2) + delay.
Definition at line 4762 of file Solver.java.
|
static |
t starts at d, i.e. Start(t) == d.
Definition at line 4803 of file Solver.java.
|
static |
t1 starts at t2 end, i.e. Start(t1) == End(t2) + delay.
Definition at line 4766 of file Solver.java.
|
static |
t1 starts at t2 start, i.e. Start(t1) == Start(t2) + delay.
Definition at line 4770 of file Solver.java.
|
static |
t starts before d, i.e. Start(t) <= d.
Definition at line 4807 of file Solver.java.
|
static |
STARTS_AT_START and ENDS_AT_END at the same time.
t1 starts at t2 start, i.e. Start(t1) == Start(t2) + delay.
t1 ends at t2 end, i.e. End(t1) == End(t2).
Definition at line 4776 of file Solver.java.
|
static |
Operator which replaces an active node by an inactive one.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 with 5 inactive
(where 1 and 4 are first and last nodes of the path) are:
1 -> [5] -> 3 -> 4 with 2 inactive
1 -> 2 -> [5] -> 4 with 3 inactive
Definition at line 4595 of file Solver.java.
|
protected |
Definition at line 78 of file Solver.java.
|
static |
Applies right branch first. Left branch will be applied in case of
backtracking.
Definition at line 4856 of file Solver.java.
|
static |
TSP-base LNS.
Randomly merge consecutive nodes until n "meta"-nodes remain and solve
the corresponding TSP.
This is an "unlimited" neighborhood which must be stopped by search
limits. To force diversification, the operator iteratively forces each
node to serve as base of a meta-node.
Definition at line 4688 of file Solver.java.
|
static |
Sliding TSP operator.
Uses an exact dynamic programming algorithm to solve the TSP
corresponding to path sub-chains.
For a subchain 1 -> 2 -> 3 -> 4 -> 5 -> 6, solves the TSP on
nodes A, 2, 3, 4, 5, where A is a merger of nodes 1 and 6 such that
cost(A,i) = cost(1,i) and cost(i,A) = cost(i,6).
Definition at line 4679 of file Solver.java.
|
static |
LocalSearchOperators.
This enum is used in Solver::MakeOperator to specify the neighborhood to
create. Operator which reverses a sub-chain of a path. It is called TwoOpt
because it breaks two arcs on the path; resulting paths are called
two-optimal.
Possible neighbors for the path 1 -> 2 -> 3 -> 4 -> 5
(where (1, 5) are first and last nodes of the path and can therefore not
be moved):
1 -> [3 -> 2] -> 4 -> 5
1 -> [4 -> 3 -> 2] -> 5
1 -> 2 -> [4 -> 3] -> 5
Definition at line 4518 of file Solver.java.
|
static |
Operator which relaxes all inactive nodes and one sub-chain of six
consecutive arcs. That way the path can be improved by inserting
inactive nodes or swapping arcs.
Definition at line 4629 of file Solver.java.
|
static |
VAR_PRIORITY is between DELAYED_PRIORITY and NORMAL_PRIORITY.
Definition at line 4727 of file Solver.java.