Google OR-Tools v9.12
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingDimension.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.3.0
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.constraintsolver;
10
11// Types from ConstraintSolver
12import com.google.ortools.constraintsolver.IntVar;
13import com.google.ortools.constraintsolver.IntervalVar;
14import com.google.ortools.constraintsolver.LocalSearchOperator;
15// Used to wrap std::function<int64_t(int, int)>
16// note: Java does not provide it, so we provide it.
17import com.google.ortools.constraintsolver.IntIntToLongFunction;
18// Used to wrap std::function<int64_t(int64_t from_index, int64_t to_index)> group_delay
19// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
20import java.util.function.LongBinaryOperator;
21
43public class RoutingDimension {
44 private transient long swigCPtr;
45 protected transient boolean swigCMemOwn;
46
47 public RoutingDimension(long cPtr, boolean cMemoryOwn) {
48 swigCMemOwn = cMemoryOwn;
49 swigCPtr = cPtr;
50 }
51
52 public static long getCPtr(RoutingDimension obj) {
53 return (obj == null) ? 0 : obj.swigCPtr;
54 }
55
56 public static long swigRelease(RoutingDimension obj) {
57 long ptr = 0;
58 if (obj != null) {
59 if (!obj.swigCMemOwn)
60 throw new RuntimeException("Cannot release ownership as memory is not owned");
61 ptr = obj.swigCPtr;
62 obj.swigCMemOwn = false;
63 obj.delete();
64 }
65 return ptr;
66 }
67
68 @SuppressWarnings({"deprecation", "removal"})
69 protected void finalize() {
70 delete();
71 }
72
73 public synchronized void delete() {
74 if (swigCPtr != 0) {
75 if (swigCMemOwn) {
76 swigCMemOwn = false;
77 mainJNI.delete_RoutingDimension(swigCPtr);
78 }
79 swigCPtr = 0;
80 }
81 }
82
87 long cPtr = mainJNI.RoutingDimension_model(swigCPtr, this);
88 return (cPtr == 0) ? null : new RoutingModel(cPtr, false);
89 }
90
96 public long getTransitValue(long from_index, long to_index, long vehicle) {
97 return mainJNI.RoutingDimension_getTransitValue(swigCPtr, this, from_index, to_index, vehicle);
98 }
99
104 public long getTransitValueFromClass(long from_index, long to_index, long vehicle_class) {
105 return mainJNI.RoutingDimension_getTransitValueFromClass(swigCPtr, this, from_index, to_index, vehicle_class);
106 }
107
112 public IntVar cumulVar(long index) {
113 long cPtr = mainJNI.RoutingDimension_cumulVar(swigCPtr, this, index);
114 return (cPtr == 0) ? null : new IntVar(cPtr, false);
115 }
116
117 public IntVar transitVar(long index) {
118 long cPtr = mainJNI.RoutingDimension_transitVar(swigCPtr, this, index);
119 return (cPtr == 0) ? null : new IntVar(cPtr, false);
120 }
121
122 public IntVar fixedTransitVar(long index) {
123 long cPtr = mainJNI.RoutingDimension_fixedTransitVar(swigCPtr, this, index);
124 return (cPtr == 0) ? null : new IntVar(cPtr, false);
125 }
126
127 public IntVar slackVar(long index) {
128 long cPtr = mainJNI.RoutingDimension_slackVar(swigCPtr, this, index);
129 return (cPtr == 0) ? null : new IntVar(cPtr, false);
130 }
131
137 public void SetCumulVarRange(long index, long min, long max) {
138 mainJNI.RoutingDimension_SetCumulVarRange(swigCPtr, this, index, min, max);
139 }
140
144 public long GetCumulVarMin(long index) {
145 return mainJNI.RoutingDimension_GetCumulVarMin(swigCPtr, this, index);
146 }
147
151 public long GetCumulVarMax(long index) {
152 return mainJNI.RoutingDimension_GetCumulVarMax(swigCPtr, this, index);
153 }
154
159 public IntVar[] cumuls() {
160 return mainJNI.RoutingDimension_cumuls(swigCPtr, this);
161}
162
164 return mainJNI.RoutingDimension_fixed_transits(swigCPtr, this);
165}
166
167 public IntVar[] transits() {
168 return mainJNI.RoutingDimension_transits(swigCPtr, this);
169}
170
171 public IntVar[] slacks() {
172 return mainJNI.RoutingDimension_slacks(swigCPtr, this);
173}
174
180 public void setSpanUpperBoundForVehicle(long upper_bound, int vehicle) {
181 mainJNI.RoutingDimension_setSpanUpperBoundForVehicle(swigCPtr, this, upper_bound, vehicle);
182 }
183
192 public void setSpanCostCoefficientForVehicle(long coefficient, int vehicle) {
193 mainJNI.RoutingDimension_setSpanCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
194 }
195
196 public void setSpanCostCoefficientForAllVehicles(long coefficient) {
197 mainJNI.RoutingDimension_setSpanCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
198 }
199
209 public void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle) {
210 mainJNI.RoutingDimension_SetSlackCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
211 }
212
213 public void SetSlackCostCoefficientForAllVehicles(long coefficient) {
214 mainJNI.RoutingDimension_SetSlackCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
215 }
216
225 public void setGlobalSpanCostCoefficient(long coefficient) {
226 mainJNI.RoutingDimension_setGlobalSpanCostCoefficient(swigCPtr, this, coefficient);
227 }
228
239 public void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient) {
240 mainJNI.RoutingDimension_setCumulVarSoftUpperBound(swigCPtr, this, index, upper_bound, coefficient);
241 }
242
247 public boolean hasCumulVarSoftUpperBound(long index) {
248 return mainJNI.RoutingDimension_hasCumulVarSoftUpperBound(swigCPtr, this, index);
249 }
250
256 public long getCumulVarSoftUpperBound(long index) {
257 return mainJNI.RoutingDimension_getCumulVarSoftUpperBound(swigCPtr, this, index);
258 }
259
265 public long getCumulVarSoftUpperBoundCoefficient(long index) {
266 return mainJNI.RoutingDimension_getCumulVarSoftUpperBoundCoefficient(swigCPtr, this, index);
267 }
268
280 public void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient) {
281 mainJNI.RoutingDimension_setCumulVarSoftLowerBound(swigCPtr, this, index, lower_bound, coefficient);
282 }
283
288 public boolean hasCumulVarSoftLowerBound(long index) {
289 return mainJNI.RoutingDimension_hasCumulVarSoftLowerBound(swigCPtr, this, index);
290 }
291
297 public long getCumulVarSoftLowerBound(long index) {
298 return mainJNI.RoutingDimension_getCumulVarSoftLowerBound(swigCPtr, this, index);
299 }
300
306 public long getCumulVarSoftLowerBoundCoefficient(long index) {
307 return mainJNI.RoutingDimension_getCumulVarSoftLowerBoundCoefficient(swigCPtr, this, index);
308 }
309
327 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator) {
328 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_0(swigCPtr, this, breaks, vehicle, pre_travel_evaluator, post_travel_evaluator);
329 }
330
334 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits) {
335 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_1(swigCPtr, this, breaks, vehicle, node_visit_transits);
336 }
337
344 public void setBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle) {
345 mainJNI.RoutingDimension_setBreakDistanceDurationOfVehicle(swigCPtr, this, distance, duration, vehicle);
346 }
347
352 public void InitializeBreaks() {
353 mainJNI.RoutingDimension_InitializeBreaks(swigCPtr, this);
354 }
355
359 public boolean HasBreakConstraints() {
360 return mainJNI.RoutingDimension_HasBreakConstraints(swigCPtr, this);
361 }
362
367 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator delays) {
368 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_2(swigCPtr, this, breaks, vehicle, node_visit_transits, delays);
369 }
370
375 return mainJNI.RoutingDimension_getBreakIntervalsOfVehicle(swigCPtr, this, vehicle);
376}
377
378 public int GetPreTravelEvaluatorOfVehicle(int vehicle) {
379 return mainJNI.RoutingDimension_GetPreTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
380 }
381
382 public int GetPostTravelEvaluatorOfVehicle(int vehicle) {
383 return mainJNI.RoutingDimension_GetPostTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
384 }
385
390 long cPtr = mainJNI.RoutingDimension_base_dimension(swigCPtr, this);
391 return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
392 }
393
403 public long shortestTransitionSlack(long node) {
404 return mainJNI.RoutingDimension_shortestTransitionSlack(swigCPtr, this, node);
405 }
406
410 public String name() {
411 return mainJNI.RoutingDimension_name(swigCPtr, this);
412 }
413
414 public void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index) {
415 mainJNI.RoutingDimension_setPickupToDeliveryLimitFunctionForPair(swigCPtr, this, limit_function, pair_index);
416 }
417
418 public boolean hasPickupToDeliveryLimits() {
419 return mainJNI.RoutingDimension_hasPickupToDeliveryLimits(swigCPtr, this);
420 }
421
422 public void addNodePrecedence(long first_node, long second_node, long offset) {
423 mainJNI.RoutingDimension_addNodePrecedence(swigCPtr, this, first_node, second_node, offset);
424 }
425
426 public long getSpanUpperBoundForVehicle(int vehicle) {
427 return mainJNI.RoutingDimension_getSpanUpperBoundForVehicle(swigCPtr, this, vehicle);
428 }
429
430 public long getSpanCostCoefficientForVehicle(int vehicle) {
431 return mainJNI.RoutingDimension_getSpanCostCoefficientForVehicle(swigCPtr, this, vehicle);
432 }
433
434 public long GetSlackCostCoefficientForVehicle(int vehicle) {
435 return mainJNI.RoutingDimension_GetSlackCostCoefficientForVehicle(swigCPtr, this, vehicle);
436 }
437
439 return mainJNI.RoutingDimension_getGlobalSpanCostCoefficient(swigCPtr, this);
440 }
441
443 return mainJNI.RoutingDimension_GetGlobalOptimizerOffset(swigCPtr, this);
444 }
445
446 public long getLocalOptimizerOffsetForVehicle(int vehicle) {
447 return mainJNI.RoutingDimension_getLocalOptimizerOffsetForVehicle(swigCPtr, this, vehicle);
448 }
449
454 public void setSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
455 mainJNI.RoutingDimension_setSoftSpanUpperBoundForVehicle(swigCPtr, this, BoundCost.getCPtr(bound_cost), bound_cost, vehicle);
456 }
457
458 public boolean hasSoftSpanUpperBounds() {
459 return mainJNI.RoutingDimension_hasSoftSpanUpperBounds(swigCPtr, this);
460 }
461
463 return new BoundCost(mainJNI.RoutingDimension_getSoftSpanUpperBoundForVehicle(swigCPtr, this, vehicle), true);
464 }
465
470 public void setQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
471 mainJNI.RoutingDimension_setQuadraticCostSoftSpanUpperBoundForVehicle(swigCPtr, this, BoundCost.getCPtr(bound_cost), bound_cost, vehicle);
472 }
473
475 return mainJNI.RoutingDimension_hasQuadraticCostSoftSpanUpperBounds(swigCPtr, this);
476 }
477
479 return new BoundCost(mainJNI.RoutingDimension_getQuadraticCostSoftSpanUpperBoundForVehicle(swigCPtr, this, vehicle), true);
480 }
481
482}
long getTransitValueFromClass(long from_index, long to_index, long vehicle_class)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits)
void addNodePrecedence(long first_node, long second_node, long offset)
void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient)
void setSpanCostCoefficientForVehicle(long coefficient, int vehicle)
void SetCumulVarRange(long index, long min, long max)
void setSpanUpperBoundForVehicle(long upper_bound, int vehicle)
void setQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator)
void setSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator delays)
void setBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle)
long getTransitValue(long from_index, long to_index, long vehicle)
void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient)
void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index)