Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
PathOperator.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.Runtime.InteropServices;
15using System.Collections;
16using System.Collections.Generic;
17
18public partial class PathOperator : IntVarLocalSearchOperator {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal PathOperator(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.PathOperator_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(PathOperator 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(PathOperator 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 protected override void Dispose(bool disposing) {
43 lock(this) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
45 if (swigCMemOwn) {
46 swigCMemOwn = false;
48 }
49 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
50 }
51 base.Dispose(disposing);
52 }
53 }
54
55 // Keep reference to delegate to avoid GC to collect them early
56 private List<LongToInt> startEmptyPathCallbacks;
57 private LongToInt StoreLongToInt(LongToInt path) {
58 if (startEmptyPathCallbacks == null)
59 startEmptyPathCallbacks = new List<LongToInt>();
60 startEmptyPathCallbacks.Add(path);
61 return path;
62 }
63
64 public virtual bool MakeNeighbor() {
65 bool ret = operations_research_constraint_solverPINVOKE.PathOperator_MakeNeighbor(swigCPtr);
66 return ret;
67 }
68
69 public override void Reset() {
71 }
72
73 public long Prev(long node) {
75 return ret;
76 }
77
78 protected virtual new bool MakeOneNeighbor() {
80 return ret;
81 }
82
83 protected virtual void OnNodeInitialization() {
85 }
86
87 protected virtual bool RestartAtPathStartOnSynchronize() {
89 return ret;
90 }
91
92 protected virtual bool OnSamePathAsPreviousBase(long base_index) {
93 bool ret = (SwigDerivedClassHasMethod("OnSamePathAsPreviousBase", swigMethodTypes11) ? operations_research_constraint_solverPINVOKE.PathOperator_OnSamePathAsPreviousBaseSwigExplicitPathOperator(swigCPtr, base_index) : operations_research_constraint_solverPINVOKE.PathOperator_OnSamePathAsPreviousBase(swigCPtr, base_index));
94 return ret;
95 }
96
97 protected virtual long GetBaseNodeRestartPosition(int base_index) {
98 long ret = (SwigDerivedClassHasMethod("GetBaseNodeRestartPosition", swigMethodTypes12) ? operations_research_constraint_solverPINVOKE.PathOperator_GetBaseNodeRestartPositionSwigExplicitPathOperator(swigCPtr, base_index) : operations_research_constraint_solverPINVOKE.PathOperator_GetBaseNodeRestartPosition(swigCPtr, base_index));
99 return ret;
100 }
101
102 protected virtual void SetNextBaseToIncrement(long base_index) {
103 if (SwigDerivedClassHasMethod("SetNextBaseToIncrement", swigMethodTypes13)) operations_research_constraint_solverPINVOKE.PathOperator_SetNextBaseToIncrementSwigExplicitPathOperator(swigCPtr, base_index); else operations_research_constraint_solverPINVOKE.PathOperator_SetNextBaseToIncrement(swigCPtr, base_index);
105
106 protected virtual bool ConsiderAlternatives(long base_index) {
107 bool ret = (SwigDerivedClassHasMethod("ConsiderAlternatives", swigMethodTypes14) ? operations_research_constraint_solverPINVOKE.PathOperator_ConsiderAlternativesSwigExplicitPathOperator(swigCPtr, base_index) : operations_research_constraint_solverPINVOKE.PathOperator_ConsiderAlternatives(swigCPtr, base_index));
108 return ret;
109 }
110
111 protected virtual bool InitPosition() {
113 return ret;
114 }
115
116 private void SwigDirectorConnect() {
117 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
118 swigDelegate0 = new SwigDelegatePathOperator_0(SwigDirectorMethodToString);
119 if (SwigDerivedClassHasMethod("Start", swigMethodTypes1))
120 swigDelegate1 = new SwigDelegatePathOperator_1(SwigDirectorMethodStart);
121 if (SwigDerivedClassHasMethod("Reset", swigMethodTypes2))
122 swigDelegate2 = new SwigDelegatePathOperator_2(SwigDirectorMethodReset);
123 if (SwigDerivedClassHasMethod("HasFragments", swigMethodTypes3))
124 swigDelegate3 = new SwigDelegatePathOperator_3(SwigDirectorMethodHasFragments);
125 if (SwigDerivedClassHasMethod("HoldsDelta", swigMethodTypes4))
126 swigDelegate4 = new SwigDelegatePathOperator_4(SwigDirectorMethodHoldsDelta);
127 if (SwigDerivedClassHasMethod("IsIncremental", swigMethodTypes5))
128 swigDelegate5 = new SwigDelegatePathOperator_5(SwigDirectorMethodIsIncremental);
129 if (SwigDerivedClassHasMethod("OnStart", swigMethodTypes6))
130 swigDelegate6 = new SwigDelegatePathOperator_6(SwigDirectorMethodOnStart);
131 if (SwigDerivedClassHasMethod("MakeOneNeighbor", swigMethodTypes7))
132 swigDelegate7 = new SwigDelegatePathOperator_7(SwigDirectorMethodMakeOneNeighbor);
133 if (SwigDerivedClassHasMethod("MakeNeighbor", swigMethodTypes8))
134 swigDelegate8 = new SwigDelegatePathOperator_8(SwigDirectorMethodMakeNeighbor);
135 if (SwigDerivedClassHasMethod("OnNodeInitialization", swigMethodTypes9))
136 swigDelegate9 = new SwigDelegatePathOperator_9(SwigDirectorMethodOnNodeInitialization);
137 if (SwigDerivedClassHasMethod("RestartAtPathStartOnSynchronize", swigMethodTypes10))
138 swigDelegate10 = new SwigDelegatePathOperator_10(SwigDirectorMethodRestartAtPathStartOnSynchronize);
139 if (SwigDerivedClassHasMethod("OnSamePathAsPreviousBase", swigMethodTypes11))
140 swigDelegate11 = new SwigDelegatePathOperator_11(SwigDirectorMethodOnSamePathAsPreviousBase);
141 if (SwigDerivedClassHasMethod("GetBaseNodeRestartPosition", swigMethodTypes12))
142 swigDelegate12 = new SwigDelegatePathOperator_12(SwigDirectorMethodGetBaseNodeRestartPosition);
143 if (SwigDerivedClassHasMethod("SetNextBaseToIncrement", swigMethodTypes13))
144 swigDelegate13 = new SwigDelegatePathOperator_13(SwigDirectorMethodSetNextBaseToIncrement);
145 if (SwigDerivedClassHasMethod("ConsiderAlternatives", swigMethodTypes14))
146 swigDelegate14 = new SwigDelegatePathOperator_14(SwigDirectorMethodConsiderAlternatives);
147 if (SwigDerivedClassHasMethod("InitPosition", swigMethodTypes15))
148 swigDelegate15 = new SwigDelegatePathOperator_15(SwigDirectorMethodInitPosition);
149 operations_research_constraint_solverPINVOKE.PathOperator_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15);
150 }
151
152 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
153 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
154 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
155 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
156 if (methodInfo.DeclaringType == null)
157 continue;
158
159 if (methodInfo.Name != methodName)
160 continue;
161
162 var parameters = methodInfo.GetParameters();
163 if (parameters.Length != methodTypes.Length)
164 continue;
165
166 bool parametersMatch = true;
167 for (var i = 0; i < parameters.Length; i++) {
168 if (parameters[i].ParameterType != methodTypes[i]) {
169 parametersMatch = false;
170 break;
171 }
172 }
173
174 if (!parametersMatch)
175 continue;
176
177 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(PathOperator))) &&
178 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
179 return true;
180 }
181 }
182
183 return false;
184 }
185
186 private string SwigDirectorMethodToString() {
187 return ToString();
188 }
189
190 private void SwigDirectorMethodStart(global::System.IntPtr assignment) {
191 Start((assignment == global::System.IntPtr.Zero) ? null : new Assignment(assignment, false));
192 }
193
194 private void SwigDirectorMethodReset() {
195 Reset();
196 }
197
198 private bool SwigDirectorMethodHasFragments() {
199 return HasFragments();
200 }
201
202 private bool SwigDirectorMethodHoldsDelta() {
203 return HoldsDelta();
204 }
205
206 private bool SwigDirectorMethodIsIncremental() {
207 return IsIncremental();
208 }
209
210 private void SwigDirectorMethodOnStart() {
211 OnStart();
212 }
213
214 private bool SwigDirectorMethodMakeOneNeighbor() {
215 return MakeOneNeighbor();
216 }
217
218 private bool SwigDirectorMethodMakeNeighbor() {
219 return MakeNeighbor();
220 }
221
222 private void SwigDirectorMethodOnNodeInitialization() {
224 }
225
226 private bool SwigDirectorMethodRestartAtPathStartOnSynchronize() {
228 }
229
230 private bool SwigDirectorMethodOnSamePathAsPreviousBase(long base_index) {
231 return OnSamePathAsPreviousBase(base_index);
232 }
233
234 private long SwigDirectorMethodGetBaseNodeRestartPosition(int base_index) {
235 return GetBaseNodeRestartPosition(base_index);
236 }
237
238 private void SwigDirectorMethodSetNextBaseToIncrement(long base_index) {
239 SetNextBaseToIncrement(base_index);
240 }
241
242 private bool SwigDirectorMethodConsiderAlternatives(long base_index) {
243 return ConsiderAlternatives(base_index);
244 }
245
246 private bool SwigDirectorMethodInitPosition() {
247 return InitPosition();
248 }
249
250 public delegate string SwigDelegatePathOperator_0();
251 public delegate void SwigDelegatePathOperator_1(global::System.IntPtr assignment);
252 public delegate void SwigDelegatePathOperator_2();
253 public delegate bool SwigDelegatePathOperator_3();
254 public delegate bool SwigDelegatePathOperator_4();
255 public delegate bool SwigDelegatePathOperator_5();
256 public delegate void SwigDelegatePathOperator_6();
257 public delegate bool SwigDelegatePathOperator_7();
258 public delegate bool SwigDelegatePathOperator_8();
259 public delegate void SwigDelegatePathOperator_9();
260 public delegate bool SwigDelegatePathOperator_10();
261 public delegate bool SwigDelegatePathOperator_11(long base_index);
262 public delegate long SwigDelegatePathOperator_12(int base_index);
263 public delegate void SwigDelegatePathOperator_13(long base_index);
264 public delegate bool SwigDelegatePathOperator_14(long base_index);
265 public delegate bool SwigDelegatePathOperator_15();
267 private SwigDelegatePathOperator_0 swigDelegate0;
268 private SwigDelegatePathOperator_1 swigDelegate1;
269 private SwigDelegatePathOperator_2 swigDelegate2;
270 private SwigDelegatePathOperator_3 swigDelegate3;
271 private SwigDelegatePathOperator_4 swigDelegate4;
272 private SwigDelegatePathOperator_5 swigDelegate5;
273 private SwigDelegatePathOperator_6 swigDelegate6;
274 private SwigDelegatePathOperator_7 swigDelegate7;
275 private SwigDelegatePathOperator_8 swigDelegate8;
276 private SwigDelegatePathOperator_9 swigDelegate9;
277 private SwigDelegatePathOperator_10 swigDelegate10;
278 private SwigDelegatePathOperator_11 swigDelegate11;
279 private SwigDelegatePathOperator_12 swigDelegate12;
280 private SwigDelegatePathOperator_13 swigDelegate13;
281 private SwigDelegatePathOperator_14 swigDelegate14;
282 private SwigDelegatePathOperator_15 swigDelegate15;
283
284 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
285 private static global::System.Type[] swigMethodTypes1 = new global::System.Type[] { typeof(Assignment) };
286 private static global::System.Type[] swigMethodTypes2 = new global::System.Type[] { };
287 private static global::System.Type[] swigMethodTypes3 = new global::System.Type[] { };
288 private static global::System.Type[] swigMethodTypes4 = new global::System.Type[] { };
289 private static global::System.Type[] swigMethodTypes5 = new global::System.Type[] { };
290 private static global::System.Type[] swigMethodTypes6 = new global::System.Type[] { };
291 private static global::System.Type[] swigMethodTypes7 = new global::System.Type[] { };
292 private static global::System.Type[] swigMethodTypes8 = new global::System.Type[] { };
293 private static global::System.Type[] swigMethodTypes9 = new global::System.Type[] { };
294 private static global::System.Type[] swigMethodTypes10 = new global::System.Type[] { };
295 private static global::System.Type[] swigMethodTypes11 = new global::System.Type[] { typeof(long) };
296 private static global::System.Type[] swigMethodTypes12 = new global::System.Type[] { typeof(int) };
297 private static global::System.Type[] swigMethodTypes13 = new global::System.Type[] { typeof(long) };
298 private static global::System.Type[] swigMethodTypes14 = new global::System.Type[] { typeof(long) };
299 private static global::System.Type[] swigMethodTypes15 = new global::System.Type[] { };
300}
301
302}
delegate bool SwigDelegatePathOperator_11(long base_index)
delegate bool SwigDelegatePathOperator_14(long base_index)
delegate long SwigDelegatePathOperator_12(int base_index)
virtual void SetNextBaseToIncrement(long base_index)
virtual long GetBaseNodeRestartPosition(int base_index)
delegate void SwigDelegatePathOperator_13(long base_index)
delegate void SwigDelegatePathOperator_1(global::System.IntPtr assignment)
virtual bool OnSamePathAsPreviousBase(long base_index)
virtual bool ConsiderAlternatives(long base_index)
static long PathOperator_Prev(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool PathOperator_ConsiderAlternatives(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool PathOperator_MakeOneNeighbor(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PathOperator_OnSamePathAsPreviousBase(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void PathOperator_OnNodeInitialization(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PathOperator_SetNextBaseToIncrementSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool PathOperator_ConsiderAlternativesSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static bool PathOperator_MakeOneNeighborSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PathOperator_RestartAtPathStartOnSynchronize(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PathOperator_InitPosition(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PathOperator_ResetSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PathOperator_Reset(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PathOperator_RestartAtPathStartOnSynchronizeSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static void PathOperator_SetNextBaseToIncrement(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void delete_PathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static bool PathOperator_InitPositionSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static long PathOperator_GetBaseNodeRestartPositionSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void PathOperator_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, PathOperator.SwigDelegatePathOperator_0 delegate0, PathOperator.SwigDelegatePathOperator_1 delegate1, PathOperator.SwigDelegatePathOperator_2 delegate2, PathOperator.SwigDelegatePathOperator_3 delegate3, PathOperator.SwigDelegatePathOperator_4 delegate4, PathOperator.SwigDelegatePathOperator_5 delegate5, PathOperator.SwigDelegatePathOperator_6 delegate6, PathOperator.SwigDelegatePathOperator_7 delegate7, PathOperator.SwigDelegatePathOperator_8 delegate8, PathOperator.SwigDelegatePathOperator_9 delegate9, PathOperator.SwigDelegatePathOperator_10 delegate10, PathOperator.SwigDelegatePathOperator_11 delegate11, PathOperator.SwigDelegatePathOperator_12 delegate12, PathOperator.SwigDelegatePathOperator_13 delegate13, PathOperator.SwigDelegatePathOperator_14 delegate14, PathOperator.SwigDelegatePathOperator_15 delegate15)
static bool PathOperator_OnSamePathAsPreviousBaseSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1, long jarg2)
static void PathOperator_OnNodeInitializationSwigExplicitPathOperator(global::System.Runtime.InteropServices.HandleRef jarg1)
static long PathOperator_GetBaseNodeRestartPosition(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
delegate int LongToInt(long t)
Used to wrap std::function<int(int64_t)>