Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
LocalSearchFilterManager.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.1
4 *
5 * Do not make changes to this file unless you know what you are doing - modify
6 * the SWIG interface file instead.
7 * ----------------------------------------------------------------------------- */
8
9package com.google.ortools.constraintsolver;
10
17 private transient long swigCPtr;
18
19 protected LocalSearchFilterManager(long cPtr, boolean cMemoryOwn) {
20 super(mainJNI.LocalSearchFilterManager_SWIGUpcast(cPtr), cMemoryOwn);
21 swigCPtr = cPtr;
22 }
23
24 protected static long getCPtr(LocalSearchFilterManager obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
26 }
27
28 protected static long swigRelease(LocalSearchFilterManager obj) {
29 long ptr = 0;
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new RuntimeException("Cannot release ownership as memory is not owned");
33 ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.delete();
36 }
37 return ptr;
38 }
39
40 @SuppressWarnings({"deprecation", "removal"})
41 protected void finalize() {
42 delete();
43 }
44
45 public synchronized void delete() {
46 if (swigCPtr != 0) {
47 if (swigCMemOwn) {
48 swigCMemOwn = false;
49 mainJNI.delete_LocalSearchFilterManager(swigCPtr);
50 }
51 swigCPtr = 0;
52 }
53 super.delete();
54 }
55
56 protected void swigDirectorDisconnect() {
57 swigCMemOwn = false;
58 delete();
59 }
60
61 public void swigReleaseOwnership() {
62 swigCMemOwn = false;
63 mainJNI.LocalSearchFilterManager_change_ownership(this, swigCPtr, false);
64 }
65
66 public void swigTakeOwnership() {
67 swigCMemOwn = true;
68 mainJNI.LocalSearchFilterManager_change_ownership(this, swigCPtr, true);
69 }
70
71 static public class FilterEvent {
72 private transient long swigCPtr;
73 protected transient boolean swigCMemOwn;
74
75 protected FilterEvent(long cPtr, boolean cMemoryOwn) {
76 swigCMemOwn = cMemoryOwn;
77 swigCPtr = cPtr;
78 }
79
80 protected static long getCPtr(FilterEvent obj) {
81 return (obj == null) ? 0 : obj.swigCPtr;
82 }
83
84 protected static long swigRelease(FilterEvent obj) {
85 long ptr = 0;
86 if (obj != null) {
87 if (!obj.swigCMemOwn)
88 throw new RuntimeException("Cannot release ownership as memory is not owned");
89 ptr = obj.swigCPtr;
90 obj.swigCMemOwn = false;
91 obj.delete();
92 }
93 return ptr;
94 }
95
96 @SuppressWarnings({"deprecation", "removal"})
97 protected void finalize() {
98 delete();
99 }
100
101 public synchronized void delete() {
102 if (swigCPtr != 0) {
103 if (swigCMemOwn) {
104 swigCMemOwn = false;
105 mainJNI.delete_LocalSearchFilterManager_FilterEvent(swigCPtr);
106 }
107 swigCPtr = 0;
108 }
109 }
110
111 public void setFilter(LocalSearchFilter value) {
112 mainJNI.LocalSearchFilterManager_FilterEvent_filter_set(swigCPtr, this, LocalSearchFilter.getCPtr(value), value);
113 }
114
116 long cPtr = mainJNI.LocalSearchFilterManager_FilterEvent_filter_get(swigCPtr, this);
117 return (cPtr == 0) ? null : new LocalSearchFilter(cPtr, false);
118 }
119
120 public void setEventType(int value) {
121 mainJNI.LocalSearchFilterManager_FilterEvent_eventType_set(swigCPtr, this, value);
122 }
123
124 public int getEventType() {
125 return mainJNI.LocalSearchFilterManager_FilterEvent_eventType_get(swigCPtr, this);
126 }
127
128 public void setPriority(int value) {
129 mainJNI.LocalSearchFilterManager_FilterEvent_priority_set(swigCPtr, this, value);
130 }
131
132 public int getPriority() {
133 return mainJNI.LocalSearchFilterManager_FilterEvent_priority_get(swigCPtr, this);
134 }
135
136 public FilterEvent() {
137 this(mainJNI.new_LocalSearchFilterManager_FilterEvent(), true);
138 }
139
140 }
141
142 public String toString() {
143 return (getClass() == LocalSearchFilterManager.class) ? mainJNI.LocalSearchFilterManager_toString(swigCPtr, this) : mainJNI.LocalSearchFilterManager_toStringSwigExplicitLocalSearchFilterManager(swigCPtr, this);
144 }
145
146 public LocalSearchFilterManager(SWIGTYPE_p_std__vectorT_operations_research__LocalSearchFilterManager__FilterEvent_t filter_events) {
147 this(mainJNI.new_LocalSearchFilterManager__SWIG_0(SWIGTYPE_p_std__vectorT_operations_research__LocalSearchFilterManager__FilterEvent_t.getCPtr(filter_events)), true);
148 mainJNI.LocalSearchFilterManager_director_connect(this, swigCPtr, true, true);
149 }
150
152 this(mainJNI.new_LocalSearchFilterManager__SWIG_1(filters), true);
153 mainJNI.LocalSearchFilterManager_director_connect(this, swigCPtr, true, true);
154 }
155
156 public void Revert() {
157 mainJNI.LocalSearchFilterManager_Revert(swigCPtr, this);
158 }
159
165 public boolean accept(LocalSearchMonitor monitor, Assignment delta, Assignment deltadelta, long objective_min, long objective_max) {
166 return mainJNI.LocalSearchFilterManager_accept(swigCPtr, this, LocalSearchMonitor.getCPtr(monitor), monitor, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta, objective_min, objective_max);
167 }
168
172 public void synchronize(Assignment assignment, Assignment delta) {
173 mainJNI.LocalSearchFilterManager_synchronize(swigCPtr, this, Assignment.getCPtr(assignment), assignment, Assignment.getCPtr(delta), delta);
174 }
175
177 return mainJNI.LocalSearchFilterManager_GetSynchronizedObjectiveValue(swigCPtr, this);
178 }
179
181 return mainJNI.LocalSearchFilterManager_GetAcceptedObjectiveValue(swigCPtr, this);
182 }
183
184 // FilterEventType
185 public final static int kAccept = mainJNI.LocalSearchFilterManager_kAccept_get();
186 public final static int kRelax = mainJNI.LocalSearchFilterManager_kRelax_get();
187
188}
boolean accept(LocalSearchMonitor monitor, Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
LocalSearchFilterManager(SWIGTYPE_p_std__vectorT_operations_research__LocalSearchFilterManager__FilterEvent_t filter_events)