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