Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Pack.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
11// Used to wrap IndexEvaluator1
12// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongUnaryOperator.html
13import java.util.function.LongUnaryOperator;
14// Used to wrap IndexEvaluator2
15// see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
16import java.util.function.LongBinaryOperator;
17
18public class Pack extends Constraint {
19 private transient long swigCPtr;
20
21 protected Pack(long cPtr, boolean cMemoryOwn) {
22 super(mainJNI.Pack_SWIGUpcast(cPtr), cMemoryOwn);
23 swigCPtr = cPtr;
24 }
25
26 protected static long getCPtr(Pack obj) {
27 return (obj == null) ? 0 : obj.swigCPtr;
28 }
29
30 protected static long swigRelease(Pack obj) {
31 long ptr = 0;
32 if (obj != null) {
33 if (!obj.swigCMemOwn)
34 throw new RuntimeException("Cannot release ownership as memory is not owned");
35 ptr = obj.swigCPtr;
36 obj.swigCMemOwn = false;
37 obj.delete();
38 }
39 return ptr;
40 }
41
42 @SuppressWarnings({"deprecation", "removal"})
43 protected void finalize() {
44 delete();
45 }
46
47 public synchronized void delete() {
48 if (swigCPtr != 0) {
49 if (swigCMemOwn) {
50 swigCMemOwn = false;
51 mainJNI.delete_Pack(swigCPtr);
52 }
53 swigCPtr = 0;
54 }
55 super.delete();
56 }
57
58 public Pack(Solver s, IntVar[] vars, int number_of_bins) {
59 this(mainJNI.new_Pack(Solver.getCPtr(s), s, vars, number_of_bins), true);
60 }
61
71 public void addWeightedSumLessOrEqualConstantDimension(long[] weights, long[] bounds) {
72 mainJNI.Pack_addWeightedSumLessOrEqualConstantDimension__SWIG_0(swigCPtr, this, weights, bounds);
73 }
74
81 public void addWeightedSumLessOrEqualConstantDimension(LongUnaryOperator weights, long[] bounds) {
82 mainJNI.Pack_addWeightedSumLessOrEqualConstantDimension__SWIG_1(swigCPtr, this, weights, bounds);
83 }
84
91 public void addWeightedSumLessOrEqualConstantDimension(LongBinaryOperator weights, long[] bounds) {
92 mainJNI.Pack_addWeightedSumLessOrEqualConstantDimension__SWIG_2(swigCPtr, this, weights, bounds);
93 }
94
99 public void addWeightedSumEqualVarDimension(long[] weights, IntVar[] loads) {
100 mainJNI.Pack_addWeightedSumEqualVarDimension__SWIG_0(swigCPtr, this, weights, loads);
101 }
102
108 public void addWeightedSumEqualVarDimension(LongBinaryOperator weights, IntVar[] loads) {
109 mainJNI.Pack_addWeightedSumEqualVarDimension__SWIG_1(swigCPtr, this, weights, loads);
110 }
111
123 public void addSumVariableWeightsLessOrEqualConstantDimension(IntVar[] usage, long[] capacity) {
124 mainJNI.Pack_addSumVariableWeightsLessOrEqualConstantDimension(swigCPtr, this, usage, capacity);
125 }
126
131 public void addWeightedSumOfAssignedDimension(long[] weights, IntVar cost_var) {
132 mainJNI.Pack_addWeightedSumOfAssignedDimension(swigCPtr, this, weights, IntVar.getCPtr(cost_var), cost_var);
133 }
134
139 public void addCountUsedBinDimension(IntVar count_var) {
140 mainJNI.Pack_addCountUsedBinDimension(swigCPtr, this, IntVar.getCPtr(count_var), count_var);
141 }
142
147 public void addCountAssignedItemsDimension(IntVar count_var) {
148 mainJNI.Pack_addCountAssignedItemsDimension(swigCPtr, this, IntVar.getCPtr(count_var), count_var);
149 }
150
151 public void post() {
152 mainJNI.Pack_post(swigCPtr, this);
153 }
154
155 public void clearAll() {
156 mainJNI.Pack_clearAll(swigCPtr, this);
157 }
158
159 public void propagateDelayed() {
160 mainJNI.Pack_propagateDelayed(swigCPtr, this);
161 }
162
163 public void initialPropagate() {
164 mainJNI.Pack_initialPropagate(swigCPtr, this);
165 }
166
167 public void propagate() {
168 mainJNI.Pack_propagate(swigCPtr, this);
169 }
170
171 public void oneDomain(int var_index) {
172 mainJNI.Pack_oneDomain(swigCPtr, this, var_index);
173 }
174
175 public String toString() {
176 return mainJNI.Pack_toString(swigCPtr, this);
177 }
178
179 public boolean isUndecided(int var_index, int bin_index) {
180 return mainJNI.Pack_isUndecided(swigCPtr, this, var_index, bin_index);
181 }
182
183 public void setImpossible(int var_index, int bin_index) {
184 mainJNI.Pack_setImpossible(swigCPtr, this, var_index, bin_index);
185 }
186
187 public void assign(int var_index, int bin_index) {
188 mainJNI.Pack_assign(swigCPtr, this, var_index, bin_index);
189 }
190
191 public boolean isAssignedStatusKnown(int var_index) {
192 return mainJNI.Pack_isAssignedStatusKnown(swigCPtr, this, var_index);
193 }
194
195 public boolean isPossible(int var_index, int bin_index) {
196 return mainJNI.Pack_isPossible(swigCPtr, this, var_index, bin_index);
197 }
198
199 public IntVar assignVar(int var_index, int bin_index) {
200 long cPtr = mainJNI.Pack_assignVar(swigCPtr, this, var_index, bin_index);
201 return (cPtr == 0) ? null : new IntVar(cPtr, false);
202 }
203
204 public void setAssigned(int var_index) {
205 mainJNI.Pack_setAssigned(swigCPtr, this, var_index);
206 }
207
208 public void setUnassigned(int var_index) {
209 mainJNI.Pack_setUnassigned(swigCPtr, this, var_index);
210 }
211
212 public void removeAllPossibleFromBin(int bin_index) {
213 mainJNI.Pack_removeAllPossibleFromBin(swigCPtr, this, bin_index);
214 }
215
216 public void assignAllPossibleToBin(int bin_index) {
217 mainJNI.Pack_assignAllPossibleToBin(swigCPtr, this, bin_index);
218 }
219
220 public void assignFirstPossibleToBin(int bin_index) {
221 mainJNI.Pack_assignFirstPossibleToBin(swigCPtr, this, bin_index);
222 }
223
225 mainJNI.Pack_assignAllRemainingItems(swigCPtr, this);
226 }
227
229 mainJNI.Pack_unassignAllRemainingItems(swigCPtr, this);
230 }
231
232 public void accept(ModelVisitor visitor) {
233 mainJNI.Pack_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
234 }
235
236}
void addCountAssignedItemsDimension(IntVar count_var)
Definition Pack.java:147
static long swigRelease(Pack obj)
Definition Pack.java:30
void removeAllPossibleFromBin(int bin_index)
Definition Pack.java:212
Pack(Solver s, IntVar[] vars, int number_of_bins)
Definition Pack.java:58
void setImpossible(int var_index, int bin_index)
Definition Pack.java:183
void addWeightedSumLessOrEqualConstantDimension(LongBinaryOperator weights, long[] bounds)
Definition Pack.java:91
void addWeightedSumLessOrEqualConstantDimension(long[] weights, long[] bounds)
Definition Pack.java:71
IntVar assignVar(int var_index, int bin_index)
Definition Pack.java:199
void accept(ModelVisitor visitor)
Definition Pack.java:232
void assignFirstPossibleToBin(int bin_index)
Definition Pack.java:220
boolean isUndecided(int var_index, int bin_index)
Definition Pack.java:179
static long getCPtr(Pack obj)
Definition Pack.java:26
void addWeightedSumLessOrEqualConstantDimension(LongUnaryOperator weights, long[] bounds)
Definition Pack.java:81
void addWeightedSumOfAssignedDimension(long[] weights, IntVar cost_var)
Definition Pack.java:131
void assignAllPossibleToBin(int bin_index)
Definition Pack.java:216
void assign(int var_index, int bin_index)
Definition Pack.java:187
boolean isPossible(int var_index, int bin_index)
Definition Pack.java:195
void addCountUsedBinDimension(IntVar count_var)
Definition Pack.java:139
Pack(long cPtr, boolean cMemoryOwn)
Definition Pack.java:21
boolean isAssignedStatusKnown(int var_index)
Definition Pack.java:191
void addSumVariableWeightsLessOrEqualConstantDimension(IntVar[] usage, long[] capacity)
Definition Pack.java:123
void addWeightedSumEqualVarDimension(LongBinaryOperator weights, IntVar[] loads)
Definition Pack.java:108
void addWeightedSumEqualVarDimension(long[] weights, IntVar[] loads)
Definition Pack.java:99