Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
ImprovementSearchLimit.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
11public class ImprovementSearchLimit extends SearchLimit {
12 private transient long swigCPtr;
13
14 protected ImprovementSearchLimit(long cPtr, boolean cMemoryOwn) {
15 super(mainJNI.ImprovementSearchLimit_SWIGUpcast(cPtr), cMemoryOwn);
16 swigCPtr = cPtr;
17 }
18
19 protected static long getCPtr(ImprovementSearchLimit obj) {
20 return (obj == null) ? 0 : obj.swigCPtr;
21 }
22
23 protected static long swigRelease(ImprovementSearchLimit obj) {
24 long ptr = 0;
25 if (obj != null) {
26 if (!obj.swigCMemOwn)
27 throw new RuntimeException("Cannot release ownership as memory is not owned");
28 ptr = obj.swigCPtr;
29 obj.swigCMemOwn = false;
30 obj.delete();
31 }
32 return ptr;
33 }
34
35 @SuppressWarnings({"deprecation", "removal"})
36 protected void finalize() {
37 delete();
38 }
39
40 public synchronized void delete() {
41 if (swigCPtr != 0) {
42 if (swigCMemOwn) {
43 swigCMemOwn = false;
44 mainJNI.delete_ImprovementSearchLimit(swigCPtr);
45 }
46 swigCPtr = 0;
47 }
48 super.delete();
49 }
50
51 public ImprovementSearchLimit(Solver solver, IntVar objective_var, boolean maximize, double objective_scaling_factor, double objective_offset, double improvement_rate_coefficient, int improvement_rate_solutions_distance) {
52 this(mainJNI.new_ImprovementSearchLimit__SWIG_0(Solver.getCPtr(solver), solver, IntVar.getCPtr(objective_var), objective_var, maximize, objective_scaling_factor, objective_offset, improvement_rate_coefficient, improvement_rate_solutions_distance), true);
53 }
54
55 public ImprovementSearchLimit(Solver solver, IntVar[] objective_vars, SWIGTYPE_p_std__vectorT_bool_t maximize, double[] objective_scaling_factors, double[] objective_offsets, double improvement_rate_coefficient, int improvement_rate_solutions_distance) {
56 this(mainJNI.new_ImprovementSearchLimit__SWIG_1(Solver.getCPtr(solver), solver, objective_vars, SWIGTYPE_p_std__vectorT_bool_t.getCPtr(maximize), objective_scaling_factors, objective_offsets, improvement_rate_coefficient, improvement_rate_solutions_distance), true);
57 }
58
59 public void copy(SearchLimit limit) {
60 mainJNI.ImprovementSearchLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
61 }
62
64 long cPtr = mainJNI.ImprovementSearchLimit_makeClone(swigCPtr, this);
65 return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
66 }
67
68 public boolean CheckWithOffset(SWIGTYPE_p_absl__Duration offset) {
69 return mainJNI.ImprovementSearchLimit_CheckWithOffset(swigCPtr, this, SWIGTYPE_p_absl__Duration.getCPtr(offset));
70 }
71
72 public boolean atSolution() {
73 return mainJNI.ImprovementSearchLimit_atSolution(swigCPtr, this);
74 }
75
76 public void init() {
77 mainJNI.ImprovementSearchLimit_init(swigCPtr, this);
78 }
79
80 public void install() {
81 mainJNI.ImprovementSearchLimit_install(swigCPtr, this);
82 }
83
84}
ImprovementSearchLimit(Solver solver, IntVar objective_var, boolean maximize, double objective_scaling_factor, double objective_offset, double improvement_rate_coefficient, int improvement_rate_solutions_distance)
ImprovementSearchLimit(Solver solver, IntVar[] objective_vars, SWIGTYPE_p_std__vectorT_bool_t maximize, double[] objective_scaling_factors, double[] objective_offsets, double improvement_rate_coefficient, int improvement_rate_solutions_distance)
SearchLimit(long cPtr, boolean cMemoryOwn)