OR-Tools  7.1
SolutionCallback.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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.sat;
10 
11 public class SolutionCallback {
12  private transient long swigCPtr;
13  protected transient boolean swigCMemOwn;
14 
15  protected SolutionCallback(long cPtr, boolean cMemoryOwn) {
16  swigCMemOwn = cMemoryOwn;
17  swigCPtr = cPtr;
18  }
19 
20  protected static long getCPtr(SolutionCallback obj) {
21  return (obj == null) ? 0 : obj.swigCPtr;
22  }
23 
24  protected void finalize() {
25  delete();
26  }
27 
28  public synchronized void delete() {
29  if (swigCPtr != 0) {
30  if (swigCMemOwn) {
31  swigCMemOwn = false;
32  mainJNI.delete_SolutionCallback(swigCPtr);
33  }
34  swigCPtr = 0;
35  }
36  }
37 
38  protected void swigDirectorDisconnect() {
39  swigCMemOwn = false;
40  delete();
41  }
42 
43  public void swigReleaseOwnership() {
44  swigCMemOwn = false;
45  mainJNI.SolutionCallback_change_ownership(this, swigCPtr, false);
46  }
47 
48  public void swigTakeOwnership() {
49  swigCMemOwn = true;
50  mainJNI.SolutionCallback_change_ownership(this, swigCPtr, true);
51  }
52 
53  public void onSolutionCallback() {
54  mainJNI.SolutionCallback_onSolutionCallback(swigCPtr, this);
55  }
56 
57  public long numBooleans() {
58  return mainJNI.SolutionCallback_numBooleans(swigCPtr, this);
59  }
60 
61  public long numBranches() {
62  return mainJNI.SolutionCallback_numBranches(swigCPtr, this);
63  }
64 
65  public long numConflicts() {
66  return mainJNI.SolutionCallback_numConflicts(swigCPtr, this);
67  }
68 
69  public long numBinaryPropagations() {
70  return mainJNI.SolutionCallback_numBinaryPropagations(swigCPtr, this);
71  }
72 
73  public long numIntegerPropagations() {
74  return mainJNI.SolutionCallback_numIntegerPropagations(swigCPtr, this);
75  }
76 
77  public double wallTime() {
78  return mainJNI.SolutionCallback_wallTime(swigCPtr, this);
79  }
80 
81  public double userTime() {
82  return mainJNI.SolutionCallback_userTime(swigCPtr, this);
83  }
84 
85  public double objectiveValue() {
86  return mainJNI.SolutionCallback_objectiveValue(swigCPtr, this);
87  }
88 
89  public double bestObjectiveBound() {
90  return mainJNI.SolutionCallback_bestObjectiveBound(swigCPtr, this);
91  }
92 
93  public long solutionIntegerValue(int index) {
94  return mainJNI.SolutionCallback_solutionIntegerValue(swigCPtr, this, index);
95  }
96 
97  public boolean solutionBooleanValue(int index) {
98  return mainJNI.SolutionCallback_solutionBooleanValue(swigCPtr, this, index);
99  }
100 
101  public void stopSearch() {
102  mainJNI.SolutionCallback_stopSearch(swigCPtr, this);
103  }
104 
105  public SolutionCallback() {
106  this(mainJNI.new_SolutionCallback(), true);
107  mainJNI.SolutionCallback_director_connect(this, swigCPtr, swigCMemOwn, true);
108  }
109 
110 }
SolutionCallback(long cPtr, boolean cMemoryOwn)
static long getCPtr(SolutionCallback obj)