Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ObjectiveMonitor.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 ObjectiveMonitor : SearchMonitor {
19 private global::System.Runtime.InteropServices.HandleRef swigCPtr;
21 internal ObjectiveMonitor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(operations_research_constraint_solverPINVOKE.ObjectiveMonitor_SWIGUpcast(cPtr), cMemoryOwn) {
22 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
23 }
24
25 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ObjectiveMonitor 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(ObjectiveMonitor 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 ObjectiveMonitor(Solver solver, SWIGTYPE_p_std__vectorT_bool_t maximize, IntVarVector vars, long[] steps) : this(operations_research_constraint_solverPINVOKE.new_ObjectiveMonitor(Solver.getCPtr(solver), SWIGTYPE_p_std__vectorT_bool_t.getCPtr(maximize), IntVarVector.getCPtr(vars), steps.Length, steps ), true) {
56 if (operations_research_constraint_solverPINVOKE.SWIGPendingException.Pending) throw operations_research_constraint_solverPINVOKE.SWIGPendingException.Retrieve();
57 }
58
59 public IntVar ObjectiveVar(int index) {
60 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.ObjectiveMonitor_ObjectiveVar(swigCPtr, index);
61 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
62 return ret;
63 }
64
65 public IntVar MinimizationVar(int index) {
66 global::System.IntPtr cPtr = operations_research_constraint_solverPINVOKE.ObjectiveMonitor_MinimizationVar(swigCPtr, index);
67 IntVar ret = (cPtr == global::System.IntPtr.Zero) ? null : new IntVar(cPtr, false);
68 return ret;
69 }
70
71 public long Step(int index) {
73 return ret;
74 }
75
76 public bool Maximize(int index) {
78 return ret;
79 }
80
81 public long BestValue(int index) {
83 return ret;
84 }
85
86 public int Size() {
88 return ret;
89 }
90
91 public override void EnterSearch() {
93 }
94
95 public override bool AtSolution() {
97 return ret;
98 }
99
100 public override bool AcceptDelta(Assignment delta, Assignment deltadelta) {
101 bool ret = operations_research_constraint_solverPINVOKE.ObjectiveMonitor_AcceptDelta(swigCPtr, Assignment.getCPtr(delta), Assignment.getCPtr(deltadelta));
102 return ret;
103 }
104
105 public override void Accept(ModelVisitor visitor) {
108
109}
110
111}
override bool AcceptDelta(Assignment delta, Assignment deltadelta)
override void Accept(ModelVisitor visitor)
static global::System.IntPtr ObjectiveMonitor_MinimizationVar(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static long ObjectiveMonitor_Step(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static long ObjectiveMonitor_BestValue(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static bool ObjectiveMonitor_AtSolution(global::System.Runtime.InteropServices.HandleRef jarg1)
static void delete_ObjectiveMonitor(global::System.Runtime.InteropServices.HandleRef jarg1)
static void ObjectiveMonitor_EnterSearch(global::System.Runtime.InteropServices.HandleRef jarg1)
static global::System.IntPtr ObjectiveMonitor_ObjectiveVar(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static void ObjectiveMonitor_Accept(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2)
static bool ObjectiveMonitor_AcceptDelta(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3)
static bool ObjectiveMonitor_Maximize(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2)
static int ObjectiveMonitor_Size(global::System.Runtime.InteropServices.HandleRef jarg1)