public class RoutingDimension
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
swigCMemOwn |
Constructor and Description |
---|
RoutingDimension(long cPtr,
boolean cMemoryOwn) |
Modifier and Type | Method and Description |
---|---|
void |
addNodePrecedence(long first_node,
long second_node,
long offset) |
RoutingDimension |
base_dimension()
Returns the parent in the dependency tree if any or nullptr otherwise.
|
IntVar[] |
cumuls()
Like CumulVar(), TransitVar(), SlackVar() but return the whole variable
vectors instead (indexed by int64_t var index). |
IntVar |
cumulVar(long index)
Get the cumul, transit and slack variables for the given node (given as
int64_t var index). |
void |
delete() |
protected void |
finalize() |
IntVar[] |
fixed_transits() |
IntVar |
fixedTransitVar(long index) |
IntervalVar[] |
getBreakIntervalsOfVehicle(int vehicle)
Returns the break intervals set by SetBreakIntervalsOfVehicle().
|
static long |
getCPtr(RoutingDimension obj) |
long |
GetCumulVarMax(long index)
Gets the current maximum of the cumul variable associated to index.
|
long |
GetCumulVarMin(long index)
Gets the current minimum of the cumul variable associated to index.
|
long |
getCumulVarSoftLowerBound(long index)
Returns the soft lower bound of a cumul variable for a given variable
index. |
long |
getCumulVarSoftLowerBoundCoefficient(long index)
Returns the cost coefficient of the soft lower bound of a cumul variable
for a given variable index. |
long |
getCumulVarSoftUpperBound(long index)
Returns the soft upper bound of a cumul variable for a given variable
index. |
long |
getCumulVarSoftUpperBoundCoefficient(long index)
Returns the cost coefficient of the soft upper bound of a cumul variable
for a given variable index. |
long |
GetGlobalOptimizerOffset() |
long |
getGlobalSpanCostCoefficient() |
long |
getLocalOptimizerOffsetForVehicle(int vehicle) |
int |
GetPostTravelEvaluatorOfVehicle(int vehicle) |
int |
GetPreTravelEvaluatorOfVehicle(int vehicle) |
BoundCost |
getQuadraticCostSoftSpanUpperBoundForVehicle(int vehicle) |
long |
GetSlackCostCoefficientForVehicle(int vehicle) |
BoundCost |
getSoftSpanUpperBoundForVehicle(int vehicle) |
long |
getSpanCostCoefficientForVehicle(int vehicle) |
long |
getSpanUpperBoundForVehicle(int vehicle) |
long |
getTransitValue(long from_index,
long to_index,
long vehicle)
Returns the transition value for a given pair of nodes (as var index);
this value is the one taken by the corresponding transit variable when the 'next' variable for 'from_index' is bound to 'to_index'. |
long |
getTransitValueFromClass(long from_index,
long to_index,
long vehicle_class)
Same as above but taking a vehicle class of the dimension instead of a
vehicle (the class of a vehicle can be obtained with vehicle_to_class()). |
boolean |
HasBreakConstraints()
Returns true if any break interval or break distance was defined.
|
boolean |
hasCumulVarSoftLowerBound(long index)
Returns true if a soft lower bound has been set for a given variable
index. |
boolean |
hasCumulVarSoftUpperBound(long index)
Returns true if a soft upper bound has been set for a given variable
index. |
boolean |
hasPickupToDeliveryLimits() |
boolean |
hasQuadraticCostSoftSpanUpperBounds() |
boolean |
hasSoftSpanUpperBounds() |
void |
InitializeBreaks()
Sets up vehicle_break_intervals_, vehicle_break_distance_duration_,
pre_travel_evaluators and post_travel_evaluators. |
RoutingModel |
model()
Returns the model on which the dimension was created.
|
java.lang.String |
name()
Returns the name of the dimension.
|
void |
setBreakDistanceDurationOfVehicle(long distance,
long duration,
int vehicle)
With breaks supposed to be consecutive, this forces the distance between
breaks of size at least minimum_break_duration to be at most distance. |
void |
setBreakIntervalsOfVehicle(IntervalVar[] breaks,
int vehicle,
int pre_travel_evaluator,
int post_travel_evaluator)
Sets the breaks for a given vehicle.
|
void |
setBreakIntervalsOfVehicle(IntervalVar[] breaks,
int vehicle,
long[] node_visit_transits)
Deprecated, sets pre_travel(i, j) = node_visit_transit[i].
|
void |
setBreakIntervalsOfVehicle(IntervalVar[] breaks,
int vehicle,
long[] node_visit_transits,
java.util.function.LongBinaryOperator delays)
Deprecated, sets pre_travel(i, j) = node_visit_transit[i]
and post_travel(i, j) = delays(i, j). |
void |
SetCumulVarRange(long index,
long min,
long max)
Some functions to allow users to use the interface without knowing about
the underlying CP model. |
void |
setCumulVarSoftLowerBound(long index,
long lower_bound,
long coefficient)
Sets a soft lower bound to the cumul variable of a given variable index.
|
void |
setCumulVarSoftUpperBound(long index,
long upper_bound,
long coefficient)
Sets a soft upper bound to the cumul variable of a given variable index.
|
void |
setGlobalSpanCostCoefficient(long coefficient)
Sets a cost proportional to the *global* dimension span, that is the
difference between the largest value of route end cumul variables and the smallest value of route start cumul variables. |
void |
setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function,
int pair_index) |
void |
setQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost,
int vehicle)
If the span of vehicle on this dimension is larger than bound,
the cost will be increased by cost * (span - bound)^2. |
void |
SetSlackCostCoefficientForAllVehicles(long coefficient) |
void |
SetSlackCostCoefficientForVehicle(long coefficient,
int vehicle)
Sets a cost proportional to the dimension total slack on a given vehicle,
or on all vehicles at once. |
void |
setSoftSpanUpperBoundForVehicle(BoundCost bound_cost,
int vehicle)
If the span of vehicle on this dimension is larger than bound,
the cost will be increased by cost * (span - bound). |
void |
setSpanCostCoefficientForAllVehicles(long coefficient) |
void |
setSpanCostCoefficientForVehicle(long coefficient,
int vehicle)
Sets a cost proportional to the dimension span on a given vehicle,
or on all vehicles at once. |
void |
setSpanUpperBoundForVehicle(long upper_bound,
int vehicle)
Sets an upper bound on the dimension span on a given vehicle.
|
long |
shortestTransitionSlack(long node)
It makes sense to use the function only for self-dependent dimension.
|
IntVar[] |
slacks() |
IntVar |
slackVar(long index) |
static long |
swigRelease(RoutingDimension obj) |
IntVar[] |
transits() |
IntVar |
transitVar(long index) |
public static long getCPtr(RoutingDimension obj)
public static long swigRelease(RoutingDimension obj)
protected void finalize()
finalize
in class java.lang.Object
public void delete()
public RoutingModel model()
public long getTransitValue(long from_index, long to_index, long vehicle)
public long getTransitValueFromClass(long from_index, long to_index, long vehicle_class)
public IntVar cumulVar(long index)
public IntVar transitVar(long index)
public IntVar fixedTransitVar(long index)
public IntVar slackVar(long index)
public void SetCumulVarRange(long index, long min, long max)
public long GetCumulVarMin(long index)
public long GetCumulVarMax(long index)
public IntVar[] cumuls()
public IntVar[] fixed_transits()
public IntVar[] transits()
public IntVar[] slacks()
public void setSpanUpperBoundForVehicle(long upper_bound, int vehicle)
public void setSpanCostCoefficientForVehicle(long coefficient, int vehicle)
public void setSpanCostCoefficientForAllVehicles(long coefficient)
public void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle)
public void SetSlackCostCoefficientForAllVehicles(long coefficient)
public void setGlobalSpanCostCoefficient(long coefficient)
public void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient)
public boolean hasCumulVarSoftUpperBound(long index)
public long getCumulVarSoftUpperBound(long index)
public long getCumulVarSoftUpperBoundCoefficient(long index)
public void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient)
public boolean hasCumulVarSoftLowerBound(long index)
public long getCumulVarSoftLowerBound(long index)
public long getCumulVarSoftLowerBoundCoefficient(long index)
public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator)
public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits)
public void setBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle)
public void InitializeBreaks()
public boolean HasBreakConstraints()
public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, java.util.function.LongBinaryOperator delays)
public IntervalVar[] getBreakIntervalsOfVehicle(int vehicle)
public int GetPreTravelEvaluatorOfVehicle(int vehicle)
public int GetPostTravelEvaluatorOfVehicle(int vehicle)
public RoutingDimension base_dimension()
public long shortestTransitionSlack(long node)
public java.lang.String name()
public void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index)
public boolean hasPickupToDeliveryLimits()
public void addNodePrecedence(long first_node, long second_node, long offset)
public long getSpanUpperBoundForVehicle(int vehicle)
public long getSpanCostCoefficientForVehicle(int vehicle)
public long GetSlackCostCoefficientForVehicle(int vehicle)
public long getGlobalSpanCostCoefficient()
public long GetGlobalOptimizerOffset()
public long getLocalOptimizerOffsetForVehicle(int vehicle)
public void setSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
public boolean hasSoftSpanUpperBounds()
public BoundCost getSoftSpanUpperBoundForVehicle(int vehicle)
public void setQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
public boolean hasQuadraticCostSoftSpanUpperBounds()
public BoundCost getQuadraticCostSoftSpanUpperBoundForVehicle(int vehicle)
Copyright © 2025. All rights reserved.