Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
Assignment.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
15public class Assignment extends PropagationBaseObject {
16 private transient long swigCPtr;
17
18 protected Assignment(long cPtr, boolean cMemoryOwn) {
19 super(mainJNI.Assignment_SWIGUpcast(cPtr), cMemoryOwn);
20 swigCPtr = cPtr;
21 }
22
23 protected static long getCPtr(Assignment obj) {
24 return (obj == null) ? 0 : obj.swigCPtr;
25 }
26
27 protected static long swigRelease(Assignment obj) {
28 long ptr = 0;
29 if (obj != null) {
30 if (!obj.swigCMemOwn)
31 throw new RuntimeException("Cannot release ownership as memory is not owned");
32 ptr = obj.swigCPtr;
33 obj.swigCMemOwn = false;
34 obj.delete();
35 }
36 return ptr;
37 }
38
39 @SuppressWarnings({"deprecation", "removal"})
40 protected void finalize() {
41 delete();
42 }
43
44 public synchronized void delete() {
45 if (swigCPtr != 0) {
46 if (swigCMemOwn) {
47 swigCMemOwn = false;
48 mainJNI.delete_Assignment(swigCPtr);
49 }
50 swigCPtr = 0;
51 }
52 super.delete();
53 }
54
56 this(mainJNI.new_Assignment__SWIG_0(Solver.getCPtr(solver), solver), true);
57 }
58
60 this(mainJNI.new_Assignment__SWIG_1(Assignment.getCPtr(copy), copy), true);
61 }
62
63 public void clear() {
64 mainJNI.Assignment_clear(swigCPtr, this);
65 }
66
67 public boolean empty() {
68 return mainJNI.Assignment_empty(swigCPtr, this);
69 }
70
71 public int size() {
72 return mainJNI.Assignment_size(swigCPtr, this);
73 }
74
75 public int numIntVars() {
76 return mainJNI.Assignment_numIntVars(swigCPtr, this);
77 }
78
79 public int numIntervalVars() {
80 return mainJNI.Assignment_numIntervalVars(swigCPtr, this);
81 }
82
83 public int numSequenceVars() {
84 return mainJNI.Assignment_numSequenceVars(swigCPtr, this);
85 }
86
87 public void store() {
88 mainJNI.Assignment_store(swigCPtr, this);
89 }
90
91 public void restore() {
92 mainJNI.Assignment_restore(swigCPtr, this);
93 }
94
99 public boolean load(String filename) {
100 return mainJNI.Assignment_load(swigCPtr, this, filename);
101 }
102
106 public boolean save(String filename) {
107 return mainJNI.Assignment_save__SWIG_0(swigCPtr, this, filename);
108 }
109
110 public void save(SWIGTYPE_p_operations_research__AssignmentProto assignment_proto) {
111 mainJNI.Assignment_save__SWIG_1(swigCPtr, this, SWIGTYPE_p_operations_research__AssignmentProto.getCPtr(assignment_proto));
112 }
113
114 public void addObjective(IntVar v) {
115 mainJNI.Assignment_addObjective(swigCPtr, this, IntVar.getCPtr(v), v);
116 }
117
118 public void AddObjectives(IntVar[] vars) {
119 mainJNI.Assignment_AddObjectives(swigCPtr, this, vars);
120 }
121
122 public void ClearObjective() {
123 mainJNI.Assignment_ClearObjective(swigCPtr, this);
124 }
125
126 public int NumObjectives() {
127 return mainJNI.Assignment_NumObjectives(swigCPtr, this);
128 }
129
130 public IntVar objective() {
131 long cPtr = mainJNI.Assignment_objective(swigCPtr, this);
132 return (cPtr == 0) ? null : new IntVar(cPtr, false);
133 }
134
135 public IntVar ObjectiveFromIndex(int index) {
136 long cPtr = mainJNI.Assignment_ObjectiveFromIndex(swigCPtr, this, index);
137 return (cPtr == 0) ? null : new IntVar(cPtr, false);
138 }
139
140 public boolean hasObjective() {
141 return mainJNI.Assignment_hasObjective(swigCPtr, this);
142 }
143
144 public boolean HasObjectiveFromIndex(int index) {
145 return mainJNI.Assignment_HasObjectiveFromIndex(swigCPtr, this, index);
146 }
147
148 public long objectiveMin() {
149 return mainJNI.Assignment_objectiveMin(swigCPtr, this);
150 }
151
152 public long objectiveMax() {
153 return mainJNI.Assignment_objectiveMax(swigCPtr, this);
154 }
155
156 public long objectiveValue() {
157 return mainJNI.Assignment_objectiveValue(swigCPtr, this);
158 }
159
160 public boolean objectiveBound() {
161 return mainJNI.Assignment_objectiveBound(swigCPtr, this);
162 }
163
164 public void setObjectiveMin(long m) {
165 mainJNI.Assignment_setObjectiveMin(swigCPtr, this, m);
166 }
167
168 public void setObjectiveMax(long m) {
169 mainJNI.Assignment_setObjectiveMax(swigCPtr, this, m);
170 }
171
172 public void setObjectiveValue(long value) {
173 mainJNI.Assignment_setObjectiveValue(swigCPtr, this, value);
174 }
175
176 public void setObjectiveRange(long l, long u) {
177 mainJNI.Assignment_setObjectiveRange(swigCPtr, this, l, u);
178 }
179
180 public long ObjectiveMinFromIndex(int index) {
181 return mainJNI.Assignment_ObjectiveMinFromIndex(swigCPtr, this, index);
182 }
183
184 public long ObjectiveMaxFromIndex(int index) {
185 return mainJNI.Assignment_ObjectiveMaxFromIndex(swigCPtr, this, index);
186 }
187
188 public long ObjectiveValueFromIndex(int index) {
189 return mainJNI.Assignment_ObjectiveValueFromIndex(swigCPtr, this, index);
190 }
191
192 public boolean ObjectiveBoundFromIndex(int index) {
193 return mainJNI.Assignment_ObjectiveBoundFromIndex(swigCPtr, this, index);
194 }
195
196 public void SetObjectiveMinFromIndex(int index, long m) {
197 mainJNI.Assignment_SetObjectiveMinFromIndex(swigCPtr, this, index, m);
198 }
199
200 public void SetObjectiveMaxFromIndex(int index, long m) {
201 mainJNI.Assignment_SetObjectiveMaxFromIndex(swigCPtr, this, index, m);
202 }
203
204 public void SetObjectiveValueFromIndex(int index, long value) {
205 mainJNI.Assignment_SetObjectiveValueFromIndex(swigCPtr, this, index, value);
206 }
207
208 public void SetObjectiveRangeFromIndex(int index, long l, long u) {
209 mainJNI.Assignment_SetObjectiveRangeFromIndex(swigCPtr, this, index, l, u);
210 }
211
213 long cPtr = mainJNI.Assignment_add__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
214 return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
215 }
216
217 public void add(IntVar[] vars) {
218 mainJNI.Assignment_add__SWIG_1(swigCPtr, this, vars);
219 }
220
225 long cPtr = mainJNI.Assignment_fastAdd__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
226 return (cPtr == 0) ? null : new IntVarElement(cPtr, false);
227 }
228
229 public long min(IntVar var) {
230 return mainJNI.Assignment_min(swigCPtr, this, IntVar.getCPtr(var), var);
231 }
232
233 public long max(IntVar var) {
234 return mainJNI.Assignment_max(swigCPtr, this, IntVar.getCPtr(var), var);
235 }
236
237 public long value(IntVar var) {
238 return mainJNI.Assignment_value(swigCPtr, this, IntVar.getCPtr(var), var);
239 }
240
241 public boolean bound(IntVar var) {
242 return mainJNI.Assignment_bound(swigCPtr, this, IntVar.getCPtr(var), var);
243 }
244
245 public void setMin(IntVar var, long m) {
246 mainJNI.Assignment_setMin(swigCPtr, this, IntVar.getCPtr(var), var, m);
247 }
248
249 public void setMax(IntVar var, long m) {
250 mainJNI.Assignment_setMax(swigCPtr, this, IntVar.getCPtr(var), var, m);
251 }
252
253 public void setRange(IntVar var, long l, long u) {
254 mainJNI.Assignment_setRange(swigCPtr, this, IntVar.getCPtr(var), var, l, u);
255 }
256
257 public void setValue(IntVar var, long value) {
258 mainJNI.Assignment_setValue(swigCPtr, this, IntVar.getCPtr(var), var, value);
259 }
260
262 long cPtr = mainJNI.Assignment_add__SWIG_2(swigCPtr, this, IntervalVar.getCPtr(var), var);
263 return (cPtr == 0) ? null : new IntervalVarElement(cPtr, false);
264 }
265
266 public void add(IntervalVar[] vars) {
267 mainJNI.Assignment_add__SWIG_3(swigCPtr, this, vars);
268 }
269
274 long cPtr = mainJNI.Assignment_fastAdd__SWIG_1(swigCPtr, this, IntervalVar.getCPtr(var), var);
275 return (cPtr == 0) ? null : new IntervalVarElement(cPtr, false);
276 }
277
278 public long startMin(IntervalVar var) {
279 return mainJNI.Assignment_startMin(swigCPtr, this, IntervalVar.getCPtr(var), var);
280 }
281
282 public long startMax(IntervalVar var) {
283 return mainJNI.Assignment_startMax(swigCPtr, this, IntervalVar.getCPtr(var), var);
284 }
285
286 public long startValue(IntervalVar var) {
287 return mainJNI.Assignment_startValue(swigCPtr, this, IntervalVar.getCPtr(var), var);
288 }
289
290 public long durationMin(IntervalVar var) {
291 return mainJNI.Assignment_durationMin(swigCPtr, this, IntervalVar.getCPtr(var), var);
292 }
293
294 public long durationMax(IntervalVar var) {
295 return mainJNI.Assignment_durationMax(swigCPtr, this, IntervalVar.getCPtr(var), var);
296 }
297
298 public long durationValue(IntervalVar var) {
299 return mainJNI.Assignment_durationValue(swigCPtr, this, IntervalVar.getCPtr(var), var);
300 }
301
302 public long endMin(IntervalVar var) {
303 return mainJNI.Assignment_endMin(swigCPtr, this, IntervalVar.getCPtr(var), var);
304 }
305
306 public long endMax(IntervalVar var) {
307 return mainJNI.Assignment_endMax(swigCPtr, this, IntervalVar.getCPtr(var), var);
308 }
309
310 public long endValue(IntervalVar var) {
311 return mainJNI.Assignment_endValue(swigCPtr, this, IntervalVar.getCPtr(var), var);
312 }
313
314 public long performedMin(IntervalVar var) {
315 return mainJNI.Assignment_performedMin(swigCPtr, this, IntervalVar.getCPtr(var), var);
316 }
317
318 public long performedMax(IntervalVar var) {
319 return mainJNI.Assignment_performedMax(swigCPtr, this, IntervalVar.getCPtr(var), var);
320 }
321
322 public long performedValue(IntervalVar var) {
323 return mainJNI.Assignment_performedValue(swigCPtr, this, IntervalVar.getCPtr(var), var);
324 }
325
326 public void setStartMin(IntervalVar var, long m) {
327 mainJNI.Assignment_setStartMin(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
328 }
329
330 public void setStartMax(IntervalVar var, long m) {
331 mainJNI.Assignment_setStartMax(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
332 }
333
334 public void setStartRange(IntervalVar var, long mi, long ma) {
335 mainJNI.Assignment_setStartRange(swigCPtr, this, IntervalVar.getCPtr(var), var, mi, ma);
336 }
337
338 public void setStartValue(IntervalVar var, long value) {
339 mainJNI.Assignment_setStartValue(swigCPtr, this, IntervalVar.getCPtr(var), var, value);
340 }
341
342 public void setDurationMin(IntervalVar var, long m) {
343 mainJNI.Assignment_setDurationMin(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
344 }
345
346 public void setDurationMax(IntervalVar var, long m) {
347 mainJNI.Assignment_setDurationMax(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
348 }
349
350 public void setDurationRange(IntervalVar var, long mi, long ma) {
351 mainJNI.Assignment_setDurationRange(swigCPtr, this, IntervalVar.getCPtr(var), var, mi, ma);
352 }
353
354 public void setDurationValue(IntervalVar var, long value) {
355 mainJNI.Assignment_setDurationValue(swigCPtr, this, IntervalVar.getCPtr(var), var, value);
356 }
357
358 public void setEndMin(IntervalVar var, long m) {
359 mainJNI.Assignment_setEndMin(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
360 }
361
362 public void setEndMax(IntervalVar var, long m) {
363 mainJNI.Assignment_setEndMax(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
364 }
365
366 public void setEndRange(IntervalVar var, long mi, long ma) {
367 mainJNI.Assignment_setEndRange(swigCPtr, this, IntervalVar.getCPtr(var), var, mi, ma);
368 }
369
370 public void setEndValue(IntervalVar var, long value) {
371 mainJNI.Assignment_setEndValue(swigCPtr, this, IntervalVar.getCPtr(var), var, value);
372 }
373
374 public void setPerformedMin(IntervalVar var, long m) {
375 mainJNI.Assignment_setPerformedMin(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
376 }
377
378 public void setPerformedMax(IntervalVar var, long m) {
379 mainJNI.Assignment_setPerformedMax(swigCPtr, this, IntervalVar.getCPtr(var), var, m);
380 }
381
382 public void setPerformedRange(IntervalVar var, long mi, long ma) {
383 mainJNI.Assignment_setPerformedRange(swigCPtr, this, IntervalVar.getCPtr(var), var, mi, ma);
384 }
385
386 public void setPerformedValue(IntervalVar var, long value) {
387 mainJNI.Assignment_setPerformedValue(swigCPtr, this, IntervalVar.getCPtr(var), var, value);
388 }
389
391 long cPtr = mainJNI.Assignment_add__SWIG_4(swigCPtr, this, SequenceVar.getCPtr(var), var);
392 return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
393 }
394
395 public void add(SequenceVar[] vars) {
396 mainJNI.Assignment_add__SWIG_5(swigCPtr, this, vars);
397 }
398
403 long cPtr = mainJNI.Assignment_fastAdd__SWIG_2(swigCPtr, this, SequenceVar.getCPtr(var), var);
404 return (cPtr == 0) ? null : new SequenceVarElement(cPtr, false);
405 }
406
407 public int[] forwardSequence(SequenceVar var) {
408 return mainJNI.Assignment_forwardSequence(swigCPtr, this, SequenceVar.getCPtr(var), var);
409}
410
411 public int[] backwardSequence(SequenceVar var) {
412 return mainJNI.Assignment_backwardSequence(swigCPtr, this, SequenceVar.getCPtr(var), var);
413}
414
415 public int[] unperformed(SequenceVar var) {
416 return mainJNI.Assignment_unperformed(swigCPtr, this, SequenceVar.getCPtr(var), var);
417}
418
419 public void setSequence(SequenceVar var, int[] forward_sequence, int[] backward_sequence, int[] unperformed) {
420 mainJNI.Assignment_setSequence(swigCPtr, this, SequenceVar.getCPtr(var), var, forward_sequence, backward_sequence, unperformed);
421 }
422
423 public void setForwardSequence(SequenceVar var, int[] forward_sequence) {
424 mainJNI.Assignment_setForwardSequence(swigCPtr, this, SequenceVar.getCPtr(var), var, forward_sequence);
425 }
426
427 public void setBackwardSequence(SequenceVar var, int[] backward_sequence) {
428 mainJNI.Assignment_setBackwardSequence(swigCPtr, this, SequenceVar.getCPtr(var), var, backward_sequence);
429 }
430
431 public void setUnperformed(SequenceVar var, int[] unperformed) {
432 mainJNI.Assignment_setUnperformed(swigCPtr, this, SequenceVar.getCPtr(var), var, unperformed);
433 }
434
435 public void activate(IntVar var) {
436 mainJNI.Assignment_activate__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
437 }
438
439 public void deactivate(IntVar var) {
440 mainJNI.Assignment_deactivate__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
441 }
442
443 public boolean activated(IntVar var) {
444 return mainJNI.Assignment_activated__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
445 }
446
447 public void activate(IntervalVar var) {
448 mainJNI.Assignment_activate__SWIG_1(swigCPtr, this, IntervalVar.getCPtr(var), var);
449 }
450
451 public void deactivate(IntervalVar var) {
452 mainJNI.Assignment_deactivate__SWIG_1(swigCPtr, this, IntervalVar.getCPtr(var), var);
453 }
454
455 public boolean activated(IntervalVar var) {
456 return mainJNI.Assignment_activated__SWIG_1(swigCPtr, this, IntervalVar.getCPtr(var), var);
457 }
458
459 public void activate(SequenceVar var) {
460 mainJNI.Assignment_activate__SWIG_2(swigCPtr, this, SequenceVar.getCPtr(var), var);
461 }
462
463 public void deactivate(SequenceVar var) {
464 mainJNI.Assignment_deactivate__SWIG_2(swigCPtr, this, SequenceVar.getCPtr(var), var);
465 }
466
467 public boolean activated(SequenceVar var) {
468 return mainJNI.Assignment_activated__SWIG_2(swigCPtr, this, SequenceVar.getCPtr(var), var);
469 }
470
471 public void activateObjective() {
472 mainJNI.Assignment_activateObjective(swigCPtr, this);
473 }
474
475 public void deactivateObjective() {
476 mainJNI.Assignment_deactivateObjective(swigCPtr, this);
477 }
478
479 public boolean activatedObjective() {
480 return mainJNI.Assignment_activatedObjective(swigCPtr, this);
481 }
482
483 public void ActivateObjectiveFromIndex(int index) {
484 mainJNI.Assignment_ActivateObjectiveFromIndex(swigCPtr, this, index);
485 }
486
487 public void DeactivateObjectiveFromIndex(int index) {
488 mainJNI.Assignment_DeactivateObjectiveFromIndex(swigCPtr, this, index);
489 }
490
491 public boolean ActivatedObjectiveFromIndex(int index) {
492 return mainJNI.Assignment_ActivatedObjectiveFromIndex(swigCPtr, this, index);
493 }
494
495 public String toString() {
496 return mainJNI.Assignment_toString(swigCPtr, this);
497 }
498
499 public boolean AreAllElementsBound() {
500 return mainJNI.Assignment_AreAllElementsBound(swigCPtr, this);
501 }
502
503 public boolean contains(IntVar var) {
504 return mainJNI.Assignment_contains__SWIG_0(swigCPtr, this, IntVar.getCPtr(var), var);
505 }
506
507 public boolean contains(IntervalVar var) {
508 return mainJNI.Assignment_contains__SWIG_1(swigCPtr, this, IntervalVar.getCPtr(var), var);
509 }
510
511 public boolean contains(SequenceVar var) {
512 return mainJNI.Assignment_contains__SWIG_2(swigCPtr, this, SequenceVar.getCPtr(var), var);
513 }
514
519 public void copyIntersection(Assignment assignment) {
520 mainJNI.Assignment_copyIntersection(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
521 }
522
527 public void copy(Assignment assignment) {
528 mainJNI.Assignment_copy(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
529 }
530
532 return new AssignmentIntContainer(mainJNI.Assignment_intVarContainer(swigCPtr, this), false);
533 }
534
536 long cPtr = mainJNI.Assignment_mutableIntVarContainer(swigCPtr, this);
537 return (cPtr == 0) ? null : new AssignmentIntContainer(cPtr, false);
538 }
539
541 return new AssignmentIntervalContainer(mainJNI.Assignment_intervalVarContainer(swigCPtr, this), false);
542 }
543
545 long cPtr = mainJNI.Assignment_mutableIntervalVarContainer(swigCPtr, this);
546 return (cPtr == 0) ? null : new AssignmentIntervalContainer(cPtr, false);
547 }
548
550 return new AssignmentSequenceContainer(mainJNI.Assignment_sequenceVarContainer(swigCPtr, this), false);
551 }
552
554 long cPtr = mainJNI.Assignment_mutableSequenceVarContainer(swigCPtr, this);
555 return (cPtr == 0) ? null : new AssignmentSequenceContainer(cPtr, false);
556 }
557
558}
void setDurationMin(IntervalVar var, long m)
void SetObjectiveRangeFromIndex(int index, long l, long u)
void setEndValue(IntervalVar var, long value)
void save(SWIGTYPE_p_operations_research__AssignmentProto assignment_proto)
void SetObjectiveValueFromIndex(int index, long value)
void setStartValue(IntervalVar var, long value)
AssignmentSequenceContainer mutableSequenceVarContainer()
void setDurationRange(IntervalVar var, long mi, long ma)
AssignmentIntervalContainer intervalVarContainer()
AssignmentSequenceContainer sequenceVarContainer()
void setUnperformed(SequenceVar var, int[] unperformed)
void setStartRange(IntervalVar var, long mi, long ma)
void setStartMax(IntervalVar var, long m)
void setPerformedMin(IntervalVar var, long m)
SequenceVarElement add(SequenceVar var)
IntervalVarElement fastAdd(IntervalVar var)
void setEndMin(IntervalVar var, long m)
Assignment(long cPtr, boolean cMemoryOwn)
void setSequence(SequenceVar var, int[] forward_sequence, int[] backward_sequence, int[] unperformed)
void setEndRange(IntervalVar var, long mi, long ma)
void setForwardSequence(SequenceVar var, int[] forward_sequence)
void setPerformedMax(IntervalVar var, long m)
void setPerformedRange(IntervalVar var, long mi, long ma)
void copyIntersection(Assignment assignment)
AssignmentIntervalContainer mutableIntervalVarContainer()
void setEndMax(IntervalVar var, long m)
SequenceVarElement fastAdd(SequenceVar var)
void setPerformedValue(IntervalVar var, long value)
void setStartMin(IntervalVar var, long m)
IntervalVarElement add(IntervalVar var)
void setRange(IntVar var, long l, long u)
void setDurationMax(IntervalVar var, long m)
void setBackwardSequence(SequenceVar var, int[] backward_sequence)
void setDurationValue(IntervalVar var, long value)