Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
PathOperator.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
11// Used to wrap start_empty_path_class see:
12// https://docs.oracle.com/javase/8/docs/api/java/util/function/LongToIntFunction.html
13import java.util.function.LongToIntFunction;
14
31 private transient long swigCPtr;
32
33 protected PathOperator(long cPtr, boolean cMemoryOwn) {
34 super(mainJNI.PathOperator_SWIGUpcast(cPtr), cMemoryOwn);
35 swigCPtr = cPtr;
36 }
37
38 protected static long getCPtr(PathOperator obj) {
39 return (obj == null) ? 0 : obj.swigCPtr;
40 }
41
42 protected static long swigRelease(PathOperator obj) {
43 long ptr = 0;
44 if (obj != null) {
45 if (!obj.swigCMemOwn)
46 throw new RuntimeException("Cannot release ownership as memory is not owned");
47 ptr = obj.swigCPtr;
48 obj.swigCMemOwn = false;
49 obj.delete();
50 }
51 return ptr;
52 }
53
54 @SuppressWarnings({"deprecation", "removal"})
55 protected void finalize() {
56 delete();
57 }
58
59 public synchronized void delete() {
60 if (swigCPtr != 0) {
61 if (swigCMemOwn) {
62 swigCMemOwn = false;
63 mainJNI.delete_PathOperator(swigCPtr);
64 }
65 swigCPtr = 0;
66 }
67 super.delete();
68 }
69
70 protected void swigDirectorDisconnect() {
71 swigCMemOwn = false;
72 delete();
73 }
74
75 public void swigReleaseOwnership() {
76 swigCMemOwn = false;
77 mainJNI.PathOperator_change_ownership(this, swigCPtr, false);
78 }
79
80 public void swigTakeOwnership() {
81 swigCMemOwn = true;
82 mainJNI.PathOperator_change_ownership(this, swigCPtr, true);
83 }
84
88 public PathOperator(IntVar[] next_vars, IntVar[] path_vars, SWIGTYPE_p_operations_research__PathOperator__IterationParameters iteration_parameters) {
89 this(mainJNI.new_PathOperator__SWIG_0(next_vars, path_vars, SWIGTYPE_p_operations_research__PathOperator__IterationParameters.getCPtr(iteration_parameters)), true);
90 mainJNI.PathOperator_director_connect(this, swigCPtr, true, true);
91 }
92
93 public PathOperator(IntVar[] next_vars, IntVar[] path_vars, int number_of_base_nodes, boolean skip_locally_optimal_paths, boolean accept_path_end_base, LongToIntFunction start_empty_path_class, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_neighbors) {
94 this(mainJNI.new_PathOperator__SWIG_1(next_vars, path_vars, number_of_base_nodes, skip_locally_optimal_paths, accept_path_end_base, start_empty_path_class, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t.getCPtr(get_neighbors)), true);
95 mainJNI.PathOperator_director_connect(this, swigCPtr, true, true);
96 }
97
98 public boolean neighbor() {
99 return mainJNI.PathOperator_neighbor(swigCPtr, this);
100 }
101
102 public void reset() {
103 if (getClass() == PathOperator.class) mainJNI.PathOperator_reset(swigCPtr, this); else mainJNI.PathOperator_resetSwigExplicitPathOperator(swigCPtr, this);
104 }
105
109 public long Prev(long node) {
110 return mainJNI.PathOperator_Prev(swigCPtr, this, node);
111 }
112
116 protected boolean oneNeighbor() {
117 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_oneNeighbor(swigCPtr, this) : mainJNI.PathOperator_oneNeighborSwigExplicitPathOperator(swigCPtr, this);
118 }
119
125 protected void OnNodeInitialization() {
126 if (getClass() == PathOperator.class) mainJNI.PathOperator_OnNodeInitialization(swigCPtr, this); else mainJNI.PathOperator_OnNodeInitializationSwigExplicitPathOperator(swigCPtr, this);
127 }
128
138 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_restartAtPathStartOnSynchronize(swigCPtr, this) : mainJNI.PathOperator_restartAtPathStartOnSynchronizeSwigExplicitPathOperator(swigCPtr, this);
139 }
140
147 protected boolean onSamePathAsPreviousBase(long base_index) {
148 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_onSamePathAsPreviousBase(swigCPtr, this, base_index) : mainJNI.PathOperator_onSamePathAsPreviousBaseSwigExplicitPathOperator(swigCPtr, this, base_index);
149 }
150
158 protected long getBaseNodeRestartPosition(int base_index) {
159 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_getBaseNodeRestartPosition(swigCPtr, this, base_index) : mainJNI.PathOperator_getBaseNodeRestartPositionSwigExplicitPathOperator(swigCPtr, this, base_index);
160 }
161
166 protected void setNextBaseToIncrement(long base_index) {
167 if (getClass() == PathOperator.class) mainJNI.PathOperator_setNextBaseToIncrement(swigCPtr, this, base_index); else mainJNI.PathOperator_setNextBaseToIncrementSwigExplicitPathOperator(swigCPtr, this, base_index);
168 }
169
174 protected boolean ConsiderAlternatives(long base_index) {
175 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_ConsiderAlternatives(swigCPtr, this, base_index) : mainJNI.PathOperator_ConsiderAlternativesSwigExplicitPathOperator(swigCPtr, this, base_index);
176 }
177
182 protected boolean initPosition() {
183 return (getClass() == PathOperator.class) ? mainJNI.PathOperator_initPosition(swigCPtr, this) : mainJNI.PathOperator_initPositionSwigExplicitPathOperator(swigCPtr, this);
184 }
185
186}
PathOperator(long cPtr, boolean cMemoryOwn)
PathOperator(IntVar[] next_vars, IntVar[] path_vars, SWIGTYPE_p_operations_research__PathOperator__IterationParameters iteration_parameters)
PathOperator(IntVar[] next_vars, IntVar[] path_vars, int number_of_base_nodes, boolean skip_locally_optimal_paths, boolean accept_path_end_base, LongToIntFunction start_empty_path_class, SWIGTYPE_p_std__functionT_std__vectorT_int_t_const_Rfint_intF_t get_neighbors)