Java Reference

Java Reference

ImprovementSearchLimit.java
Go to the documentation of this file.
1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
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 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  @SuppressWarnings("deprecation")
24  protected void finalize() {
25  delete();
26  }
27 
28  public synchronized void delete() {
29  if (swigCPtr != 0) {
30  if (swigCMemOwn) {
31  swigCMemOwn = false;
32  mainJNI.delete_ImprovementSearchLimit(swigCPtr);
33  }
34  swigCPtr = 0;
35  }
36  super.delete();
37  }
38 
39  public ImprovementSearchLimit(Solver s, IntVar objective_var, boolean maximize, double objective_scaling_factor, double objective_offset, double improvement_rate_coefficient, int improvement_rate_solutions_distance) {
40  this(mainJNI.new_ImprovementSearchLimit(Solver.getCPtr(s), s, IntVar.getCPtr(objective_var), objective_var, maximize, objective_scaling_factor, objective_offset, improvement_rate_coefficient, improvement_rate_solutions_distance), true);
41  }
42 
43  public void copy(SearchLimit limit) {
44  mainJNI.ImprovementSearchLimit_copy(swigCPtr, this, SearchLimit.getCPtr(limit), limit);
45  }
46 
48  long cPtr = mainJNI.ImprovementSearchLimit_makeClone(swigCPtr, this);
49  return (cPtr == 0) ? null : new SearchLimit(cPtr, false);
50  }
51 
52  public boolean check() {
53  return mainJNI.ImprovementSearchLimit_check(swigCPtr, this);
54  }
55 
56  public boolean atSolution() {
57  return mainJNI.ImprovementSearchLimit_atSolution(swigCPtr, this);
58  }
59 
60  public void init() {
61  mainJNI.ImprovementSearchLimit_init(swigCPtr, this);
62  }
63 
64 }
SearchLimit(long cPtr, boolean cMemoryOwn)
The class IntVar is a subset of IntExpr.
boolean atSolution()
This method is called when a valid solution is found.
void copy(SearchLimit limit)
Copy a limit.
SearchLimit makeClone()
Allocates a clone of the limit.
boolean check()
This method is called to check the status of the limit.
ImprovementSearchLimit(long cPtr, boolean cMemoryOwn)
ImprovementSearchLimit(Solver s, IntVar objective_var, boolean maximize, double objective_scaling_factor, double objective_offset, double improvement_rate_coefficient, int improvement_rate_solutions_distance)
void init()
This method is called when the search limit is initialized.
Solver Class A solver represents the main computation engine.
Definition: Solver.java:73
Base class of all search limits.