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.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 SolutionPool extends BaseObject {
15  private transient long swigCPtr;
16 
17  protected SolutionPool(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.SolutionPool_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(SolutionPool 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_SolutionPool(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
45  public void initialize(Assignment assignment) {
46  mainJNI.SolutionPool_initialize(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
47  }
48 
52  public void registerNewSolution(Assignment assignment) {
53  mainJNI.SolutionPool_registerNewSolution(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
54  }
55 
59  public void getNextSolution(Assignment assignment) {
60  mainJNI.SolutionPool_getNextSolution(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
61  }
62 
66  public boolean syncNeeded(Assignment local_assignment) {
67  return mainJNI.SolutionPool_syncNeeded(swigCPtr, this, Assignment.getCPtr(local_assignment), local_assignment);
68  }
69 
70 }
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 assig...
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:14
A BaseObject is the root of all reversibly allocated objects.
Definition: BaseObject.java:14
void registerNewSolution(Assignment assignment)
This method is called when a new solution has been accepted by the local search.