SolutionCollector.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.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 
9 package com.google.ortools.constraintsolver;
10 
11 public class SolutionCollector extends SearchMonitor {
12  private transient long swigCPtr;
13 
14  protected SolutionCollector(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.SolutionCollector_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(SolutionCollector obj) {
20  return (obj == null) ? 0 : obj.swigCPtr;
21  }
22 
23  @SuppressWarnings("deprecation")
24  protected void finalize() {
25  delete();
26  }
27 
28  public synchronized void delete() {
29  if (swigCPtr != 0) {
30  if (swigCMemOwn) {
31  swigCMemOwn = false;
32  mainJNI.delete_SolutionCollector(swigCPtr);
33  }
34  swigCPtr = 0;
35  }
36  super.delete();
37  }
38 
39  public SolutionCollector(Solver solver, Assignment assignment) {
40  this(mainJNI.new_SolutionCollector__SWIG_0(Solver.getCPtr(solver), solver, Assignment.getCPtr(assignment), assignment), true);
41  }
42 
44  this(mainJNI.new_SolutionCollector__SWIG_1(Solver.getCPtr(solver), solver), true);
45  }
46 
47  public String toString() {
48  return mainJNI.SolutionCollector_toString(swigCPtr, this);
49  }
50 
51  public void add(IntVar var) {
52  mainJNI.SolutionCollector_add__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
53  }
54 
55  public void add(IntVar[] vars) {
56  mainJNI.SolutionCollector_add__SWIG_1(swigCPtr, this, vars);
57  }
58 
59  public void add(IntervalVar var) {
60  mainJNI.SolutionCollector_add__SWIG_2(swigCPtr, this, IntervalVar.getCPtr(var), var);
61  }
62 
63  public void add(IntervalVar[] vars) {
64  mainJNI.SolutionCollector_add__SWIG_3(swigCPtr, this, vars);
65  }
66 
67  public void add(SequenceVar var) {
68  mainJNI.SolutionCollector_add__SWIG_4(swigCPtr, this, SequenceVar.getCPtr(var), var);
69  }
70 
71  public void add(SequenceVar[] vars) {
72  mainJNI.SolutionCollector_add__SWIG_5(swigCPtr, this, vars);
73  }
74 
75  public void addObjective(IntVar objective) {
76  mainJNI.SolutionCollector_addObjective(swigCPtr, this, IntVar.getCPtr(objective), objective);
77  }
78 
79  public void enterSearch() {
80  mainJNI.SolutionCollector_enterSearch(swigCPtr, this);
81  }
82 
83  public int solutionCount() {
84  return mainJNI.SolutionCollector_solutionCount(swigCPtr, this);
85  }
86 
87  public Assignment solution(int n) {
88  long cPtr = mainJNI.SolutionCollector_solution(swigCPtr, this, n);
89  return (cPtr == 0) ? null : new Assignment(cPtr, false);
90  }
91 
92  public long wallTime(int n) {
93  return mainJNI.SolutionCollector_wallTime(swigCPtr, this, n);
94  }
95 
96  public long branches(int n) {
97  return mainJNI.SolutionCollector_branches(swigCPtr, this, n);
98  }
99 
100  public long failures(int n) {
101  return mainJNI.SolutionCollector_failures(swigCPtr, this, n);
102  }
103 
104  public long objectiveValue(int n) {
105  return mainJNI.SolutionCollector_objectiveValue(swigCPtr, this, n);
106  }
107 
108  public long value(int n, IntVar var) {
109  return mainJNI.SolutionCollector_value(swigCPtr, this, n, IntVar.getCPtr(var), var);
110  }
111 
112  public long startValue(int n, IntervalVar var) {
113  return mainJNI.SolutionCollector_startValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
114  }
115 
116  public long endValue(int n, IntervalVar var) {
117  return mainJNI.SolutionCollector_endValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
118  }
119 
120  public long durationValue(int n, IntervalVar var) {
121  return mainJNI.SolutionCollector_durationValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
122  }
123 
124  public long performedValue(int n, IntervalVar var) {
125  return mainJNI.SolutionCollector_performedValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
126  }
127 
128  public int[] forwardSequence(int n, SequenceVar var) {
129  return mainJNI.SolutionCollector_forwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
130 }
131 
132  public int[] backwardSequence(int n, SequenceVar var) {
133  return mainJNI.SolutionCollector_backwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
134 }
135 
136  public int[] unperformed(int n, SequenceVar var) {
137  return mainJNI.SolutionCollector_unperformed(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
138 }
139 
140 }
static long getCPtr(Solver obj)
Definition: Solver.java:63
SolutionCollector(Solver solver, Assignment assignment)