Java Reference

Java Reference

LocalSearchFilter.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.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 
9 package com.google.ortools.constraintsolver;
10 
14 public class LocalSearchFilter extends BaseObject {
15  private transient long swigCPtr;
16 
17  protected LocalSearchFilter(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.LocalSearchFilter_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(LocalSearchFilter obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_LocalSearchFilter(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  protected void swigDirectorDisconnect() {
43  swigCMemOwn = false;
44  delete();
45  }
46 
47  public void swigReleaseOwnership() {
48  swigCMemOwn = false;
49  mainJNI.LocalSearchFilter_change_ownership(this, swigCPtr, false);
50  }
51 
52  public void swigTakeOwnership() {
53  swigCMemOwn = true;
54  mainJNI.LocalSearchFilter_change_ownership(this, swigCPtr, true);
55  }
56 
60  public void Relax(Assignment delta, Assignment deltadelta) {
61  if (getClass() == LocalSearchFilter.class) mainJNI.LocalSearchFilter_Relax(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta); else mainJNI.LocalSearchFilter_RelaxSwigExplicitLocalSearchFilter(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
62  }
63 
67  public boolean accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max) {
68  return mainJNI.LocalSearchFilter_accept(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta, objective_min, objective_max);
69  }
70 
71  public boolean isIncremental() {
72  return (getClass() == LocalSearchFilter.class) ? mainJNI.LocalSearchFilter_isIncremental(swigCPtr, this) : mainJNI.LocalSearchFilter_isIncrementalSwigExplicitLocalSearchFilter(swigCPtr, this);
73  }
74 
78  public void synchronize(Assignment assignment, Assignment delta) {
79  mainJNI.LocalSearchFilter_synchronize(swigCPtr, this, Assignment.getCPtr(assignment), assignment, Assignment.getCPtr(delta), delta);
80  }
81 
85  public void Revert() {
86  if (getClass() == LocalSearchFilter.class) mainJNI.LocalSearchFilter_Revert(swigCPtr, this); else mainJNI.LocalSearchFilter_RevertSwigExplicitLocalSearchFilter(swigCPtr, this);
87  }
88 
93  return (getClass() == LocalSearchFilter.class) ? mainJNI.LocalSearchFilter_getSynchronizedObjectiveValue(swigCPtr, this) : mainJNI.LocalSearchFilter_getSynchronizedObjectiveValueSwigExplicitLocalSearchFilter(swigCPtr, this);
94  }
95 
99  public long getAcceptedObjectiveValue() {
100  return (getClass() == LocalSearchFilter.class) ? mainJNI.LocalSearchFilter_getAcceptedObjectiveValue(swigCPtr, this) : mainJNI.LocalSearchFilter_getAcceptedObjectiveValueSwigExplicitLocalSearchFilter(swigCPtr, this);
101  }
102 
103  public LocalSearchFilter() {
104  this(mainJNI.new_LocalSearchFilter(), true);
105  mainJNI.LocalSearchFilter_director_connect(this, swigCPtr, true, true);
106  }
107 
108 }
boolean isIncremental()
LocalSearchFilter(long cPtr, boolean cMemoryOwn)
LocalSearchFilter()
long getSynchronizedObjectiveValue()
Objective value from last time Synchronize() was called.
void Revert()
Cancels the changes made by the last Relax()/Accept() calls.
void Relax(Assignment delta, Assignment deltadelta)
Lets the filter know what delta and deltadelta will be passed in the next Accept().
void swigTakeOwnership()
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition: Assignment.java:14
void synchronize(Assignment assignment, Assignment delta)
Synchronizes the filter with the current solution, delta being the difference with the solution passe...
void swigDirectorDisconnect()
long getAcceptedObjectiveValue()
Objective value from the last time Accept() was called and returned true.
Local Search Filters are used for fast neighbor pruning.
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:14
boolean accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds t...
void swigReleaseOwnership()