OR-Tools  7.1
OptimizeVar.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 OptimizeVar extends SearchMonitor {
12  private transient long swigCPtr;
13 
14  protected OptimizeVar(long cPtr, boolean cMemoryOwn) {
15  super(mainJNI.OptimizeVar_SWIGUpcast(cPtr), cMemoryOwn);
16  swigCPtr = cPtr;
17  }
18 
19  protected static long getCPtr(OptimizeVar 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_OptimizeVar(swigCPtr);
32  }
33  swigCPtr = 0;
34  }
35  super.delete();
36  }
37 
38  public OptimizeVar(Solver s, boolean maximize, IntVar a, long step) {
39  this(mainJNI.new_OptimizeVar(Solver.getCPtr(s), s, maximize, IntVar.getCPtr(a), a, step), true);
40  }
41 
42  public long best() {
43  return mainJNI.OptimizeVar_best(swigCPtr, this);
44  }
45 
46  public IntVar var() {
47  long cPtr = mainJNI.OptimizeVar_var(swigCPtr, this);
48  return (cPtr == 0) ? null : new IntVar(cPtr, false);
49  }
50 
51  public boolean acceptDelta(Assignment delta, Assignment deltadelta) {
52  return mainJNI.OptimizeVar_acceptDelta(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta);
53  }
54 
55  public void enterSearch() {
56  mainJNI.OptimizeVar_enterSearch(swigCPtr, this);
57  }
58 
60  mainJNI.OptimizeVar_beginNextDecision(swigCPtr, this, DecisionBuilder.getCPtr(db), db);
61  }
62 
63  public void refuteDecision(Decision d) {
64  mainJNI.OptimizeVar_refuteDecision(swigCPtr, this, Decision.getCPtr(d), d);
65  }
66 
67  public boolean atSolution() {
68  return mainJNI.OptimizeVar_atSolution(swigCPtr, this);
69  }
70 
71  public boolean acceptSolution() {
72  return mainJNI.OptimizeVar_acceptSolution(swigCPtr, this);
73  }
74 
75  public String print() {
76  return mainJNI.OptimizeVar_print(swigCPtr, this);
77  }
78 
79  public String toString() {
80  return mainJNI.OptimizeVar_toString(swigCPtr, this);
81  }
82 
83  public void accept(ModelVisitor visitor) {
84  mainJNI.OptimizeVar_accept(swigCPtr, this, ModelVisitor.getCPtr(visitor), visitor);
85  }
86 
87  public void applyBound() {
88  mainJNI.OptimizeVar_applyBound(swigCPtr, this);
89  }
90 
91 }
static long getCPtr(Solver obj)
Definition: Solver.java:63
OptimizeVar(long cPtr, boolean cMemoryOwn)
OptimizeVar(Solver s, boolean maximize, IntVar a, long step)
boolean acceptDelta(Assignment delta, Assignment deltadelta)