Java Reference

Java Reference

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.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 
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 
18 public class SearchLog extends SearchMonitor {
19  private transient long swigCPtr;
20 
21  protected SearchLog(long cPtr, boolean cMemoryOwn) {
22  super(mainJNI.SearchLog_SWIGUpcast(cPtr), cMemoryOwn);
23  swigCPtr = cPtr;
24  }
25 
26  protected static long getCPtr(SearchLog obj) {
27  return (obj == null) ? 0 : obj.swigCPtr;
28  }
29 
30  @SuppressWarnings("deprecation")
31  protected void finalize() {
32  delete();
33  }
34 
35  public synchronized void delete() {
36  if (swigCPtr != 0) {
37  if (swigCMemOwn) {
38  swigCMemOwn = false;
39  mainJNI.delete_SearchLog(swigCPtr);
40  }
41  swigCPtr = 0;
42  }
43  super.delete();
44  }
45 
46  public SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, double offset, Supplier<String> display_callback, int period) {
47  this(mainJNI.new_SearchLog(Solver.getCPtr(s), s, OptimizeVar.getCPtr(obj), obj, IntVar.getCPtr(var), var, scaling_factor, offset, display_callback, period), true);
48  }
49 
50  public void enterSearch() {
51  mainJNI.SearchLog_enterSearch(swigCPtr, this);
52  }
53 
54  public void exitSearch() {
55  mainJNI.SearchLog_exitSearch(swigCPtr, this);
56  }
57 
58  public boolean atSolution() {
59  return mainJNI.SearchLog_atSolution(swigCPtr, this);
60  }
61 
62  public void beginFail() {
63  mainJNI.SearchLog_beginFail(swigCPtr, this);
64  }
65 
66  public void noMoreSolutions() {
67  mainJNI.SearchLog_noMoreSolutions(swigCPtr, this);
68  }
69 
70  public void AcceptUncheckedNeighbor() {
71  mainJNI.SearchLog_AcceptUncheckedNeighbor(swigCPtr, this);
72  }
73 
74  public void applyDecision(Decision decision) {
75  mainJNI.SearchLog_applyDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
76  }
77 
78  public void refuteDecision(Decision decision) {
79  mainJNI.SearchLog_refuteDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
80  }
81 
82  public void outputDecision() {
83  mainJNI.SearchLog_outputDecision(swigCPtr, this);
84  }
85 
86  public void maintain() {
87  mainJNI.SearchLog_maintain(swigCPtr, this);
88  }
89 
90  public void beginInitialPropagation() {
91  mainJNI.SearchLog_beginInitialPropagation(swigCPtr, this);
92  }
93 
94  public void endInitialPropagation() {
95  mainJNI.SearchLog_endInitialPropagation(swigCPtr, this);
96  }
97 
98  public String toString() {
99  return mainJNI.SearchLog_toString(swigCPtr, this);
100  }
101 
102 }
This class encapsulates an objective.
void endInitialPropagation()
After the initial propagation.
Definition: SearchLog.java:94
void beginInitialPropagation()
Before the initial propagation.
Definition: SearchLog.java:90
The class IntVar is a subset of IntExpr.
void beginFail()
Just when the failure occurs.
Definition: SearchLog.java:62
SearchLog(long cPtr, boolean cMemoryOwn)
Definition: SearchLog.java:21
void outputDecision()
Definition: SearchLog.java:82
void noMoreSolutions()
When the search tree is finished.
Definition: SearchLog.java:66
void AcceptUncheckedNeighbor()
After accepting an unchecked neighbor during local search.
Definition: SearchLog.java:70
void applyDecision(Decision decision)
Before applying the decision.
Definition: SearchLog.java:74
A Decision represents a choice point in the search tree.
Definition: Decision.java:14
void refuteDecision(Decision decision)
Before refuting the decision.
Definition: SearchLog.java:78
A search monitor is a simple set of callbacks to monitor all search events.
void maintain()
Definition: SearchLog.java:86
void enterSearch()
Beginning of the search.
Definition: SearchLog.java:50
boolean atSolution()
This method is called when a valid solution is found.
Definition: SearchLog.java:58
SearchLog(Solver s, OptimizeVar obj, IntVar var, double scaling_factor, double offset, Supplier< String > display_callback, int period)
Definition: SearchLog.java:46
The base class of all search logs that periodically outputs information when the search is running.
Definition: SearchLog.java:18
String toString()
Definition: SearchLog.java:98
void exitSearch()
End of the search.
Definition: SearchLog.java:54
Solver Class A solver represents the main computation engine.
Definition: Solver.java:57