Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
SolutionCollector.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.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
9package com.google.ortools.constraintsolver;
10
16public class SolutionCollector extends SearchMonitor {
17 private transient long swigCPtr;
18
19 protected SolutionCollector(long cPtr, boolean cMemoryOwn) {
20 super(mainJNI.SolutionCollector_SWIGUpcast(cPtr), cMemoryOwn);
21 swigCPtr = cPtr;
22 }
23
24 protected static long getCPtr(SolutionCollector obj) {
25 return (obj == null) ? 0 : obj.swigCPtr;
26 }
27
28 protected static long swigRelease(SolutionCollector obj) {
29 long ptr = 0;
30 if (obj != null) {
31 if (!obj.swigCMemOwn)
32 throw new RuntimeException("Cannot release ownership as memory is not owned");
33 ptr = obj.swigCPtr;
34 obj.swigCMemOwn = false;
35 obj.delete();
36 }
37 return ptr;
38 }
39
40 @SuppressWarnings({"deprecation", "removal"})
41 protected void finalize() {
42 delete();
43 }
44
45 public synchronized void delete() {
46 if (swigCPtr != 0) {
47 if (swigCMemOwn) {
48 swigCMemOwn = false;
49 mainJNI.delete_SolutionCollector(swigCPtr);
50 }
51 swigCPtr = 0;
52 }
53 super.delete();
54 }
55
57 this(mainJNI.new_SolutionCollector__SWIG_0(Solver.getCPtr(solver), solver, Assignment.getCPtr(assignment), assignment), true);
58 }
59
61 this(mainJNI.new_SolutionCollector__SWIG_1(Solver.getCPtr(solver), solver), true);
62 }
63
64 public void install() {
65 mainJNI.SolutionCollector_install(swigCPtr, this);
66 }
67
68 public String toString() {
69 return mainJNI.SolutionCollector_toString(swigCPtr, this);
70 }
71
75 public void add(IntVar var) {
76 mainJNI.SolutionCollector_add__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
77 }
78
79 public void add(IntVar[] vars) {
80 mainJNI.SolutionCollector_add__SWIG_1(swigCPtr, this, vars);
81 }
82
83 public void add(IntervalVar var) {
84 mainJNI.SolutionCollector_add__SWIG_2(swigCPtr, this, IntervalVar.getCPtr(var), var);
85 }
86
87 public void add(IntervalVar[] vars) {
88 mainJNI.SolutionCollector_add__SWIG_3(swigCPtr, this, vars);
89 }
90
91 public void add(SequenceVar var) {
92 mainJNI.SolutionCollector_add__SWIG_4(swigCPtr, this, SequenceVar.getCPtr(var), var);
93 }
94
95 public void add(SequenceVar[] vars) {
96 mainJNI.SolutionCollector_add__SWIG_5(swigCPtr, this, vars);
97 }
98
99 public void addObjective(IntVar objective) {
100 mainJNI.SolutionCollector_addObjective(swigCPtr, this, IntVar.getCPtr(objective), objective);
101 }
102
103 public void AddObjectives(IntVar[] objectives) {
104 mainJNI.SolutionCollector_AddObjectives(swigCPtr, this, objectives);
105 }
106
110 public void enterSearch() {
111 mainJNI.SolutionCollector_enterSearch(swigCPtr, this);
112 }
113
117 public int solutionCount() {
118 return mainJNI.SolutionCollector_solutionCount(swigCPtr, this);
119 }
120
124 public boolean has_solution() {
125 return mainJNI.SolutionCollector_has_solution(swigCPtr, this);
126 }
127
131 public Assignment solution(int n) {
132 long cPtr = mainJNI.SolutionCollector_solution(swigCPtr, this, n);
133 return (cPtr == 0) ? null : new Assignment(cPtr, false);
134 }
135
140 long cPtr = mainJNI.SolutionCollector_last_solution_or_null(swigCPtr, this);
141 return (cPtr == 0) ? null : new Assignment(cPtr, false);
142 }
143
147 public long wallTime(int n) {
148 return mainJNI.SolutionCollector_wallTime(swigCPtr, this, n);
149 }
150
154 public long branches(int n) {
155 return mainJNI.SolutionCollector_branches(swigCPtr, this, n);
156 }
157
162 public long failures(int n) {
163 return mainJNI.SolutionCollector_failures(swigCPtr, this, n);
164 }
165
169 public long objectiveValue(int n) {
170 return mainJNI.SolutionCollector_objectiveValue(swigCPtr, this, n);
171 }
172
176 public long ObjectiveValueFromIndex(int n, int index) {
177 return mainJNI.SolutionCollector_ObjectiveValueFromIndex(swigCPtr, this, n, index);
178 }
179
183 public long value(int n, IntVar var) {
184 return mainJNI.SolutionCollector_value(swigCPtr, this, n, IntVar.getCPtr(var), var);
185 }
186
190 public long startValue(int n, IntervalVar var) {
191 return mainJNI.SolutionCollector_startValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
192 }
193
197 public long endValue(int n, IntervalVar var) {
198 return mainJNI.SolutionCollector_endValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
199 }
200
204 public long durationValue(int n, IntervalVar var) {
205 return mainJNI.SolutionCollector_durationValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
206 }
207
211 public long performedValue(int n, IntervalVar var) {
212 return mainJNI.SolutionCollector_performedValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
213 }
214
220 public int[] forwardSequence(int n, SequenceVar var) {
221 return mainJNI.SolutionCollector_forwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
222}
223
229 public int[] backwardSequence(int n, SequenceVar var) {
230 return mainJNI.SolutionCollector_backwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
231}
232
237 public int[] unperformed(int n, SequenceVar var) {
238 return mainJNI.SolutionCollector_unperformed(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
239}
240
241}
SolutionCollector(Solver solver, Assignment assignment)