Google OR-Tools v9.15
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
IntVarLocalSearchOperator.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.4.0
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
19 private transient long swigCPtr;
20
21 public IntVarLocalSearchOperator(long cPtr, boolean cMemoryOwn) {
22 super(mainJNI.IntVarLocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn);
23 swigCPtr = cPtr;
24 }
25
26 public static long getCPtr(IntVarLocalSearchOperator obj) {
27 return (obj == null) ? 0 : obj.swigCPtr;
28 }
29
30 public static long swigRelease(IntVarLocalSearchOperator obj) {
31 long ptr = 0;
32 if (obj != null) {
33 if (!obj.swigCMemOwn)
34 throw new RuntimeException("Cannot release ownership as memory is not owned");
35 ptr = obj.swigCPtr;
36 obj.swigCMemOwn = false;
37 obj.delete();
38 }
39 return ptr;
40 }
41
42 @SuppressWarnings({"deprecation", "removal"})
43 protected void finalize() {
44 delete();
45 }
46
47 public synchronized void delete() {
48 if (swigCPtr != 0) {
49 if (swigCMemOwn) {
50 swigCMemOwn = false;
51 mainJNI.delete_IntVarLocalSearchOperator(swigCPtr);
52 }
53 swigCPtr = 0;
54 }
55 super.delete();
56 }
57
58 protected void swigDirectorDisconnect() {
59 swigCMemOwn = false;
60 delete();
61 }
62
63 public void swigReleaseOwnership() {
64 swigCMemOwn = false;
65 mainJNI.IntVarLocalSearchOperator_change_ownership(this, swigCPtr, false);
66 }
67
68 public void swigTakeOwnership() {
69 swigCMemOwn = true;
70 mainJNI.IntVarLocalSearchOperator_change_ownership(this, swigCPtr, true);
71 }
72
73 @SuppressWarnings("this-escape")
74 public IntVarLocalSearchOperator(IntVar[] vars, boolean keep_inverse_values) {
75 this(mainJNI.new_IntVarLocalSearchOperator__SWIG_0(vars, keep_inverse_values), true);
76 mainJNI.IntVarLocalSearchOperator_director_connect(this, swigCPtr, true, true);
77 }
78
79 @SuppressWarnings("this-escape")
81 this(mainJNI.new_IntVarLocalSearchOperator__SWIG_1(vars), true);
82 mainJNI.IntVarLocalSearchOperator_director_connect(this, swigCPtr, true, true);
83 }
84
85 public boolean HoldsDelta() {
86 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_HoldsDelta(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_HoldsDeltaSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
87 }
88
93 public void start(Assignment assignment) {
94 if (getClass() == IntVarLocalSearchOperator.class) mainJNI.IntVarLocalSearchOperator_start(swigCPtr, this, Assignment.getCPtr(assignment), assignment); else mainJNI.IntVarLocalSearchOperator_startSwigExplicitIntVarLocalSearchOperator(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
95 }
96
97 public boolean isIncremental() {
98 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_isIncremental(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_isIncrementalSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
99 }
100
101 public int size() {
102 return mainJNI.IntVarLocalSearchOperator_size(swigCPtr, this);
103 }
104
109 public long value(long index) {
110 return mainJNI.IntVarLocalSearchOperator_value(swigCPtr, this, index);
111 }
112
116 public IntVar var(long index) {
117 long cPtr = mainJNI.IntVarLocalSearchOperator_var(swigCPtr, this, index);
118 return (cPtr == 0) ? null : new IntVar(cPtr, false);
119 }
120
121 public boolean SkipUnchanged(int arg0) {
122 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_SkipUnchanged(swigCPtr, this, arg0) : mainJNI.IntVarLocalSearchOperator_SkipUnchangedSwigExplicitIntVarLocalSearchOperator(swigCPtr, this, arg0);
123 }
124
125 public long oldValue(long index) {
126 return mainJNI.IntVarLocalSearchOperator_oldValue(swigCPtr, this, index);
127 }
128
129 public long PrevValue(long index) {
130 return mainJNI.IntVarLocalSearchOperator_PrevValue(swigCPtr, this, index);
131 }
132
133 public void setValue(long index, long value) {
134 mainJNI.IntVarLocalSearchOperator_setValue(swigCPtr, this, index, value);
135 }
136
137 public boolean activated(long index) {
138 return mainJNI.IntVarLocalSearchOperator_activated(swigCPtr, this, index);
139 }
140
141 public void activate(long index) {
142 mainJNI.IntVarLocalSearchOperator_activate(swigCPtr, this, index);
143 }
144
145 public void deactivate(long index) {
146 mainJNI.IntVarLocalSearchOperator_deactivate(swigCPtr, this, index);
147 }
148
149 public boolean ApplyChanges(Assignment delta, Assignment deltadelta) {
150 return mainJNI.IntVarLocalSearchOperator_ApplyChanges(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
151 }
152
153 public void RevertChanges(boolean change_was_incremental) {
154 mainJNI.IntVarLocalSearchOperator_RevertChanges(swigCPtr, this, change_was_incremental);
155 }
156
157 public void addVars(IntVar[] vars) {
158 mainJNI.IntVarLocalSearchOperator_addVars(swigCPtr, this, vars);
159 }
160
166 public void onStart() {
167 if (getClass() == IntVarLocalSearchOperator.class) mainJNI.IntVarLocalSearchOperator_onStart(swigCPtr, this); else mainJNI.IntVarLocalSearchOperator_onStartSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
168 }
169
175 protected boolean oneNeighbor() {
176 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_oneNeighbor(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_oneNeighborSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
177 }
178
179}
boolean ApplyChanges(Assignment delta, Assignment deltadelta)