Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
LocalSearchFilterManager.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 LocalSearchFilterManager : BaseObject {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal LocalSearchFilterManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.LocalSearchFilterManager_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(LocalSearchFilterManager 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(LocalSearchFilterManager 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 public partial class FilterEvent : global::System.IDisposable {
56 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
57 protected bool swigCMemOwn;
58
59 internal FilterEvent(global::System.IntPtr cPtr, bool cMemoryOwn) {
60 swigCMemOwn = cMemoryOwn;
61 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
62 }
63
64 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(FilterEvent obj) {
65 return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr;
66 }
67
68 internal static global::System.Runtime.InteropServices.HandleRef swigRelease(FilterEvent obj) {
69 if (obj != null) {
70 if (!obj.swigCMemOwn)
71 throw new global::System.ApplicationException("Cannot release ownership as memory is not owned");
72 global::System.Runtime.InteropServices.HandleRef ptr = obj.swigCPtr;
73 obj.swigCMemOwn = false;
74 obj.Dispose();
75 return ptr;
76 } else {
77 return new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
78 }
79 }
80
81 ~FilterEvent() {
82 Dispose(false);
83 }
84
85 public void Dispose() {
86 Dispose(true);
87 global::System.GC.SuppressFinalize(this);
88 }
89
90 protected virtual void Dispose(bool disposing) {
91 lock(this) {
92 if (swigCPtr.Handle != global::System.IntPtr.Zero) {
93 if (swigCMemOwn) {
94 swigCMemOwn = false;
96 }
97 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero);
98 }
99 }
100 }
101
102 public LocalSearchFilter filter {
103 set {
105 }
106 get {
108 LocalSearchFilter ret = (cPtr == global::System.IntPtr.Zero) ? null : new LocalSearchFilter(cPtr, false);
109 return ret;
110 }
111 }
112
113 public int event_type {
114 set {
124 set {
126 }
127 get {
129 return ret;
130 }
131 }
132
133 public FilterEvent() : this(operations_research_constraint_solverPINVOKE.new_LocalSearchFilterManager_FilterEvent(), true) {
134 }
136 }
137
138 public override string ToString() {
140 return ret;
141 }
142
143 public LocalSearchFilterManager(SWIGTYPE_p_std__vectorT_operations_research__LocalSearchFilterManager__FilterEvent_t filter_events) : this(operations_research_constraint_solverPINVOKE.new_LocalSearchFilterManager__SWIG_0(SWIGTYPE_p_std__vectorT_operations_research__LocalSearchFilterManager__FilterEvent_t.getCPtr(filter_events)), true) {
145 SwigDirectorConnect();
146 }
147
148 public LocalSearchFilterManager(LocalSearchFilterVector filters) : this(operations_research_constraint_solverPINVOKE.new_LocalSearchFilterManager__SWIG_1(LocalSearchFilterVector.getCPtr(filters)), true) {
150 SwigDirectorConnect();
151 }
152
153 public void Revert() {
156
157 public bool Accept(LocalSearchMonitor monitor, Assignment delta, Assignment deltadelta, long objective_min, long objective_max) {
158 bool ret = operations_research_constraint_solverPINVOKE.LocalSearchFilterManager_Accept(swigCPtr, LocalSearchMonitor.getCPtr(monitor), Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta), objective_min, objective_max);
159 return ret;
160 }
161
162 public void Synchronize(Assignment assignment, Assignment delta) {
165
166 public long GetSynchronizedObjectiveValue() {
168 return ret;
169 }
170
171 public long GetAcceptedObjectiveValue() {
173 return ret;
174 }
175
176 private void SwigDirectorConnect() {
177 if (SwigDerivedClassHasMethod("ToString", swigMethodTypes0))
178 swigDelegate0 = new SwigDelegateLocalSearchFilterManager_0(SwigDirectorMethodToString);
180 }
181
182 private bool SwigDerivedClassHasMethod(string methodName, global::System.Type[] methodTypes) {
183 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
184 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
185 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
186 if (methodInfo.DeclaringType == null)
187 continue;
188
189 if (methodInfo.Name != methodName)
190 continue;
191
192 var parameters = methodInfo.GetParameters();
193 if (parameters.Length != methodTypes.Length)
194 continue;
195
196 bool parametersMatch = true;
197 for (var i = 0; i < parameters.Length; i++) {
198 if (parameters[i].ParameterType != methodTypes[i]) {
199 parametersMatch = false;
200 break;
201 }
202 }
203
204 if (!parametersMatch)
205 continue;
206
207 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(LocalSearchFilterManager))) &&
208 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
209 return true;
210 }
211 }
212
213 return false;
214 }
215
216 private string SwigDirectorMethodToString() {
217 return ToString();
218 }
219
220 public delegate string SwigDelegateLocalSearchFilterManager_0();
221
223
224 private static global::System.Type[] swigMethodTypes0 = new global::System.Type[] { };
225 // FilterEventType
230
231}
void Synchronize(Assignment assignment, Assignment delta)
bool Accept(LocalSearchMonitor monitor, Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
static global::System.IntPtr LocalSearchFilterManager_FilterEvent_filter_get(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_LocalSearchFilterManager(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilterManager_FilterEvent_filter_set(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static void LocalSearchFilterManager_Synchronize(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static void LocalSearchFilterManager_director_connect(global::System.Runtime.InteropServices.HandleRef jarg1, LocalSearchFilterManager.SwigDelegateLocalSearchFilterManager_0 delegate0)
static string LocalSearchFilterManager_ToString(global::System.Runtime.InteropServices.HandleRef jarg1)
static long LocalSearchFilterManager_GetSynchronizedObjectiveValue(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_LocalSearchFilterManager_FilterEvent(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilterManager_FilterEvent_priority_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool LocalSearchFilterManager_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4, long jarg5, long jarg6)
static void LocalSearchFilterManager_Revert(global::System.Runtime.InteropServices.HandleRef jarg1)
static void LocalSearchFilterManager_FilterEvent_event_type_set(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int LocalSearchFilterManager_FilterEvent_event_type_get(global::System.Runtime.InteropServices.HandleRef jarg1)
static long LocalSearchFilterManager_GetAcceptedObjectiveValue(global::System.Runtime.InteropServices.HandleRef jarg1)
static string LocalSearchFilterManager_ToStringSwigExplicitLocalSearchFilterManager(global::System.Runtime.InteropServices.HandleRef jarg1)
static int LocalSearchFilterManager_FilterEvent_priority_get(global::System.Runtime.InteropServices.HandleRef jarg1)