Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ModelSolverHelper.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.modelbuilder;
10
11public class ModelSolverHelper {
12 private transient long swigCPtr;
13 protected transient boolean swigCMemOwn;
14
15 protected ModelSolverHelper(long cPtr, boolean cMemoryOwn) {
16 swigCMemOwn = cMemoryOwn;
17 swigCPtr = cPtr;
18 }
19
20 protected static long getCPtr(ModelSolverHelper obj) {
21 return (obj == null) ? 0 : obj.swigCPtr;
22 }
23
24 protected static long swigRelease(ModelSolverHelper obj) {
25 long ptr = 0;
26 if (obj != null) {
27 if (!obj.swigCMemOwn)
28 throw new RuntimeException("Cannot release ownership as memory is not owned");
29 ptr = obj.swigCPtr;
30 obj.swigCMemOwn = false;
31 obj.delete();
32 }
33 return ptr;
34 }
35
36 @SuppressWarnings({"deprecation", "removal"})
37 protected void finalize() {
38 delete();
39 }
40
41 public synchronized void delete() {
42 if (swigCPtr != 0) {
43 if (swigCMemOwn) {
44 swigCMemOwn = false;
45 mainJNI.delete_ModelSolverHelper(swigCPtr);
46 }
47 swigCPtr = 0;
48 }
49 }
50
51 public ModelSolverHelper(String solver_name) {
52 this(mainJNI.new_ModelSolverHelper(solver_name), true);
53 }
54
55 public boolean solverIsSupported() {
56 return mainJNI.ModelSolverHelper_solverIsSupported(swigCPtr, this);
57 }
58
59 public void solve(ModelBuilderHelper model) {
60 mainJNI.ModelSolverHelper_solve(swigCPtr, this, ModelBuilderHelper.getCPtr(model), model);
61 }
62
63 public boolean interruptSolve() {
64 return mainJNI.ModelSolverHelper_interruptSolve(swigCPtr, this);
65 }
66
67 public void setLogCallback(java.util.function.Consumer<String> log_callback) {
68 mainJNI.ModelSolverHelper_setLogCallback(swigCPtr, this, log_callback);
69 }
70
71 public void clearLogCallback() {
72 mainJNI.ModelSolverHelper_clearLogCallback(swigCPtr, this);
73 }
74
75 public boolean hasResponse() {
76 return mainJNI.ModelSolverHelper_hasResponse(swigCPtr, this);
77 }
78
79 public boolean hasSolution() {
80 return mainJNI.ModelSolverHelper_hasSolution(swigCPtr, this);
81 }
82
84 return SolveStatus.swigToEnum(mainJNI.ModelSolverHelper_getStatus(swigCPtr, this));
85 }
86
87 public double getObjectiveValue() {
88 return mainJNI.ModelSolverHelper_getObjectiveValue(swigCPtr, this);
89 }
90
91 public double getBestObjectiveBound() {
92 return mainJNI.ModelSolverHelper_getBestObjectiveBound(swigCPtr, this);
93 }
94
95 public double getVariableValue(int var_index) {
96 return mainJNI.ModelSolverHelper_getVariableValue(swigCPtr, this, var_index);
97 }
98
99 public double getReducedCost(int var_index) {
100 return mainJNI.ModelSolverHelper_getReducedCost(swigCPtr, this, var_index);
101 }
102
103 public double getDualValue(int ct_index) {
104 return mainJNI.ModelSolverHelper_getDualValue(swigCPtr, this, ct_index);
105 }
106
107 public double getActivity(int ct_index) {
108 return mainJNI.ModelSolverHelper_getActivity(swigCPtr, this, ct_index);
109 }
110
111 public String getStatusString() {
112 return mainJNI.ModelSolverHelper_getStatusString(swigCPtr, this);
113 }
114
115 public double getWallTime() {
116 return mainJNI.ModelSolverHelper_getWallTime(swigCPtr, this);
117 }
118
119 public double getUserTime() {
120 return mainJNI.ModelSolverHelper_getUserTime(swigCPtr, this);
121 }
122
123 public void setTimeLimitInSeconds(double limit) {
124 mainJNI.ModelSolverHelper_setTimeLimitInSeconds(swigCPtr, this, limit);
125 }
126
127 public void setSolverSpecificParameters(String solver_specific_parameters) {
128 mainJNI.ModelSolverHelper_setSolverSpecificParameters(swigCPtr, this, solver_specific_parameters);
129 }
130
131 public void enableOutput(boolean enabled) {
132 mainJNI.ModelSolverHelper_enableOutput(swigCPtr, this, enabled);
133 }
134
135}
void setLogCallback(java.util.function.Consumer< String > log_callback)
void setSolverSpecificParameters(String solver_specific_parameters)
static SolveStatus swigToEnum(int swigValue)