OR-Tools  7.1
SearchLog.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.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  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_SearchLog(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  public SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, Supplier<String> display_callback, int period) {
43  this(mainJNI.new_SearchLog(Solver.getCPtr(s), s, OptimizeVar.getCPtr(obj), obj, IntVar.getCPtr(var), var, scaling_factor, display_callback, period), true);
44  }
45 
46  public void enterSearch() {
47  mainJNI.SearchLog_enterSearch(swigCPtr, this);
48  }
49 
50  public void exitSearch() {
51  mainJNI.SearchLog_exitSearch(swigCPtr, this);
52  }
53 
54  public boolean atSolution() {
55  return mainJNI.SearchLog_atSolution(swigCPtr, this);
56  }
57 
58  public void beginFail() {
59  mainJNI.SearchLog_beginFail(swigCPtr, this);
60  }
61 
62  public void noMoreSolutions() {
63  mainJNI.SearchLog_noMoreSolutions(swigCPtr, this);
64  }
65 
66  public void AcceptUncheckedNeighbor() {
67  mainJNI.SearchLog_AcceptUncheckedNeighbor(swigCPtr, this);
68  }
69 
70  public void applyDecision(Decision decision) {
71  mainJNI.SearchLog_applyDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
72  }
73 
74  public void refuteDecision(Decision decision) {
75  mainJNI.SearchLog_refuteDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
76  }
77 
78  public void outputDecision() {
79  mainJNI.SearchLog_outputDecision(swigCPtr, this);
80  }
81 
82  public void maintain() {
83  mainJNI.SearchLog_maintain(swigCPtr, this);
84  }
85 
86  public void beginInitialPropagation() {
87  mainJNI.SearchLog_beginInitialPropagation(swigCPtr, this);
88  }
89 
90  public void endInitialPropagation() {
91  mainJNI.SearchLog_endInitialPropagation(swigCPtr, this);
92  }
93 
94  public String toString() {
95  return mainJNI.SearchLog_toString(swigCPtr, this);
96  }
97 
98 }
SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, Supplier< String > display_callback, int period)
Definition: SearchLog.java:42
static long getCPtr(Solver obj)
Definition: Solver.java:63
SearchLog(long cPtr, boolean cMemoryOwn)
Definition: SearchLog.java:18