Java Reference

Java Reference

SolutionPool.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.2
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 
15 public class SolutionPool extends BaseObject {
16  private transient long swigCPtr;
17 
18  protected SolutionPool(long cPtr, boolean cMemoryOwn) {
19  super(mainJNI.SolutionPool_SWIGUpcast(cPtr), cMemoryOwn);
20  swigCPtr = cPtr;
21  }
22 
23  protected static long getCPtr(SolutionPool obj) {
24  return (obj == null) ? 0 : obj.swigCPtr;
25  }
26 
27  @SuppressWarnings("deprecation")
28  protected void finalize() {
29  delete();
30  }
31 
32  public synchronized void delete() {
33  if (swigCPtr != 0) {
34  if (swigCMemOwn) {
35  swigCMemOwn = false;
36  mainJNI.delete_SolutionPool(swigCPtr);
37  }
38  swigCPtr = 0;
39  }
40  super.delete();
41  }
42 
47  public void initialize(Assignment assignment) {
48  mainJNI.SolutionPool_initialize(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
49  }
50 
55  public void registerNewSolution(Assignment assignment) {
56  mainJNI.SolutionPool_registerNewSolution(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
57  }
58 
63  public void getNextSolution(Assignment assignment) {
64  mainJNI.SolutionPool_getNextSolution(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
65  }
66 
71  public boolean syncNeeded(Assignment local_assignment) {
72  return mainJNI.SolutionPool_syncNeeded(swigCPtr, this, Assignment.getCPtr(local_assignment), local_assignment);
73  }
74 
75 }
SolutionPool(long cPtr, boolean cMemoryOwn)
void getNextSolution(Assignment assignment)
This method is called when the local search starts a new neighborhood to initialize the default assi...
This class is used to manage a pool of solutions.
void initialize(Assignment assignment)
This method is called to initialize the solution pool with the assignment from the local search.
boolean syncNeeded(Assignment local_assignment)
This method checks if the local solution needs to be updated with an external one.
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition: Assignment.java:15
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:16
void registerNewSolution(Assignment assignment)
This method is called when a new solution has been accepted by the local search.