Java Reference

Java Reference

CPFeasibilityFilter.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.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 
9 package com.google.ortools.constraintsolver;
10 
15  private transient long swigCPtr;
16 
17  protected CPFeasibilityFilter(long cPtr, boolean cMemoryOwn) {
18  super(mainJNI.CPFeasibilityFilter_SWIGUpcast(cPtr), cMemoryOwn);
19  swigCPtr = cPtr;
20  }
21 
22  protected static long getCPtr(CPFeasibilityFilter obj) {
23  return (obj == null) ? 0 : obj.swigCPtr;
24  }
25 
26  @SuppressWarnings("deprecation")
27  protected void finalize() {
28  delete();
29  }
30 
31  public synchronized void delete() {
32  if (swigCPtr != 0) {
33  if (swigCMemOwn) {
34  swigCMemOwn = false;
35  mainJNI.delete_CPFeasibilityFilter(swigCPtr);
36  }
37  swigCPtr = 0;
38  }
39  super.delete();
40  }
41 
42  public CPFeasibilityFilter(RoutingModel routing_model) {
43  this(mainJNI.new_CPFeasibilityFilter(RoutingModel.getCPtr(routing_model), routing_model), true);
44  }
45 
46  public String toString() {
47  return mainJNI.CPFeasibilityFilter_toString(swigCPtr, this);
48  }
49 
50  public boolean accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max) {
51  return mainJNI.CPFeasibilityFilter_accept(swigCPtr, this, Assignment.getCPtr(delta), delta, Assignment.getCPtr(deltadelta), deltadelta, objective_min, objective_max);
52  }
53 
54  public void onSynchronize(Assignment delta) {
55  mainJNI.CPFeasibilityFilter_onSynchronize(swigCPtr, this, Assignment.getCPtr(delta), delta);
56  }
57 
58 }
String toString()
CPFeasibilityFilter(RoutingModel routing_model)
boolean accept(Assignment delta, Assignment deltadelta, long objective_min, long objective_max)
Accepts a "delta" given the assignment with which the filter has been synchronized; the delta holds t...
CPFeasibilityFilter(long cPtr, boolean cMemoryOwn)
void onSynchronize(Assignment delta)
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition: Assignment.java:14
This filter accepts deltas for which the assignment satisfies the constraints of the Solver.