22 swigCPtr =
new global::System.Runtime.InteropServices.HandleRef(
this, cPtr);
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(
SolutionCollector 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(SolutionCollector 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 SolutionCollector(Solver
solver, Assignment assignment) : this(operations_research_constraint_solverPINVOKE.new_SolutionCollector__SWIG_0(Solver.getCPtr(
solver), Assignment.getCPtr(assignment)), true) {
56 SwigDirectorConnect();
60 SwigDirectorConnect();
63 public override void Install() {
187 if (cPtr != global::System.IntPtr.Zero) {
189 int[] outArray =
new int[tmpVector.
Count];
190 tmpVector.
CopyTo(outArray);
197 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SolutionCollector_BackwardSequence(swigCPtr, n, SequenceVar.getCPtr(var));
199 if (cPtr != global::System.IntPtr.Zero) {
201 int[] outArray =
new int[tmpVector.
Count];
202 tmpVector.
CopyTo(outArray);
209 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.SolutionCollector_Unperformed(swigCPtr, n, SequenceVar.getCPtr(var));
211 if (cPtr != global::System.IntPtr.Zero) {
213 int[] outArray =
new int[tmpVector.
Count];
214 tmpVector.
CopyTo(outArray);
220 private void SwigDirectorConnect() {
221 if (SwigDerivedClassHasMethod(
"ToString", swigMethodTypes0))
223 if (SwigDerivedClassHasMethod(
"EnterSearch", swigMethodTypes1))
225 if (SwigDerivedClassHasMethod(
"RestartSearch", swigMethodTypes2))
227 if (SwigDerivedClassHasMethod(
"ExitSearch", swigMethodTypes3))
229 if (SwigDerivedClassHasMethod(
"BeginNextDecision", swigMethodTypes4))
231 if (SwigDerivedClassHasMethod(
"EndNextDecision", swigMethodTypes5))
233 if (SwigDerivedClassHasMethod(
"ApplyDecision", swigMethodTypes6))
235 if (SwigDerivedClassHasMethod(
"RefuteDecision", swigMethodTypes7))
237 if (SwigDerivedClassHasMethod(
"AfterDecision", swigMethodTypes8))
239 if (SwigDerivedClassHasMethod(
"BeginFail", swigMethodTypes9))
241 if (SwigDerivedClassHasMethod(
"EndFail", swigMethodTypes10))
243 if (SwigDerivedClassHasMethod(
"BeginInitialPropagation", swigMethodTypes11))
245 if (SwigDerivedClassHasMethod(
"EndInitialPropagation", swigMethodTypes12))
247 if (SwigDerivedClassHasMethod(
"AcceptSolution", swigMethodTypes13))
249 if (SwigDerivedClassHasMethod(
"AtSolution", swigMethodTypes14))
251 if (SwigDerivedClassHasMethod(
"NoMoreSolutions", swigMethodTypes15))
253 if (SwigDerivedClassHasMethod(
"LocalOptimum", swigMethodTypes16))
255 if (SwigDerivedClassHasMethod(
"AcceptDelta", swigMethodTypes17))
257 if (SwigDerivedClassHasMethod(
"AcceptNeighbor", swigMethodTypes18))
259 if (SwigDerivedClassHasMethod(
"AcceptUncheckedNeighbor", swigMethodTypes19))
261 if (SwigDerivedClassHasMethod(
"IsUncheckedSolutionLimitReached", swigMethodTypes20))
263 if (SwigDerivedClassHasMethod(
"PeriodicCheck", swigMethodTypes21))
265 if (SwigDerivedClassHasMethod(
"ProgressPercent", swigMethodTypes22))
267 if (SwigDerivedClassHasMethod(
"Accept", swigMethodTypes23))
269 if (SwigDerivedClassHasMethod(
"Install", swigMethodTypes24))
271 operations_research_constraint_solverPINVOKE.SolutionCollector_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);
274 private bool SwigDerivedClassHasMethod(
string methodName, global::System.Type[] methodTypes) {
275 global::System.Reflection.MethodInfo[] methodInfos = this.GetType().GetMethods(
276 global::System.Reflection.BindingFlags.Public | global::System.Reflection.BindingFlags.NonPublic | global::System.Reflection.BindingFlags.Instance);
277 foreach (global::System.Reflection.MethodInfo methodInfo in methodInfos) {
278 if (methodInfo.DeclaringType ==
null)
281 if (methodInfo.Name != methodName)
284 var parameters = methodInfo.GetParameters();
285 if (parameters.Length != methodTypes.Length)
288 bool parametersMatch =
true;
289 for (var i = 0; i < parameters.Length; i++) {
290 if (parameters[i].ParameterType != methodTypes[i]) {
291 parametersMatch =
false;
296 if (!parametersMatch)
299 if (methodInfo.IsVirtual && (methodInfo.DeclaringType.IsSubclassOf(typeof(SolutionCollector))) &&
300 methodInfo.DeclaringType != methodInfo.GetBaseDefinition().DeclaringType) {
308 private string SwigDirectorMethodToString() {
312 private void SwigDirectorMethodEnterSearch() {
316 private void SwigDirectorMethodRestartSearch() {
320 private void SwigDirectorMethodExitSearch() {
324 private void SwigDirectorMethodBeginNextDecision(global::System.IntPtr b) {
325 BeginNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false));
328 private void SwigDirectorMethodEndNextDecision(global::System.IntPtr b, global::System.IntPtr d) {
329 EndNextDecision((b == global::System.IntPtr.Zero) ?
null :
new DecisionBuilder(b,
false), (d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
332 private void SwigDirectorMethodApplyDecision(global::System.IntPtr d) {
333 ApplyDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
336 private void SwigDirectorMethodRefuteDecision(global::System.IntPtr d) {
337 RefuteDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false));
340 private void SwigDirectorMethodAfterDecision(global::System.IntPtr d,
bool apply) {
341 AfterDecision((d == global::System.IntPtr.Zero) ?
null :
new Decision(d,
false), apply);
344 private void SwigDirectorMethodBeginFail() {
348 private void SwigDirectorMethodEndFail() {
352 private void SwigDirectorMethodBeginInitialPropagation() {
356 private void SwigDirectorMethodEndInitialPropagation() {
360 private bool SwigDirectorMethodAcceptSolution() {
364 private bool SwigDirectorMethodAtSolution() {
368 private void SwigDirectorMethodNoMoreSolutions() {
372 private bool SwigDirectorMethodLocalOptimum() {
376 private bool SwigDirectorMethodAcceptDelta(global::System.IntPtr delta, global::System.IntPtr deltadelta) {
377 return AcceptDelta((delta == global::System.IntPtr.Zero) ?
null :
new Assignment(delta,
false), (deltadelta == global::System.IntPtr.Zero) ?
null :
new Assignment(deltadelta,
false));
380 private void SwigDirectorMethodAcceptNeighbor() {
384 private void SwigDirectorMethodAcceptUncheckedNeighbor() {
388 private bool SwigDirectorMethodIsUncheckedSolutionLimitReached() {
392 private void SwigDirectorMethodPeriodicCheck() {
396 private int SwigDirectorMethodProgressPercent() {
400 private void SwigDirectorMethodAccept(global::System.IntPtr visitor) {
401 Accept((visitor == global::System.IntPtr.Zero) ?
null :
new ModelVisitor(visitor,
false));
404 private void SwigDirectorMethodInstall() {
460 private static global::System.Type[] swigMethodTypes0 =
new global::System.Type[] { };
461 private static global::System.Type[] swigMethodTypes1 =
new global::System.Type[] { };
462 private static global::System.Type[] swigMethodTypes2 =
new global::System.Type[] { };
463 private static global::System.Type[] swigMethodTypes3 =
new global::System.Type[] { };
464 private static global::System.Type[] swigMethodTypes4 =
new global::System.Type[] { typeof(DecisionBuilder) };
465 private static global::System.Type[] swigMethodTypes5 =
new global::System.Type[] { typeof(DecisionBuilder), typeof(Decision) };
466 private static global::System.Type[] swigMethodTypes6 =
new global::System.Type[] { typeof(Decision) };
467 private static global::System.Type[] swigMethodTypes7 =
new global::System.Type[] { typeof(Decision) };
468 private static global::System.Type[] swigMethodTypes8 =
new global::System.Type[] { typeof(Decision), typeof(
bool) };
469 private static global::System.Type[] swigMethodTypes9 =
new global::System.Type[] { };
470 private static global::System.Type[] swigMethodTypes10 =
new global::System.Type[] { };
471 private static global::System.Type[] swigMethodTypes11 =
new global::System.Type[] { };
472 private static global::System.Type[] swigMethodTypes12 =
new global::System.Type[] { };
473 private static global::System.Type[] swigMethodTypes13 =
new global::System.Type[] { };
474 private static global::System.Type[] swigMethodTypes14 =
new global::System.Type[] { };
475 private static global::System.Type[] swigMethodTypes15 =
new global::System.Type[] { };
476 private static global::System.Type[] swigMethodTypes16 =
new global::System.Type[] { };
477 private static global::System.Type[] swigMethodTypes17 =
new global::System.Type[] { typeof(Assignment), typeof(Assignment) };
478 private static global::System.Type[] swigMethodTypes18 =
new global::System.Type[] { };
479 private static global::System.Type[] swigMethodTypes19 =
new global::System.Type[] { };
480 private static global::System.Type[] swigMethodTypes20 =
new global::System.Type[] { };
481 private static global::System.Type[] swigMethodTypes21 =
new global::System.Type[] { };
482 private static global::System.Type[] swigMethodTypes22 =
new global::System.Type[] { };
483 private static global::System.Type[] swigMethodTypes23 =
new global::System.Type[] { typeof(ModelVisitor) };
484 private static global::System.Type[] swigMethodTypes24 =
new global::System.Type[] { };