SolutionCollector.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 3.0.12
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  protected void finalize() {
24  delete();
25  }
26 
27  public synchronized void delete() {
28  if (swigCPtr != 0) {
29  if (swigCMemOwn) {
30  swigCMemOwn = false;
31  mainJNI.delete_SolutionCollector(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public SolutionCollector(Solver solver, Assignment assignment) {
39  this(mainJNI.new_SolutionCollector__SWIG_0(Solver.getCPtr(solver), solver, Assignment.getCPtr(assignment), assignment), true);
40  }
41 
43  this(mainJNI.new_SolutionCollector__SWIG_1(Solver.getCPtr(solver), solver), true);
44  }
45 
46  public String toString() {
47  return mainJNI.SolutionCollector_toString(swigCPtr, this);
48  }
49 
50  public void add(IntVar var) {
51  mainJNI.SolutionCollector_add__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
52  }
53 
54  public void add(IntVar[] vars) {
55  mainJNI.SolutionCollector_add__SWIG_1(swigCPtr, this, vars);
56  }
57 
58  public void add(IntervalVar var) {
59  mainJNI.SolutionCollector_add__SWIG_2(swigCPtr, this, IntervalVar.getCPtr(var), var);
60  }
61 
62  public void add(IntervalVar[] vars) {
63  mainJNI.SolutionCollector_add__SWIG_3(swigCPtr, this, vars);
64  }
65 
66  public void add(SequenceVar var) {
67  mainJNI.SolutionCollector_add__SWIG_4(swigCPtr, this, SequenceVar.getCPtr(var), var);
68  }
69 
70  public void add(SequenceVar[] vars) {
71  mainJNI.SolutionCollector_add__SWIG_5(swigCPtr, this, vars);
72  }
73 
74  public void addObjective(IntVar objective) {
75  mainJNI.SolutionCollector_addObjective(swigCPtr, this, IntVar.getCPtr(objective), objective);
76  }
77 
78  public void enterSearch() {
79  mainJNI.SolutionCollector_enterSearch(swigCPtr, this);
80  }
81 
82  public int solutionCount() {
83  return mainJNI.SolutionCollector_solutionCount(swigCPtr, this);
84  }
85 
86  public Assignment solution(int n) {
87  long cPtr = mainJNI.SolutionCollector_solution(swigCPtr, this, n);
88  return (cPtr == 0) ? null : new Assignment(cPtr, false);
89  }
90 
91  public long wallTime(int n) {
92  return mainJNI.SolutionCollector_wallTime(swigCPtr, this, n);
93  }
94 
95  public long branches(int n) {
96  return mainJNI.SolutionCollector_branches(swigCPtr, this, n);
97  }
98 
99  public long failures(int n) {
100  return mainJNI.SolutionCollector_failures(swigCPtr, this, n);
101  }
102 
103  public long objectiveValue(int n) {
104  return mainJNI.SolutionCollector_objectiveValue(swigCPtr, this, n);
105  }
106 
107  public long value(int n, IntVar var) {
108  return mainJNI.SolutionCollector_value(swigCPtr, this, n, IntVar.getCPtr(var), var);
109  }
110 
111  public long startValue(int n, IntervalVar var) {
112  return mainJNI.SolutionCollector_startValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
113  }
114 
115  public long endValue(int n, IntervalVar var) {
116  return mainJNI.SolutionCollector_endValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
117  }
118 
119  public long durationValue(int n, IntervalVar var) {
120  return mainJNI.SolutionCollector_durationValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
121  }
122 
123  public long performedValue(int n, IntervalVar var) {
124  return mainJNI.SolutionCollector_performedValue(swigCPtr, this, n, IntervalVar.getCPtr(var), var);
125  }
126 
127  public int[] forwardSequence(int n, SequenceVar var) {
128  return mainJNI.SolutionCollector_forwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
129 }
130 
131  public int[] backwardSequence(int n, SequenceVar var) {
132  return mainJNI.SolutionCollector_backwardSequence(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
133 }
134 
135  public int[] unperformed(int n, SequenceVar var) {
136  return mainJNI.SolutionCollector_unperformed(swigCPtr, this, n, SequenceVar.getCPtr(var), var);
137 }
138 
139 }
static long getCPtr(Solver obj)
Definition: Solver.java:63
SolutionCollector(Solver solver, Assignment assignment)