Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
LocalSearchOperator.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
29public class LocalSearchOperator extends BaseObject {
30 private transient long swigCPtr;
31
32 protected LocalSearchOperator(long cPtr, boolean cMemoryOwn) {
33 super(mainJNI.LocalSearchOperator_SWIGUpcast(cPtr), cMemoryOwn);
34 swigCPtr = cPtr;
35 }
36
37 protected static long getCPtr(LocalSearchOperator obj) {
38 return (obj == null) ? 0 : obj.swigCPtr;
39 }
40
41 protected static long swigRelease(LocalSearchOperator obj) {
42 long ptr = 0;
43 if (obj != null) {
44 if (!obj.swigCMemOwn)
45 throw new RuntimeException("Cannot release ownership as memory is not owned");
46 ptr = obj.swigCPtr;
47 obj.swigCMemOwn = false;
48 obj.delete();
49 }
50 return ptr;
51 }
52
53 @SuppressWarnings({"deprecation", "removal"})
54 protected void finalize() {
55 delete();
56 }
57
58 public synchronized void delete() {
59 if (swigCPtr != 0) {
60 if (swigCMemOwn) {
61 swigCMemOwn = false;
62 mainJNI.delete_LocalSearchOperator(swigCPtr);
63 }
64 swigCPtr = 0;
65 }
66 super.delete();
67 }
68
69 protected void swigDirectorDisconnect() {
70 swigCMemOwn = false;
71 delete();
72 }
73
74 public void swigReleaseOwnership() {
75 swigCMemOwn = false;
76 mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, false);
77 }
78
79 public void swigTakeOwnership() {
80 swigCMemOwn = true;
81 mainJNI.LocalSearchOperator_change_ownership(this, swigCPtr, true);
82 }
83
85 this(mainJNI.new_LocalSearchOperator(), true);
86 mainJNI.LocalSearchOperator_director_connect(this, swigCPtr, true, true);
87 }
88
89 public boolean nextNeighbor(Assignment delta, Assignment deltadelta) {
90 return mainJNI.LocalSearchOperator_nextNeighbor(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
91 }
92
93 public void start(Assignment assignment) {
94 mainJNI.LocalSearchOperator_start(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
95 }
96
97 public void reset() {
98 if (getClass() == LocalSearchOperator.class) mainJNI.LocalSearchOperator_reset(swigCPtr, this); else mainJNI.LocalSearchOperator_resetSwigExplicitLocalSearchOperator(swigCPtr, this);
99 }
100
101 public boolean HasFragments() {
102 return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HasFragments(swigCPtr, this) : mainJNI.LocalSearchOperator_HasFragmentsSwigExplicitLocalSearchOperator(swigCPtr, this);
103 }
104
105 public boolean HoldsDelta() {
106 return (getClass() == LocalSearchOperator.class) ? mainJNI.LocalSearchOperator_HoldsDelta(swigCPtr, this) : mainJNI.LocalSearchOperator_HoldsDeltaSwigExplicitLocalSearchOperator(swigCPtr, this);
107 }
108
109}
boolean nextNeighbor(Assignment delta, Assignment deltadelta)