Google OR-Tools v9.9
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.2.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// Used to wrap std::function<int64_t(int64_t from_index, int64_t to_index)> group_delay
12// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
13import java.util.function.LongBinaryOperator;
14
36public class RoutingDimension {
37 private transient long swigCPtr;
38 protected transient boolean swigCMemOwn;
39
40 public RoutingDimension(long cPtr, boolean cMemoryOwn) {
41 swigCMemOwn = cMemoryOwn;
42 swigCPtr = cPtr;
43 }
44
45 public static long getCPtr(RoutingDimension obj) {
46 return (obj == null) ? 0 : obj.swigCPtr;
47 }
48
49 public static long swigRelease(RoutingDimension obj) {
50 long ptr = 0;
51 if (obj != null) {
52 if (!obj.swigCMemOwn)
53 throw new RuntimeException("Cannot release ownership as memory is not owned");
54 ptr = obj.swigCPtr;
55 obj.swigCMemOwn = false;
56 obj.delete();
57 }
58 return ptr;
59 }
60
61 @SuppressWarnings({"deprecation", "removal"})
62 protected void finalize() {
63 delete();
64 }
65
66 public synchronized void delete() {
67 if (swigCPtr != 0) {
68 if (swigCMemOwn) {
69 swigCMemOwn = false;
70 mainJNI.delete_RoutingDimension(swigCPtr);
71 }
72 swigCPtr = 0;
73 }
74 }
75
80 long cPtr = mainJNI.RoutingDimension_model(swigCPtr, this);
81 return (cPtr == 0) ? null : new RoutingModel(cPtr, false);
82 }
83
89 public long getTransitValue(long from_index, long to_index, long vehicle) {
90 return mainJNI.RoutingDimension_getTransitValue(swigCPtr, this, from_index, to_index, vehicle);
91 }
92
97 public long getTransitValueFromClass(long from_index, long to_index, long vehicle_class) {
98 return mainJNI.RoutingDimension_getTransitValueFromClass(swigCPtr, this, from_index, to_index, vehicle_class);
99 }
100
105 public IntVar cumulVar(long index) {
106 long cPtr = mainJNI.RoutingDimension_cumulVar(swigCPtr, this, index);
107 return (cPtr == 0) ? null : new IntVar(cPtr, false);
108 }
109
110 public IntVar transitVar(long index) {
111 long cPtr = mainJNI.RoutingDimension_transitVar(swigCPtr, this, index);
112 return (cPtr == 0) ? null : new IntVar(cPtr, false);
113 }
114
115 public IntVar fixedTransitVar(long index) {
116 long cPtr = mainJNI.RoutingDimension_fixedTransitVar(swigCPtr, this, index);
117 return (cPtr == 0) ? null : new IntVar(cPtr, false);
118 }
119
120 public IntVar slackVar(long index) {
121 long cPtr = mainJNI.RoutingDimension_slackVar(swigCPtr, this, index);
122 return (cPtr == 0) ? null : new IntVar(cPtr, false);
123 }
124
129 public IntVar[] cumuls() {
130 return mainJNI.RoutingDimension_cumuls(swigCPtr, this);
131}
132
134 return mainJNI.RoutingDimension_fixed_transits(swigCPtr, this);
135}
136
137 public IntVar[] transits() {
138 return mainJNI.RoutingDimension_transits(swigCPtr, this);
139}
140
141 public IntVar[] slacks() {
142 return mainJNI.RoutingDimension_slacks(swigCPtr, this);
143}
144
150 public void setSpanUpperBoundForVehicle(long upper_bound, int vehicle) {
151 mainJNI.RoutingDimension_setSpanUpperBoundForVehicle(swigCPtr, this, upper_bound, vehicle);
152 }
153
162 public void setSpanCostCoefficientForVehicle(long coefficient, int vehicle) {
163 mainJNI.RoutingDimension_setSpanCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
164 }
165
166 public void setSpanCostCoefficientForAllVehicles(long coefficient) {
167 mainJNI.RoutingDimension_setSpanCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
168 }
169
179 public void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle) {
180 mainJNI.RoutingDimension_SetSlackCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
181 }
182
183 public void SetSlackCostCoefficientForAllVehicles(long coefficient) {
184 mainJNI.RoutingDimension_SetSlackCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
185 }
186
195 public void setGlobalSpanCostCoefficient(long coefficient) {
196 mainJNI.RoutingDimension_setGlobalSpanCostCoefficient(swigCPtr, this, coefficient);
197 }
198
209 public void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient) {
210 mainJNI.RoutingDimension_setCumulVarSoftUpperBound(swigCPtr, this, index, upper_bound, coefficient);
211 }
212
217 public boolean hasCumulVarSoftUpperBound(long index) {
218 return mainJNI.RoutingDimension_hasCumulVarSoftUpperBound(swigCPtr, this, index);
219 }
220
226 public long getCumulVarSoftUpperBound(long index) {
227 return mainJNI.RoutingDimension_getCumulVarSoftUpperBound(swigCPtr, this, index);
228 }
229
235 public long getCumulVarSoftUpperBoundCoefficient(long index) {
236 return mainJNI.RoutingDimension_getCumulVarSoftUpperBoundCoefficient(swigCPtr, this, index);
237 }
238
250 public void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient) {
251 mainJNI.RoutingDimension_setCumulVarSoftLowerBound(swigCPtr, this, index, lower_bound, coefficient);
252 }
253
258 public boolean hasCumulVarSoftLowerBound(long index) {
259 return mainJNI.RoutingDimension_hasCumulVarSoftLowerBound(swigCPtr, this, index);
260 }
261
267 public long getCumulVarSoftLowerBound(long index) {
268 return mainJNI.RoutingDimension_getCumulVarSoftLowerBound(swigCPtr, this, index);
269 }
270
276 public long getCumulVarSoftLowerBoundCoefficient(long index) {
277 return mainJNI.RoutingDimension_getCumulVarSoftLowerBoundCoefficient(swigCPtr, this, index);
278 }
279
297 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator) {
298 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_0(swigCPtr, this, breaks, vehicle, pre_travel_evaluator, post_travel_evaluator);
299 }
300
304 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits) {
305 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_1(swigCPtr, this, breaks, vehicle, node_visit_transits);
306 }
307
314 public void setBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle) {
315 mainJNI.RoutingDimension_setBreakDistanceDurationOfVehicle(swigCPtr, this, distance, duration, vehicle);
316 }
317
322 public void InitializeBreaks() {
323 mainJNI.RoutingDimension_InitializeBreaks(swigCPtr, this);
324 }
325
329 public boolean HasBreakConstraints() {
330 return mainJNI.RoutingDimension_HasBreakConstraints(swigCPtr, this);
331 }
332
337 public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator delays) {
338 mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_2(swigCPtr, this, breaks, vehicle, node_visit_transits, delays);
339 }
340
345 return mainJNI.RoutingDimension_getBreakIntervalsOfVehicle(swigCPtr, this, vehicle);
346}
347
348 public int GetPreTravelEvaluatorOfVehicle(int vehicle) {
349 return mainJNI.RoutingDimension_GetPreTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
350 }
351
352 public int GetPostTravelEvaluatorOfVehicle(int vehicle) {
353 return mainJNI.RoutingDimension_GetPostTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
354 }
355
360 long cPtr = mainJNI.RoutingDimension_base_dimension(swigCPtr, this);
361 return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
362 }
363
373 public long shortestTransitionSlack(long node) {
374 return mainJNI.RoutingDimension_shortestTransitionSlack(swigCPtr, this, node);
375 }
376
380 public String name() {
381 return mainJNI.RoutingDimension_name(swigCPtr, this);
382 }
383
384 public void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index) {
385 mainJNI.RoutingDimension_setPickupToDeliveryLimitFunctionForPair(swigCPtr, this, limit_function, pair_index);
386 }
387
388 public boolean hasPickupToDeliveryLimits() {
389 return mainJNI.RoutingDimension_hasPickupToDeliveryLimits(swigCPtr, this);
390 }
391
392 public void addNodePrecedence(long first_node, long second_node, long offset) {
393 mainJNI.RoutingDimension_addNodePrecedence(swigCPtr, this, first_node, second_node, offset);
394 }
395
396 public long getSpanUpperBoundForVehicle(int vehicle) {
397 return mainJNI.RoutingDimension_getSpanUpperBoundForVehicle(swigCPtr, this, vehicle);
398 }
399
400 public long getSpanCostCoefficientForVehicle(int vehicle) {
401 return mainJNI.RoutingDimension_getSpanCostCoefficientForVehicle(swigCPtr, this, vehicle);
402 }
403
404 public long GetSlackCostCoefficientForVehicle(int vehicle) {
405 return mainJNI.RoutingDimension_GetSlackCostCoefficientForVehicle(swigCPtr, this, vehicle);
406 }
407
409 return mainJNI.RoutingDimension_getGlobalSpanCostCoefficient(swigCPtr, this);
410 }
411
413 return mainJNI.RoutingDimension_GetGlobalOptimizerOffset(swigCPtr, this);
414 }
415
416 public long getLocalOptimizerOffsetForVehicle(int vehicle) {
417 return mainJNI.RoutingDimension_getLocalOptimizerOffsetForVehicle(swigCPtr, this, vehicle);
418 }
419
424 public void setSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
425 mainJNI.RoutingDimension_setSoftSpanUpperBoundForVehicle(swigCPtr, this, BoundCost.getCPtr(bound_cost), bound_cost, vehicle);
426 }
427
428 public boolean hasSoftSpanUpperBounds() {
429 return mainJNI.RoutingDimension_hasSoftSpanUpperBounds(swigCPtr, this);
430 }
431
433 return new BoundCost(mainJNI.RoutingDimension_getSoftSpanUpperBoundForVehicle(swigCPtr, this, vehicle), true);
434 }
435
440 public void setQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
441 mainJNI.RoutingDimension_setQuadraticCostSoftSpanUpperBoundForVehicle(swigCPtr, this, BoundCost.getCPtr(bound_cost), bound_cost, vehicle);
442 }
443
445 return mainJNI.RoutingDimension_hasQuadraticCostSoftSpanUpperBounds(swigCPtr, this);
446 }
447
449 return new BoundCost(mainJNI.RoutingDimension_getQuadraticCostSoftSpanUpperBoundForVehicle(swigCPtr, this, vehicle), true);
450 }
451
452}
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 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)