Google OR-Tools v9.11
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.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
19 private transient long swigCPtr;
20
21 protected IntVarLocalSearchOperator(long cPtr, boolean cMemoryOwn) {
22 super(mainJNI.IntVarLocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn);
23 swigCPtr = cPtr;
24 }
25
26 protected static long getCPtr(IntVarLocalSearchOperator obj) {
27 return (obj == null) ? 0 : obj.swigCPtr;
28 }
29
30 protected 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 public IntVarLocalSearchOperator(IntVar[] vars, boolean keep_inverse_values) {
74 this(mainJNI.new_IntVarLocalSearchOperator__SWIG_0(vars, keep_inverse_values), true);
75 mainJNI.IntVarLocalSearchOperator_director_connect(this, swigCPtr, true, true);
76 }
77
79 this(mainJNI.new_IntVarLocalSearchOperator__SWIG_1(vars), true);
80 mainJNI.IntVarLocalSearchOperator_director_connect(this, swigCPtr, true, true);
81 }
82
83 public boolean HoldsDelta() {
84 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_HoldsDelta(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_HoldsDeltaSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
85 }
86
91 public void start(Assignment assignment) {
92 if (getClass() == IntVarLocalSearchOperator.class) mainJNI.IntVarLocalSearchOperator_start(swigCPtr, this, Assignment.getCPtr(assignment), assignment); else mainJNI.IntVarLocalSearchOperator_startSwigExplicitIntVarLocalSearchOperator(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
93 }
94
95 public boolean isIncremental() {
96 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_isIncremental(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_isIncrementalSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
97 }
98
99 public int size() {
100 return mainJNI.IntVarLocalSearchOperator_size(swigCPtr, this);
101 }
102
107 public long value(long index) {
108 return mainJNI.IntVarLocalSearchOperator_value(swigCPtr, this, index);
109 }
110
114 public IntVar var(long index) {
115 long cPtr = mainJNI.IntVarLocalSearchOperator_var(swigCPtr, this, index);
116 return (cPtr == 0) ? null : new IntVar(cPtr, false);
117 }
118
119 public boolean SkipUnchanged(int index) {
120 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_SkipUnchanged(swigCPtr, this, index) : mainJNI.IntVarLocalSearchOperator_SkipUnchangedSwigExplicitIntVarLocalSearchOperator(swigCPtr, this, index);
121 }
122
123 public long oldValue(long index) {
124 return mainJNI.IntVarLocalSearchOperator_oldValue(swigCPtr, this, index);
125 }
126
127 public long PrevValue(long index) {
128 return mainJNI.IntVarLocalSearchOperator_PrevValue(swigCPtr, this, index);
129 }
130
131 public void setValue(long index, long value) {
132 mainJNI.IntVarLocalSearchOperator_setValue(swigCPtr, this, index, value);
133 }
134
135 public boolean activated(long index) {
136 return mainJNI.IntVarLocalSearchOperator_activated(swigCPtr, this, index);
137 }
138
139 public void activate(long index) {
140 mainJNI.IntVarLocalSearchOperator_activate(swigCPtr, this, index);
141 }
142
143 public void deactivate(long index) {
144 mainJNI.IntVarLocalSearchOperator_deactivate(swigCPtr, this, index);
145 }
146
147 public boolean ApplyChanges(Assignment delta, Assignment deltadelta) {
148 return mainJNI.IntVarLocalSearchOperator_ApplyChanges(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
149 }
150
151 public void RevertChanges(boolean change_was_incremental) {
152 mainJNI.IntVarLocalSearchOperator_RevertChanges(swigCPtr, this, change_was_incremental);
153 }
154
155 public void addVars(IntVar[] vars) {
156 mainJNI.IntVarLocalSearchOperator_addVars(swigCPtr, this, vars);
157 }
158
164 public void onStart() {
165 if (getClass() == IntVarLocalSearchOperator.class) mainJNI.IntVarLocalSearchOperator_onStart(swigCPtr, this); else mainJNI.IntVarLocalSearchOperator_onStartSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
166 }
167
173 protected boolean oneNeighbor() {
174 return (getClass() == IntVarLocalSearchOperator.class) ? mainJNI.IntVarLocalSearchOperator_oneNeighbor(swigCPtr, this) : mainJNI.IntVarLocalSearchOperator_oneNeighborSwigExplicitIntVarLocalSearchOperator(swigCPtr, this);
175 }
176
177}
boolean ApplyChanges(Assignment delta, Assignment deltadelta)
IntVarLocalSearchOperator(IntVar[] vars, boolean keep_inverse_values)