22 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
SearchMonitor obj) {
26 return (obj ==
null) ?
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero) : obj.swigCPtr;
29 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(SearchMonitor obj) {
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;
38 return new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
42 protected override void Dispose(
bool disposing) {
44 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
49 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
null, global::System.IntPtr.Zero);
51 base.Dispose(disposing);
55 public SearchMonitor(Solver s) : this(operations_research_constraint_solverPINVOKE.new_SearchMonitor(Solver.getCPtr(s)), true) {
56 SwigDirectorConnect();
157 public virtual void Install() {
163 Solver ret = (cPtr == global::System.IntPtr.Zero) ?
null : new
Solver(cPtr, false);
167 private void SwigDirectorConnect() {
168 if (SwigDerivedClassHasMethod(
"ToString", swigMethodTypes0))
170 if (SwigDerivedClassHasMethod(
"EnterSearch", swigMethodTypes1))
172 if (SwigDerivedClassHasMethod(
"RestartSearch", swigMethodTypes2))
174 if (SwigDerivedClassHasMethod(
"ExitSearch", swigMethodTypes3))
176 if (SwigDerivedClassHasMethod(
"BeginNextDecision", swigMethodTypes4))
178 if (SwigDerivedClassHasMethod(
"EndNextDecision", swigMethodTypes5))
180 if (SwigDerivedClassHasMethod(
"ApplyDecision", swigMethodTypes6))
182 if (SwigDerivedClassHasMethod(
"RefuteDecision", swigMethodTypes7))
184 if (SwigDerivedClassHasMethod(
"AfterDecision", swigMethodTypes8))
186 if (SwigDerivedClassHasMethod(
"BeginFail", swigMethodTypes9))
188 if (SwigDerivedClassHasMethod(
"EndFail", swigMethodTypes10))
190 if (SwigDerivedClassHasMethod(
"BeginInitialPropagation", swigMethodTypes11))
192 if (SwigDerivedClassHasMethod(
"EndInitialPropagation", swigMethodTypes12))
194 if (SwigDerivedClassHasMethod(
"AcceptSolution", swigMethodTypes13))
196 if (SwigDerivedClassHasMethod(
"AtSolution", swigMethodTypes14))
198 if (SwigDerivedClassHasMethod(
"NoMoreSolutions", swigMethodTypes15))
200 if (SwigDerivedClassHasMethod(
"LocalOptimum", swigMethodTypes16))
202 if (SwigDerivedClassHasMethod(
"AcceptDelta", swigMethodTypes17))
204 if (SwigDerivedClassHasMethod(
"AcceptNeighbor", swigMethodTypes18))
206 if (SwigDerivedClassHasMethod(
"AcceptUncheckedNeighbor", swigMethodTypes19))
208 if (SwigDerivedClassHasMethod(
"IsUncheckedSolutionLimitReached", swigMethodTypes20))
210 if (SwigDerivedClassHasMethod(
"PeriodicCheck", swigMethodTypes21))
212 if (SwigDerivedClassHasMethod(
"ProgressPercent", swigMethodTypes22))
214 if (SwigDerivedClassHasMethod(
"Accept", swigMethodTypes23))
216 if (SwigDerivedClassHasMethod(
"Install", swigMethodTypes24))
218 operations_research_constraint_solverPINVOKE.
SearchMonitor_director_connect(swigCPtr, swigDelegate0, swigDelegate1, swigDelegate2, swigDelegate3, swigDelegate4, swigDelegate5, swigDelegate6, swigDelegate7, swigDelegate8, swigDelegate9, swigDelegate10, swigDelegate11, swigDelegate12, swigDelegate13, swigDelegate14, swigDelegate15, swigDelegate16, swigDelegate17, swigDelegate18, swigDelegate19, swigDelegate20, swigDelegate21, swigDelegate22, swigDelegate23, swigDelegate24);
221 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
222 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
223 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
224 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
225 if (methodInfo.DeclaringType ==
null)
228 if (methodInfo.Name != methodName)
231 var parameters = methodInfo.GetParameters();
232 if (parameters.Length != methodTypes.Length)
235 bool parametersMatch =
true;
236 for (var i = 0; i < parameters.Length; i++) {
237 if (parameters[i].ParameterType != methodTypes[i]) {
238 parametersMatch =
false;
243 if (!parametersMatch)
246 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(SearchMonitor))) &&
247 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
255 private string SwigDirectorMethodToString() {
259 private void SwigDirectorMethodEnterSearch() {
263 private void SwigDirectorMethodRestartSearch() {
267 private void SwigDirectorMethodExitSearch() {
271 private void SwigDirectorMethodBeginNextDecision(global::System.IntPtr b) {
272 BeginNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false));
275 private void SwigDirectorMethodEndNextDecision(global::System.IntPtr b, global::System.IntPtr d) {
276 EndNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false), (d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
279 private void SwigDirectorMethodApplyDecision(global::System.IntPtr d) {
280 ApplyDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
283 private void SwigDirectorMethodRefuteDecision(global::System.IntPtr d) {
284 RefuteDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
287 private void SwigDirectorMethodAfterDecision(global::System.IntPtr d,
bool apply) {
288 AfterDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false), apply);
291 private void SwigDirectorMethodBeginFail() {
295 private void SwigDirectorMethodEndFail() {
299 private void SwigDirectorMethodBeginInitialPropagation() {
303 private void SwigDirectorMethodEndInitialPropagation() {
307 private bool SwigDirectorMethodAcceptSolution() {
311 private bool SwigDirectorMethodAtSolution() {
315 private void SwigDirectorMethodNoMoreSolutions() {
319 private bool SwigDirectorMethodLocalOptimum() {
323 private bool SwigDirectorMethodAcceptDelta(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
324 return AcceptDelta((delta == global::System.IntPtr.Zero) ?
null :
new Assignment(delta,
false), (deltadelta == global::System.IntPtr.Zero) ?
null :
new Assignment(deltadelta,
false));
327 private void SwigDirectorMethodAcceptNeighbor() {
331 private void SwigDirectorMethodAcceptUncheckedNeighbor() {
335 private bool SwigDirectorMethodIsUncheckedSolutionLimitReached() {
339 private void SwigDirectorMethodPeriodicCheck() {
343 private int SwigDirectorMethodProgressPercent() {
347 private void SwigDirectorMethodAccept(global::System.IntPtr visitor) {
348 Accept((visitor == global::System.IntPtr.Zero) ?
null :
new ModelVisitor(visitor,
false));
351 private void SwigDirectorMethodInstall() {
407 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };
408 private static global::System.Type[] swigMethodTypes1 =
new global::System.Type[] { };
409 private static global::System.Type[] swigMethodTypes2 =
new global::System.Type[] { };
410 private static global::System.Type[] swigMethodTypes3 =
new global::System.Type[] { };
411 private static global::System.Type[] swigMethodTypes4 =
new global::System.Type[] { typeof(DecisionBuilder) };
412 private static global::System.Type[] swigMethodTypes5 =
new global::System.Type[] { typeof(DecisionBuilder), typeof(Decision) };
413 private static global::System.Type[] swigMethodTypes6 =
new global::System.Type[] { typeof(Decision) };
414 private static global::System.Type[] swigMethodTypes7 =
new global::System.Type[] { typeof(Decision) };
415 private static global::System.Type[] swigMethodTypes8 =
new global::System.Type[] { typeof(Decision), typeof(
bool) };
416 private static global::System.Type[] swigMethodTypes9 =
new global::System.Type[] { };
417 private static global::System.Type[] swigMethodTypes10 =
new global::System.Type[] { };
418 private static global::System.Type[] swigMethodTypes11 =
new global::System.Type[] { };
419 private static global::System.Type[] swigMethodTypes12 =
new global::System.Type[] { };
420 private static global::System.Type[] swigMethodTypes13 =
new global::System.Type[] { };
421 private static global::System.Type[] swigMethodTypes14 =
new global::System.Type[] { };
422 private static global::System.Type[] swigMethodTypes15 =
new global::System.Type[] { };
423 private static global::System.Type[] swigMethodTypes16 =
new global::System.Type[] { };
424 private static global::System.Type[] swigMethodTypes17 =
new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
425 private static global::System.Type[] swigMethodTypes18 =
new global::System.Type[] { };
426 private static global::System.Type[] swigMethodTypes19 =
new global::System.Type[] { };
427 private static global::System.Type[] swigMethodTypes20 =
new global::System.Type[] { };
428 private static global::System.Type[] swigMethodTypes21 =
new global::System.Type[] { };
429 private static global::System.Type[] swigMethodTypes22 =
new global::System.Type[] { };
430 private static global::System.Type[] swigMethodTypes23 =
new global::System.Type[] { typeof(ModelVisitor) };
431 private static global::System.Type[] swigMethodTypes24 =
new global::System.Type[] { };
432 public static readonly
int kNoProgress = operations_research_constraint_solverPINVOKE.SearchMonitor_kNoProgress_get();