![]() |
Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
|
A container that allows to accumulate variables and weights to generate a static DecisionBuilder that uses weights to prioritize the branching decisions (by decreasing weight).
Definition at line 70 of file routing_decision_builders.h.
#include <routing_decision_builders.h>
Public Member Functions | |
| FinalizerVariables (Solver *solver) | |
| void | AddVariableTarget (IntVar *var, int64_t target) |
| void | AddWeightedVariableTarget (IntVar *var, int64_t target, int64_t cost) |
| DecisionBuilder * | CreateFinalizer () |
|
inlineexplicit |
Definition at line 72 of file routing_decision_builders.h.
| void operations_research::FinalizerVariables::AddVariableTarget | ( | IntVar * | var, |
| int64_t | target ) |
Add a variable to set the closest possible to the target value in the solution finalizer. The solution finalizer is called each time a solution is found during the search and allows to instantiate secondary variables (such as dimension cumul variables).
Definition at line 915 of file routing_decision_builders.cc.
| void operations_research::FinalizerVariables::AddWeightedVariableTarget | ( | IntVar * | var, |
| int64_t | target, | ||
| int64_t | cost ) |
Same as above with a weighted priority: the higher the cost, the more priority it has to be set close to the target value.
Definition at line 897 of file routing_decision_builders.cc.
| DecisionBuilder * operations_research::FinalizerVariables::CreateFinalizer | ( | ) |
Returns a DecisionBuilder* that sets the variables passed through AddVariableTarget and AddWeightedVariableTarget towards their target, setting weigthed variables by decreasing weight first, then unweighted variables in the order they were added.
Definition at line 922 of file routing_decision_builders.cc.