Google OR-Tools v9.9
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SearchLog.java
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2 * This file was automatically generated by SWIG (https://www.swig.org).
3 * Version 4.2.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
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 protected static long swigRelease(SearchLog obj) {
32 long ptr = 0;
33 if (obj != null) {
34 if (!obj.swigCMemOwn)
35 throw new RuntimeException("Cannot release ownership as memory is not owned");
36 ptr = obj.swigCPtr;
37 obj.swigCMemOwn = false;
38 obj.delete();
39 }
40 return ptr;
41 }
42
43 @SuppressWarnings({"deprecation", "removal"})
44 protected void finalize() {
45 delete();
46 }
47
48 public synchronized void delete() {
49 if (swigCPtr != 0) {
50 if (swigCMemOwn) {
51 swigCMemOwn = false;
52 mainJNI.delete_SearchLog(swigCPtr);
53 }
54 swigCPtr = 0;
55 }
56 super.delete();
57 }
58
59 public SearchLog(Solver solver, IntVar[] vars, String vars_name, double[] scaling_factors, double[] offsets, Supplier<String> display_callback, boolean display_on_new_solutions_only, int period) {
60 this(mainJNI.new_SearchLog(Solver.getCPtr(solver), solver, vars, vars_name, scaling_factors, offsets, display_callback, display_on_new_solutions_only, period), true);
61 }
62
63 public void enterSearch() {
64 mainJNI.SearchLog_enterSearch(swigCPtr, this);
65 }
66
67 public void exitSearch() {
68 mainJNI.SearchLog_exitSearch(swigCPtr, this);
69 }
70
71 public boolean atSolution() {
72 return mainJNI.SearchLog_atSolution(swigCPtr, this);
73 }
74
75 public void beginFail() {
76 mainJNI.SearchLog_beginFail(swigCPtr, this);
77 }
78
79 public void noMoreSolutions() {
80 mainJNI.SearchLog_noMoreSolutions(swigCPtr, this);
81 }
82
84 mainJNI.SearchLog_AcceptUncheckedNeighbor(swigCPtr, this);
85 }
86
87 public void applyDecision(Decision decision) {
88 mainJNI.SearchLog_applyDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
89 }
90
91 public void refuteDecision(Decision decision) {
92 mainJNI.SearchLog_refuteDecision(swigCPtr, this, Decision.getCPtr(decision), decision);
93 }
94
95 public void outputDecision() {
96 mainJNI.SearchLog_outputDecision(swigCPtr, this);
97 }
98
99 public void maintain() {
100 mainJNI.SearchLog_maintain(swigCPtr, this);
101 }
102
104 mainJNI.SearchLog_beginInitialPropagation(swigCPtr, this);
105 }
106
107 public void endInitialPropagation() {
108 mainJNI.SearchLog_endInitialPropagation(swigCPtr, this);
109 }
110
111 public String toString() {
112 return mainJNI.SearchLog_toString(swigCPtr, this);
113 }
114
115}
SearchLog(Solver solver, IntVar[] vars, String vars_name, double[] scaling_factors, double[] offsets, Supplier< String > display_callback, boolean display_on_new_solutions_only, int period)
SearchLog(long cPtr, boolean cMemoryOwn)