Java Reference

Java Reference

RoutingDimension.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
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 
9 package com.google.ortools.constraintsolver;
10 
11 // Used to wrap std::function<int64(int64 from_index, int64 to_index)> group_delay
12 // see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
13 import java.util.function.LongBinaryOperator;
14 
15 public class RoutingDimension {
16  private transient long swigCPtr;
17  protected transient boolean swigCMemOwn;
18 
19  protected RoutingDimension(long cPtr, boolean cMemoryOwn) {
20  swigCMemOwn = cMemoryOwn;
21  swigCPtr = cPtr;
22  }
23 
24  protected static long getCPtr(RoutingDimension obj) {
25  return (obj == null) ? 0 : obj.swigCPtr;
26  }
27 
28  @SuppressWarnings("deprecation")
29  protected void finalize() {
30  delete();
31  }
32 
33  public synchronized void delete() {
34  if (swigCPtr != 0) {
35  if (swigCMemOwn) {
36  swigCMemOwn = false;
37  mainJNI.delete_RoutingDimension(swigCPtr);
38  }
39  swigCPtr = 0;
40  }
41  }
42 
43  public RoutingModel model() {
44  long cPtr = mainJNI.RoutingDimension_model(swigCPtr, this);
45  return (cPtr == 0) ? null : new RoutingModel(cPtr, false);
46  }
47 
48  public long getTransitValue(long from_index, long to_index, long vehicle) {
49  return mainJNI.RoutingDimension_getTransitValue(swigCPtr, this, from_index, to_index, vehicle);
50  }
51 
52  public long getTransitValueFromClass(long from_index, long to_index, long vehicle_class) {
53  return mainJNI.RoutingDimension_getTransitValueFromClass(swigCPtr, this, from_index, to_index, vehicle_class);
54  }
55 
56  public IntVar cumulVar(long index) {
57  long cPtr = mainJNI.RoutingDimension_cumulVar(swigCPtr, this, index);
58  return (cPtr == 0) ? null : new IntVar(cPtr, false);
59  }
60 
61  public IntVar transitVar(long index) {
62  long cPtr = mainJNI.RoutingDimension_transitVar(swigCPtr, this, index);
63  return (cPtr == 0) ? null : new IntVar(cPtr, false);
64  }
65 
66  public IntVar fixedTransitVar(long index) {
67  long cPtr = mainJNI.RoutingDimension_fixedTransitVar(swigCPtr, this, index);
68  return (cPtr == 0) ? null : new IntVar(cPtr, false);
69  }
70 
71  public IntVar slackVar(long index) {
72  long cPtr = mainJNI.RoutingDimension_slackVar(swigCPtr, this, index);
73  return (cPtr == 0) ? null : new IntVar(cPtr, false);
74  }
75 
76  public IntVar[] cumuls() {
77  return mainJNI.RoutingDimension_cumuls(swigCPtr, this);
78 }
79 
80  public IntVar[] fixed_transits() {
81  return mainJNI.RoutingDimension_fixed_transits(swigCPtr, this);
82 }
83 
84  public IntVar[] transits() {
85  return mainJNI.RoutingDimension_transits(swigCPtr, this);
86 }
87 
88  public IntVar[] slacks() {
89  return mainJNI.RoutingDimension_slacks(swigCPtr, this);
90 }
91 
92  public void setSpanUpperBoundForVehicle(long upper_bound, int vehicle) {
93  mainJNI.RoutingDimension_setSpanUpperBoundForVehicle(swigCPtr, this, upper_bound, vehicle);
94  }
95 
96  public void setSpanCostCoefficientForVehicle(long coefficient, int vehicle) {
97  mainJNI.RoutingDimension_setSpanCostCoefficientForVehicle(swigCPtr, this, coefficient, vehicle);
98  }
99 
100  public void setSpanCostCoefficientForAllVehicles(long coefficient) {
101  mainJNI.RoutingDimension_setSpanCostCoefficientForAllVehicles(swigCPtr, this, coefficient);
102  }
103 
104  public void setGlobalSpanCostCoefficient(long coefficient) {
105  mainJNI.RoutingDimension_setGlobalSpanCostCoefficient(swigCPtr, this, coefficient);
106  }
107 
108  public void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient) {
109  mainJNI.RoutingDimension_setCumulVarSoftUpperBound(swigCPtr, this, index, upper_bound, coefficient);
110  }
111 
112  public boolean hasCumulVarSoftUpperBound(long index) {
113  return mainJNI.RoutingDimension_hasCumulVarSoftUpperBound(swigCPtr, this, index);
114  }
115 
116  public long getCumulVarSoftUpperBound(long index) {
117  return mainJNI.RoutingDimension_getCumulVarSoftUpperBound(swigCPtr, this, index);
118  }
119 
120  public long getCumulVarSoftUpperBoundCoefficient(long index) {
121  return mainJNI.RoutingDimension_getCumulVarSoftUpperBoundCoefficient(swigCPtr, this, index);
122  }
123 
124  public void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient) {
125  mainJNI.RoutingDimension_setCumulVarSoftLowerBound(swigCPtr, this, index, lower_bound, coefficient);
126  }
127 
128  public boolean hasCumulVarSoftLowerBound(long index) {
129  return mainJNI.RoutingDimension_hasCumulVarSoftLowerBound(swigCPtr, this, index);
130  }
131 
132  public long getCumulVarSoftLowerBound(long index) {
133  return mainJNI.RoutingDimension_getCumulVarSoftLowerBound(swigCPtr, this, index);
134  }
135 
136  public long getCumulVarSoftLowerBoundCoefficient(long index) {
137  return mainJNI.RoutingDimension_getCumulVarSoftLowerBoundCoefficient(swigCPtr, this, index);
138  }
139 
140  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator) {
141  mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_0(swigCPtr, this, breaks, vehicle, pre_travel_evaluator, post_travel_evaluator);
142  }
143 
144  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits) {
145  mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_1(swigCPtr, this, breaks, vehicle, node_visit_transits);
146  }
147 
148  public void SetBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle) {
149  mainJNI.RoutingDimension_SetBreakDistanceDurationOfVehicle(swigCPtr, this, distance, duration, vehicle);
150  }
151 
152  public void InitializeBreaks() {
153  mainJNI.RoutingDimension_InitializeBreaks(swigCPtr, this);
154  }
155 
156  public boolean HasBreakConstraints() {
157  return mainJNI.RoutingDimension_HasBreakConstraints(swigCPtr, this);
158  }
159 
160  public void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator group_delays) {
161  mainJNI.RoutingDimension_setBreakIntervalsOfVehicle__SWIG_2(swigCPtr, this, breaks, vehicle, node_visit_transits, group_delays);
162  }
163 
164  public IntervalVar[] getBreakIntervalsOfVehicle(int vehicle) {
165  return mainJNI.RoutingDimension_getBreakIntervalsOfVehicle(swigCPtr, this, vehicle);
166 }
167 
168  public int GetPreTravelEvaluatorOfVehicle(int vehicle) {
169  return mainJNI.RoutingDimension_GetPreTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
170  }
171 
172  public int GetPostTravelEvaluatorOfVehicle(int vehicle) {
173  return mainJNI.RoutingDimension_GetPostTravelEvaluatorOfVehicle(swigCPtr, this, vehicle);
174  }
175 
177  long cPtr = mainJNI.RoutingDimension_base_dimension(swigCPtr, this);
178  return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
179  }
180 
181  public long shortestTransitionSlack(long node) {
182  return mainJNI.RoutingDimension_shortestTransitionSlack(swigCPtr, this, node);
183  }
184 
185  public String name() {
186  return mainJNI.RoutingDimension_name(swigCPtr, this);
187  }
188 
189  public void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index) {
190  mainJNI.RoutingDimension_setPickupToDeliveryLimitFunctionForPair(swigCPtr, this, limit_function, pair_index);
191  }
192 
193  public boolean hasPickupToDeliveryLimits() {
194  return mainJNI.RoutingDimension_hasPickupToDeliveryLimits(swigCPtr, this);
195  }
196 
197  public void addNodePrecedence(long first_node, long second_node, long offset) {
198  mainJNI.RoutingDimension_addNodePrecedence(swigCPtr, this, first_node, second_node, offset);
199  }
200 
201  public long getSpanUpperBoundForVehicle(int vehicle) {
202  return mainJNI.RoutingDimension_getSpanUpperBoundForVehicle(swigCPtr, this, vehicle);
203  }
204 
205  public long getSpanCostCoefficientForVehicle(int vehicle) {
206  return mainJNI.RoutingDimension_getSpanCostCoefficientForVehicle(swigCPtr, this, vehicle);
207  }
208 
210  return mainJNI.RoutingDimension_getGlobalSpanCostCoefficient(swigCPtr, this);
211  }
212 
213  public long GetGlobalOptimizerOffset() {
214  return mainJNI.RoutingDimension_GetGlobalOptimizerOffset(swigCPtr, this);
215  }
216 
217  public long GetLocalOptimizerOffsetForVehicle(int vehicle) {
218  return mainJNI.RoutingDimension_GetLocalOptimizerOffsetForVehicle(swigCPtr, this, vehicle);
219  }
220 
221 }
long getCumulVarSoftLowerBoundCoefficient(long index)
RoutingDimension(long cPtr, boolean cMemoryOwn)
void setSpanCostCoefficientForAllVehicles(long coefficient)
Represents a function that accepts two int-valued arguments and produces a long-valued result.
IntVar[] cumuls()
IntVar slackVar(long index)
void setCumulVarSoftLowerBound(long index, long lower_bound, long coefficient)
int GetPostTravelEvaluatorOfVehicle(int vehicle)
RoutingDimension base_dimension()
long getTransitValue(long from_index, long to_index, long vehicle)
void setCumulVarSoftUpperBound(long index, long upper_bound, long coefficient)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, long[] node_visit_transits, LongBinaryOperator group_delays)
IntVar fixedTransitVar(long index)
void InitializeBreaks()
String name()
RoutingModel model()
boolean HasBreakConstraints()
IntVar transitVar(long index)
boolean hasPickupToDeliveryLimits()
long GetLocalOptimizerOffsetForVehicle(int vehicle)
long getCumulVarSoftUpperBound(long index)
void setBreakIntervalsOfVehicle(IntervalVar[] breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator)
long getSpanCostCoefficientForVehicle(int vehicle)
IntVar[] transits()
void setGlobalSpanCostCoefficient(long coefficient)
IntVar[] slacks()
void setSpanUpperBoundForVehicle(long upper_bound, int vehicle)
IntVar cumulVar(long index)
long GetGlobalOptimizerOffset()
void setPickupToDeliveryLimitFunctionForPair(IntIntToLongFunction limit_function, int pair_index)
long getCumulVarSoftLowerBound(long index)
long getSpanUpperBoundForVehicle(int vehicle)
int GetPreTravelEvaluatorOfVehicle(int vehicle)
IntervalVar[] getBreakIntervalsOfVehicle(int vehicle)
boolean hasCumulVarSoftLowerBound(long index)
long getGlobalSpanCostCoefficient()
long getCumulVarSoftUpperBoundCoefficient(long index)
void setSpanCostCoefficientForVehicle(long coefficient, int vehicle)
IntVar[] fixed_transits()
long getTransitValueFromClass(long from_index, long to_index, long vehicle_class)
void SetBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle)
void addNodePrecedence(long first_node, long second_node, long offset)
boolean hasCumulVarSoftUpperBound(long index)
long shortestTransitionSlack(long node)