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