SearchLog.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.0
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 
11 // Used to wrap DisplayCallback (std::function<std::string()>)
12 // see https://docs.oracle.com/javase/8/docs/api/java/util/function/Supplier.html
13 import java.util.function.Supplier;
14 
15 public class SearchLog extends SearchMonitor {
16  private transient long swigCPtr;
17 
18  protected SearchLog(long cPtr, boolean cMemoryOwn) {
19  super(mainJNI.SearchLog_SWIGUpcast(cPtr), cMemoryOwn);
20  swigCPtr = cPtr;
21  }
22 
23  protected static long getCPtr(SearchLog 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_SearchLog(swigCPtr);
37  }
38  swigCPtr = 0;
39  }
40  super.delete();
41  }
42 
43  public SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, Supplier<String> display_callback, int period) {
44  this(mainJNI.new_SearchLog(Solver.getCPtr(s), s, OptimizeVar.getCPtr(obj), obj, IntVar.getCPtr(var), var, scaling_factor, display_callback, period), true);
45  }
46 
47  public void enterSearch() {
48  mainJNI.SearchLog_enterSearch(swigCPtr, this);
49  }
50 
51  public void exitSearch() {
52  mainJNI.SearchLog_exitSearch(swigCPtr, this);
53  }
54 
55  public boolean atSolution() {
56  return mainJNI.SearchLog_atSolution(swigCPtr, this);
57  }
58 
59  public void beginFail() {
60  mainJNI.SearchLog_beginFail(swigCPtr, this);
61  }
62 
63  public void noMoreSolutions() {
64  mainJNI.SearchLog_noMoreSolutions(swigCPtr, this);
65  }
66 
67  public void AcceptUncheckedNeighbor() {
68  mainJNI.SearchLog_AcceptUncheckedNeighbor(swigCPtr, this);
69  }
70 
71  public void applyDecision(Decision decision) {
72  mainJNI.SearchLog_applyDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
73  }
74 
75  public void refuteDecision(Decision decision) {
76  mainJNI.SearchLog_refuteDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
77  }
78 
79  public void outputDecision() {
80  mainJNI.SearchLog_outputDecision(swigCPtr, this);
81  }
82 
83  public void maintain() {
84  mainJNI.SearchLog_maintain(swigCPtr, this);
85  }
86 
87  public void beginInitialPropagation() {
88  mainJNI.SearchLog_beginInitialPropagation(swigCPtr, this);
89  }
90 
91  public void endInitialPropagation() {
92  mainJNI.SearchLog_endInitialPropagation(swigCPtr, this);
93  }
94 
95  public String toString() {
96  return mainJNI.SearchLog_toString(swigCPtr, this);
97  }
98 
99 }
SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, Supplier< String > display_callback, int period)
Definition: SearchLog.java:43
SearchLog(long cPtr, boolean cMemoryOwn)
Definition: SearchLog.java:18