Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
RoutingDimension.cs
Go to the documentation of this file.
1//------------------------------------------------------------------------------
2// <auto-generated />
3//
4// This file was automatically generated by SWIG (https://www.swig.org).
5// Version 4.2.1
6//
7// Do not make changes to this file unless you know what you are doing - modify
8// the SWIG interface file instead.
9//------------------------------------------------------------------------------
10
12
13using System;
14using System.Collections.Generic;
15
16public partial class RoutingDimension : global::System.IDisposable {
17 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
18 protected bool swigCMemOwn;
19
20 internal RoutingDimension(global::System.IntPtr cPtr, bool cMemoryOwn) {
21 swigCMemOwn = cMemoryOwn;
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(RoutingDimension obj) {
26 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
27 }
28
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(RoutingDimension obj) {
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
33 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.Dispose();
36 return ptr;
37 } else {
38 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
39 }
40 }
41
42 ~RoutingDimension() {
43 Dispose(false);
44 }
45
46 public void Dispose() {
47 Dispose(true);
48 global::System.GC.SuppressFinalize(this);
49 }
50
51 protected virtual void Dispose(bool disposing) {
52 lock(this) {
53 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
54 if (swigCMemOwn) {
55 swigCMemOwn = false;
57 }
58 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
59 }
60 }
61 }
62
63 // Keep reference to delegate to avoid GC to collect them early.
64 private List<IntIntToLong> limitCallbacks;
65 private IntIntToLong StoreIntIntToLong(IntIntToLong limit) {
66 if (limitCallbacks == null)
67 limitCallbacks = new List<IntIntToLong>();
68 limitCallbacks.Add(limit);
69 return limit;
70 }
71
72 private List<LongLongToLong> groupDelayCallbacks;
73 private LongLongToLong StoreLongLongToLong(LongLongToLong groupDelay) {
74 if (groupDelayCallbacks == null)
75 groupDelayCallbacks = new List<LongLongToLong>();
76 groupDelayCallbacks.Add(groupDelay);
77 return groupDelay;
78 }
79
80 public RoutingModel Model() {
81 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingDimension_Model(swigCPtr);
82 RoutingModel ret = (cPtr == global::System.IntPtr.Zero) ? null : new RoutingModel(cPtr, false);
83 return ret;
84 }
85
86 public long GetTransitValue(long from_index, long to_index, long vehicle) {
87 long ret = operations_research_constraint_solverPINVOKE.RoutingDimension_GetTransitValue(swigCPtr, from_index, to_index, vehicle);
88 return ret;
89 }
90
91 public long GetTransitValueFromClass(long from_index, long to_index, long vehicle_class) {
92 long ret = operations_research_constraint_solverPINVOKE.RoutingDimension_GetTransitValueFromClass(swigCPtr, from_index, to_index, vehicle_class);
93 return ret;
94 }
95
96 public IntVar CumulVar(long index) {
97 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingDimension_CumulVar(swigCPtr, index);
98 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
99 return ret;
100 }
101
102 public IntVar TransitVar(long index) {
103 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingDimension_TransitVar(swigCPtr, index);
104 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
105 return ret;
106 }
107
108 public IntVar FixedTransitVar(long index) {
109 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingDimension_FixedTransitVar(swigCPtr, index);
110 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
111 return ret;
112 }
113
114 public IntVar SlackVar(long index) {
115 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.RoutingDimension_SlackVar(swigCPtr, index);
116 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
117 return ret;
118 }
119
120 public IntVarVector Cumuls() {
122 return ret;
123 }
124
125 public IntVarVector FixedTransits() {
127 return ret;
128 }
129
130 public IntVarVector Transits() {
132 return ret;
133 }
134
135 public IntVarVector Slacks() {
137 return ret;
138 }
139
140 public void SetSpanUpperBoundForVehicle(long upper_bound, int vehicle) {
143
144 public void SetSpanCostCoefficientForVehicle(long coefficient, int vehicle) {
147
148 public void SetSpanCostCoefficientForAllVehicles(long coefficient) {
151
152 public void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle) {
155
156 public void SetSlackCostCoefficientForAllVehicles(long coefficient) {
159
160 public void SetGlobalSpanCostCoefficient(long coefficient) {
163
164 public void SetCumulVarSoftUpperBound(long index, long upper_bound, long coefficient) {
167
168 public bool HasCumulVarSoftUpperBound(long index) {
170 return ret;
171 }
172
173 public long GetCumulVarSoftUpperBound(long index) {
175 return ret;
176 }
177
178 public long GetCumulVarSoftUpperBoundCoefficient(long index) {
180 return ret;
181 }
182
183 public void SetCumulVarSoftLowerBound(long index, long lower_bound, long coefficient) {
186
187 public bool HasCumulVarSoftLowerBound(long index) {
189 return ret;
190 }
191
192 public long GetCumulVarSoftLowerBound(long index) {
194 return ret;
195 }
196
197 public long GetCumulVarSoftLowerBoundCoefficient(long index) {
199 return ret;
200 }
201
202 public void SetBreakIntervalsOfVehicle(IntervalVarVector breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator) {
203 operations_research_constraint_solverPINVOKE.RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_0(swigCPtr, IntervalVarVector.getCPtr(breaks), vehicle, pre_travel_evaluator, post_travel_evaluator);
208 operations_research_constraint_solverPINVOKE.RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_1(swigCPtr, IntervalVarVector.getCPtr(breaks), vehicle, node_visit_transits.Length, node_visit_transits );
215
216 public void InitializeBreaks() {
219
220 public bool HasBreakConstraints() {
222 return ret;
223 }
224
225 public void SetBreakIntervalsOfVehicle(IntervalVarVector breaks, int vehicle, long[] node_visit_transits, LongLongToLong delays) {
226 operations_research_constraint_solverPINVOKE.RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_2(swigCPtr, IntervalVarVector.getCPtr(breaks), vehicle, node_visit_transits.Length, node_visit_transits , StoreLongLongToLong(delays) );
232 return ret;
233 }
234
235 public int GetPreTravelEvaluatorOfVehicle(int vehicle) {
237 return ret;
238 }
239
240 public int GetPostTravelEvaluatorOfVehicle(int vehicle) {
242 return ret;
243 }
244
247 RoutingDimension ret = (cPtr == global::System.IntPtr.Zero) ? null : new RoutingDimension(cPtr, false);
248 return ret;
249 }
250
251 public long ShortestTransitionSlack(long node) {
253 return ret;
254 }
255
256 public string Name() {
258 return ret;
259 }
260
261 public void SetPickupToDeliveryLimitFunctionForPair( IntIntToLong limit_function, int pair_index) {
264
265 public bool HasPickupToDeliveryLimits() {
267 return ret;
268 }
269
270 public void AddNodePrecedence(long first_node, long second_node, long offset) {
273
274 public long GetSpanUpperBoundForVehicle(int vehicle) {
276 return ret;
277 }
278
279 public long GetSpanCostCoefficientForVehicle(int vehicle) {
281 return ret;
282 }
283
284 public long GetSlackCostCoefficientForVehicle(int vehicle) {
286 return ret;
287 }
288
289 public long GlobalSpanCostCoefficient() {
291 return ret;
292 }
293
294 public long GetGlobalOptimizerOffset() {
296 return ret;
297 }
298
299 public long GetLocalOptimizerOffsetForVehicle(int vehicle) {
301 return ret;
302 }
303
304 public void SetSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
311 return ret;
312 }
313
314 public BoundCost GetSoftSpanUpperBoundForVehicle(int vehicle) {
316 return ret;
317 }
318
319 public void SetQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle) {
326 return ret;
327 }
328
331 return ret;
332 }
333
334}
335
336}
void SetSpanUpperBoundForVehicle(long upper_bound, int vehicle)
void SetQuadraticCostSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
IntervalVarVector GetBreakIntervalsOfVehicle(int vehicle)
void SetSlackCostCoefficientForVehicle(long coefficient, int vehicle)
void SetSpanCostCoefficientForVehicle(long coefficient, int vehicle)
void SetCumulVarSoftUpperBound(long index, long upper_bound, long coefficient)
long GetTransitValueFromClass(long from_index, long to_index, long vehicle_class)
long GetTransitValue(long from_index, long to_index, long vehicle)
BoundCost GetQuadraticCostSoftSpanUpperBoundForVehicle(int vehicle)
void SetBreakIntervalsOfVehicle(IntervalVarVector breaks, int vehicle, int pre_travel_evaluator, int post_travel_evaluator)
void AddNodePrecedence(long first_node, long second_node, long offset)
void SetPickupToDeliveryLimitFunctionForPair(IntIntToLong limit_function, int pair_index)
void SetSoftSpanUpperBoundForVehicle(BoundCost bound_cost, int vehicle)
void SetCumulVarSoftLowerBound(long index, long lower_bound, long coefficient)
void SetBreakDistanceDurationOfVehicle(long distance, long duration, int vehicle)
static long RoutingDimension_ShortestTransitionSlack(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void RoutingDimension_SetSpanCostCoefficientForAllVehicles(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void RoutingDimension_SetPickupToDeliveryLimitFunctionForPair(global::System.Runtime.InteropServices.HandleRef jarg1, IntIntToLong jarg2, int jarg3)
static void delete_RoutingDimension(global::System.Runtime.InteropServices.HandleRef jarg1)
static void RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int length4, long[] jarg4, LongLongToLong jarg5)
static void RoutingDimension_SetCumulVarSoftLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, long jarg4)
static void RoutingDimension_SetSoftSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3)
static void RoutingDimension_SetGlobalSpanCostCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool RoutingDimension_HasCumulVarSoftLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr RoutingDimension_SlackVar(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool RoutingDimension_HasPickupToDeliveryLimits(global::System.Runtime.InteropServices.HandleRef jarg1)
static void RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int jarg4, int jarg5)
static void RoutingDimension_SetBreakIntervalsOfVehicle__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3, int length4, long[] jarg4)
static long RoutingDimension_GetLocalOptimizerOffsetForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool RoutingDimension_HasCumulVarSoftUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static long RoutingDimension_GetSpanCostCoefficientForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr RoutingDimension_BaseDimension(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingDimension_FixedTransitVar(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void RoutingDimension_SetQuadraticCostSoftSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3)
static long RoutingDimension_GetCumulVarSoftLowerBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void RoutingDimension_SetBreakDistanceDurationOfVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, int jarg4)
static long RoutingDimension_GetTransitValueFromClass(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, long jarg4)
static void RoutingDimension_SetSpanCostCoefficientForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, int jarg3)
static long RoutingDimension_GetCumulVarSoftUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static long RoutingDimension_GetCumulVarSoftUpperBoundCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static long RoutingDimension_GetSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr RoutingDimension_Cumuls(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingDimension_GetCumulVarSoftLowerBoundCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr RoutingDimension_GetSoftSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void RoutingDimension_SetCumulVarSoftUpperBound(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, long jarg4)
static global::System.IntPtr RoutingDimension_GetBreakIntervalsOfVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static global::System.IntPtr RoutingDimension_Transits(global::System.Runtime.InteropServices.HandleRef jarg1)
static void RoutingDimension_AddNodePrecedence(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, long jarg4)
static void RoutingDimension_SetSlackCostCoefficientForAllVehicles(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static long RoutingDimension_GetTransitValue(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, long jarg3, long jarg4)
static long RoutingDimension_GlobalSpanCostCoefficient(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingDimension_CumulVar(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static global::System.IntPtr RoutingDimension_TransitVar(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool RoutingDimension_HasQuadraticCostSoftSpanUpperBounds(global::System.Runtime.InteropServices.HandleRef jarg1)
static void RoutingDimension_SetSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, int jarg3)
static bool RoutingDimension_HasSoftSpanUpperBounds(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingDimension_FixedTransits(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingDimension_GetSlackCostCoefficientForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int RoutingDimension_GetPostTravelEvaluatorOfVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int RoutingDimension_GetPreTravelEvaluatorOfVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static string RoutingDimension_Name(global::System.Runtime.InteropServices.HandleRef jarg1)
static void RoutingDimension_SetSlackCostCoefficientForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2, int jarg3)
static global::System.IntPtr RoutingDimension_Slacks(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool RoutingDimension_HasBreakConstraints(global::System.Runtime.InteropServices.HandleRef jarg1)
static long RoutingDimension_GetGlobalOptimizerOffset(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr RoutingDimension_GetQuadraticCostSoftSpanUpperBoundForVehicle(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void RoutingDimension_InitializeBreaks(global::System.Runtime.InteropServices.HandleRef jarg1)
delegate long LongLongToLong(long t, long u)
Used to wrap IndexEvaluator2 (std::function<int64_t(int64_t, int64_t)>)
delegate long IntIntToLong(int t, int u)
Used to wrap std::function<int64_t(int, int)>