Java Reference

Java Reference

RoutingModel.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 
11 // Used to wrap RoutingTransitCallback2
12 // see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongBinaryOperator.html
13 import java.util.function.LongBinaryOperator;
14 // Used to wrap RoutingTransitCallback1
15 // see https://docs.oracle.com/javase/8/docs/api/java/util/function/LongUnaryOperator.html
16 import java.util.function.LongUnaryOperator;
17 
18 public class RoutingModel {
19  private transient long swigCPtr;
20  protected transient boolean swigCMemOwn;
21 
22  public RoutingModel(long cPtr, boolean cMemoryOwn) {
23  swigCMemOwn = cMemoryOwn;
24  swigCPtr = cPtr;
25  }
26 
27  protected static long getCPtr(RoutingModel obj) {
28  return (obj == null) ? 0 : obj.swigCPtr;
29  }
30 
31  @SuppressWarnings("deprecation")
32  protected void finalize() {
33  delete();
34  }
35 
36  public synchronized void delete() {
37  if (swigCPtr != 0) {
38  if (swigCMemOwn) {
39  swigCMemOwn = false;
40  mainJNI.delete_RoutingModel(swigCPtr);
41  }
42  swigCPtr = 0;
43  }
44  }
45 
49  static public class VehicleTypeContainer {
50  private transient long swigCPtr;
51  protected transient boolean swigCMemOwn;
52 
53  public VehicleTypeContainer(long cPtr, boolean cMemoryOwn) {
54  swigCMemOwn = cMemoryOwn;
55  swigCPtr = cPtr;
56  }
57 
58  protected static long getCPtr(VehicleTypeContainer obj) {
59  return (obj == null) ? 0 : obj.swigCPtr;
60  }
61 
62  @SuppressWarnings("deprecation")
63  protected void finalize() {
64  delete();
65  }
66 
67  public synchronized void delete() {
68  if (swigCPtr != 0) {
69  if (swigCMemOwn) {
70  swigCMemOwn = false;
71  mainJNI.delete_RoutingModel_VehicleTypeContainer(swigCPtr);
72  }
73  swigCPtr = 0;
74  }
75  }
76 
77  static public class VehicleClassEntry {
78  private transient long swigCPtr;
79  protected transient boolean swigCMemOwn;
80 
81  public VehicleClassEntry(long cPtr, boolean cMemoryOwn) {
82  swigCMemOwn = cMemoryOwn;
83  swigCPtr = cPtr;
84  }
85 
86  protected static long getCPtr(VehicleClassEntry obj) {
87  return (obj == null) ? 0 : obj.swigCPtr;
88  }
89 
90  @SuppressWarnings("deprecation")
91  protected void finalize() {
92  delete();
93  }
94 
95  public synchronized void delete() {
96  if (swigCPtr != 0) {
97  if (swigCMemOwn) {
98  swigCMemOwn = false;
99  mainJNI.delete_RoutingModel_VehicleTypeContainer_VehicleClassEntry(swigCPtr);
100  }
101  swigCPtr = 0;
102  }
103  }
104 
105  public void setVehicle_class(int value) {
106  mainJNI.RoutingModel_VehicleTypeContainer_VehicleClassEntry_vehicle_class_set(swigCPtr, this, value);
107  }
108 
109  public int getVehicle_class() {
110  return mainJNI.RoutingModel_VehicleTypeContainer_VehicleClassEntry_vehicle_class_get(swigCPtr, this);
111  }
112 
113  public void setFixed_cost(long value) {
114  mainJNI.RoutingModel_VehicleTypeContainer_VehicleClassEntry_fixed_cost_set(swigCPtr, this, value);
115  }
116 
117  public long getFixed_cost() {
118  return mainJNI.RoutingModel_VehicleTypeContainer_VehicleClassEntry_fixed_cost_get(swigCPtr, this);
119  }
120 
121  public VehicleClassEntry() {
122  this(mainJNI.new_RoutingModel_VehicleTypeContainer_VehicleClassEntry(), true);
123  }
124 
125  }
126 
127  public int NumTypes() {
128  return mainJNI.RoutingModel_VehicleTypeContainer_NumTypes(swigCPtr, this);
129  }
130 
131  public int Type(int vehicle) {
132  return mainJNI.RoutingModel_VehicleTypeContainer_Type(swigCPtr, this, vehicle);
133  }
134 
135  public void setType_index_of_vehicle(int[] value) {
136  mainJNI.RoutingModel_VehicleTypeContainer_type_index_of_vehicle_set(swigCPtr, this, value);
137  }
138 
139  public int[] getType_index_of_vehicle() {
140  return mainJNI.RoutingModel_VehicleTypeContainer_type_index_of_vehicle_get(swigCPtr, this);
141  }
142 
143  public void setSorted_vehicle_classes_per_type(SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t value) {
144  mainJNI.RoutingModel_VehicleTypeContainer_sorted_vehicle_classes_per_type_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t.getCPtr(value));
145  }
146 
147  public SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t getSorted_vehicle_classes_per_type() {
148  long cPtr = mainJNI.RoutingModel_VehicleTypeContainer_sorted_vehicle_classes_per_type_get(swigCPtr, this);
149  return (cPtr == 0) ? null : new SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t(cPtr, false);
150  }
151 
152  public void setVehicles_per_vehicle_class(SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t value) {
153  mainJNI.RoutingModel_VehicleTypeContainer_vehicles_per_vehicle_class_set(swigCPtr, this, SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t.getCPtr(value));
154  }
155 
156  public SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t getVehicles_per_vehicle_class() {
157  return new SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t(mainJNI.RoutingModel_VehicleTypeContainer_vehicles_per_vehicle_class_get(swigCPtr, this), true);
158  }
159 
161  this(mainJNI.new_RoutingModel_VehicleTypeContainer(), true);
162  }
163 
164  }
165 
169  static public class ResourceGroup {
170  private transient long swigCPtr;
171  protected transient boolean swigCMemOwn;
172 
173  public ResourceGroup(long cPtr, boolean cMemoryOwn) {
174  swigCMemOwn = cMemoryOwn;
175  swigCPtr = cPtr;
176  }
177 
178  protected static long getCPtr(ResourceGroup obj) {
179  return (obj == null) ? 0 : obj.swigCPtr;
180  }
181 
182  @SuppressWarnings("deprecation")
183  protected void finalize() {
184  delete();
185  }
186 
187  public synchronized void delete() {
188  if (swigCPtr != 0) {
189  if (swigCMemOwn) {
190  swigCMemOwn = false;
191  mainJNI.delete_RoutingModel_ResourceGroup(swigCPtr);
192  }
193  swigCPtr = 0;
194  }
195  }
196 
200  static public class Attributes {
201  private transient long swigCPtr;
202  protected transient boolean swigCMemOwn;
203 
204  public Attributes(long cPtr, boolean cMemoryOwn) {
205  swigCMemOwn = cMemoryOwn;
206  swigCPtr = cPtr;
207  }
208 
209  protected static long getCPtr(Attributes obj) {
210  return (obj == null) ? 0 : obj.swigCPtr;
211  }
212 
213  @SuppressWarnings("deprecation")
214  protected void finalize() {
215  delete();
216  }
217 
218  public synchronized void delete() {
219  if (swigCPtr != 0) {
220  if (swigCMemOwn) {
221  swigCMemOwn = false;
222  mainJNI.delete_RoutingModel_ResourceGroup_Attributes(swigCPtr);
223  }
224  swigCPtr = 0;
225  }
226  }
227 
228  public Attributes() {
229  this(mainJNI.new_RoutingModel_ResourceGroup_Attributes__SWIG_0(), true);
230  }
231 
233  this(mainJNI.new_RoutingModel_ResourceGroup_Attributes__SWIG_1(Domain.getCPtr(start_domain), start_domain, Domain.getCPtr(end_domain), end_domain), true);
234  }
235 
236  public Domain start_domain() {
237  return new Domain(mainJNI.RoutingModel_ResourceGroup_Attributes_start_domain(swigCPtr, this), false);
238  }
239 
240  public Domain end_domain() {
241  return new Domain(mainJNI.RoutingModel_ResourceGroup_Attributes_end_domain(swigCPtr, this), false);
242  }
243 
244  }
245 
249  static public class Resource {
250  private transient long swigCPtr;
251  protected transient boolean swigCMemOwn;
252 
253  public Resource(long cPtr, boolean cMemoryOwn) {
254  swigCMemOwn = cMemoryOwn;
255  swigCPtr = cPtr;
256  }
257 
258  protected static long getCPtr(Resource obj) {
259  return (obj == null) ? 0 : obj.swigCPtr;
260  }
261 
262  @SuppressWarnings("deprecation")
263  protected void finalize() {
264  delete();
265  }
266 
267  public synchronized void delete() {
268  if (swigCPtr != 0) {
269  if (swigCMemOwn) {
270  swigCMemOwn = false;
271  mainJNI.delete_RoutingModel_ResourceGroup_Resource(swigCPtr);
272  }
273  swigCPtr = 0;
274  }
275  }
276 
278  return new RoutingModel.ResourceGroup.Attributes(mainJNI.RoutingModel_ResourceGroup_Resource_GetDimensionAttributes(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension), false);
279  }
280 
281  }
282 
283  public ResourceGroup(RoutingModel model) {
284  this(mainJNI.new_RoutingModel_ResourceGroup(RoutingModel.getCPtr(model), model), true);
285  }
286 
291  return mainJNI.RoutingModel_ResourceGroup_AddResource(swigCPtr, this, RoutingModel.ResourceGroup.Attributes.getCPtr(attributes), attributes, RoutingDimension.getCPtr(dimension), dimension);
292  }
293 
297  public void NotifyVehicleRequiresAResource(int vehicle) {
298  mainJNI.RoutingModel_ResourceGroup_NotifyVehicleRequiresAResource(swigCPtr, this, vehicle);
299  }
300 
302  return mainJNI.RoutingModel_ResourceGroup_GetVehiclesRequiringAResource(swigCPtr, this);
303  }
304 
305  public boolean VehicleRequiresAResource(int vehicle) {
306  return mainJNI.RoutingModel_ResourceGroup_VehicleRequiresAResource(swigCPtr, this, vehicle);
307  }
308 
309  public SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_t GetResources() {
310  return new SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_t(mainJNI.RoutingModel_ResourceGroup_GetResources(swigCPtr, this), false);
311  }
312 
313  public RoutingModel.ResourceGroup.Resource GetResource(int resource_index) {
314  return new RoutingModel.ResourceGroup.Resource(mainJNI.RoutingModel_ResourceGroup_GetResource(swigCPtr, this, resource_index), false);
315  }
316 
317  public SWIGTYPE_p_absl__flat_hash_setT_operations_research__RoutingModel__DimensionIndex_t GetAffectedDimensionIndices() {
318  return new SWIGTYPE_p_absl__flat_hash_setT_operations_research__RoutingModel__DimensionIndex_t(mainJNI.RoutingModel_ResourceGroup_GetAffectedDimensionIndices(swigCPtr, this), false);
319  }
320 
321  public int Size() {
322  return mainJNI.RoutingModel_ResourceGroup_Size(swigCPtr, this);
323  }
324 
325  }
326 
330  public static long getKNoPenalty() {
331  return mainJNI.RoutingModel_kNoPenalty_get();
332  }
333 
337  public static int getKNoDisjunction() {
338  return mainJNI.RoutingModel_kNoDisjunction_get();
339 }
340 
344  public static int getKNoDimension() {
345  return mainJNI.RoutingModel_kNoDimension_get();
346 }
347 
351  public RoutingModel(RoutingIndexManager index_manager) {
352  this(mainJNI.new_RoutingModel__SWIG_0(RoutingIndexManager.getCPtr(index_manager), index_manager), true);
353  }
354 
356  this(mainJNI.new_RoutingModel__SWIG_1(RoutingIndexManager.getCPtr(index_manager), index_manager, parameters.toByteArray()), true);
357  }
358 
362  public int registerUnaryTransitVector(long[] values) {
363  return mainJNI.RoutingModel_registerUnaryTransitVector(swigCPtr, this, values);
364  }
365 
366  public int registerUnaryTransitCallback(LongUnaryOperator callback) {
367  return mainJNI.RoutingModel_registerUnaryTransitCallback(swigCPtr, this, callback);
368  }
369 
370  public int registerPositiveUnaryTransitCallback(LongUnaryOperator callback) {
371  return mainJNI.RoutingModel_registerPositiveUnaryTransitCallback(swigCPtr, this, callback);
372  }
373 
374  public int registerTransitMatrix(long[][] values) {
375  return mainJNI.RoutingModel_registerTransitMatrix(swigCPtr, this, values);
376  }
377 
378  public int registerTransitCallback(LongBinaryOperator callback) {
379  return mainJNI.RoutingModel_registerTransitCallback(swigCPtr, this, callback);
380  }
381 
382  public int registerPositiveTransitCallback(LongBinaryOperator callback) {
383  return mainJNI.RoutingModel_registerPositiveTransitCallback(swigCPtr, this, callback);
384  }
385 
389  public boolean addDimension(int evaluator_index, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) {
390  return mainJNI.RoutingModel_addDimension(swigCPtr, this, evaluator_index, slack_max, capacity, fix_start_cumul_to_zero, name);
391  }
392 
393  public boolean addDimensionWithVehicleTransits(int[] evaluator_indices, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name) {
394  return mainJNI.RoutingModel_addDimensionWithVehicleTransits(swigCPtr, this, evaluator_indices, slack_max, capacity, fix_start_cumul_to_zero, name);
395  }
396 
397  public boolean addDimensionWithVehicleCapacity(int evaluator_index, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) {
398  return mainJNI.RoutingModel_addDimensionWithVehicleCapacity(swigCPtr, this, evaluator_index, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name);
399  }
400 
401  public boolean addDimensionWithVehicleTransitAndCapacity(int[] evaluator_indices, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name) {
402  return mainJNI.RoutingModel_addDimensionWithVehicleTransitAndCapacity(swigCPtr, this, evaluator_indices, slack_max, vehicle_capacities, fix_start_cumul_to_zero, name);
403  }
404 
408  public IntBoolPair addConstantDimensionWithSlack(long value, long capacity, long slack_max, boolean fix_start_cumul_to_zero, String name) {
409  return new IntBoolPair(mainJNI.RoutingModel_addConstantDimensionWithSlack(swigCPtr, this, value, capacity, slack_max, fix_start_cumul_to_zero, name), true);
410  }
411 
412  public IntBoolPair addConstantDimension(long value, long capacity, boolean fix_start_cumul_to_zero, String name) {
413  return new IntBoolPair(mainJNI.RoutingModel_addConstantDimension(swigCPtr, this, value, capacity, fix_start_cumul_to_zero, name), true);
414  }
415 
419  public IntBoolPair addVectorDimension(long[] values, long capacity, boolean fix_start_cumul_to_zero, String name) {
420  return new IntBoolPair(mainJNI.RoutingModel_addVectorDimension(swigCPtr, this, values, capacity, fix_start_cumul_to_zero, name), true);
421  }
422 
426  public IntBoolPair addMatrixDimension(long[][] values, long capacity, boolean fix_start_cumul_to_zero, String name) {
427  return new IntBoolPair(mainJNI.RoutingModel_addMatrixDimension(swigCPtr, this, values, capacity, fix_start_cumul_to_zero, name), true);
428  }
429 
433  public Constraint MakePathSpansAndTotalSlacks(RoutingDimension dimension, IntVar[] spans, IntVar[] total_slacks) {
434  long cPtr = mainJNI.RoutingModel_MakePathSpansAndTotalSlacks(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension, spans, total_slacks);
435  return (cPtr == 0) ? null : new Constraint(cPtr, false);
436  }
437 
438  public SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__GlobalDimensionCumulOptimizer_t_t GetGlobalDimensionCumulMPOptimizers() {
439  return new SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__GlobalDimensionCumulOptimizer_t_t(mainJNI.RoutingModel_GetGlobalDimensionCumulMPOptimizers(swigCPtr, this), false);
440  }
441 
442  public SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer GetMutableGlobalCumulMPOptimizer(RoutingDimension dimension) {
443  long cPtr = mainJNI.RoutingModel_GetMutableGlobalCumulMPOptimizer(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension);
444  return (cPtr == 0) ? null : new SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer(cPtr, false);
445  }
446 
450  public boolean hasDimension(String dimension_name) {
451  return mainJNI.RoutingModel_hasDimension(swigCPtr, this, dimension_name);
452  }
453 
457  public RoutingDimension getDimensionOrDie(String dimension_name) {
458  return new RoutingDimension(mainJNI.RoutingModel_getDimensionOrDie(swigCPtr, this, dimension_name), false);
459  }
460 
464  public RoutingDimension getMutableDimension(String dimension_name) {
465  long cPtr = mainJNI.RoutingModel_getMutableDimension(swigCPtr, this, dimension_name);
466  return (cPtr == 0) ? null : new RoutingDimension(cPtr, false);
467  }
468 
472  public void setPrimaryConstrainedDimension(String dimension_name) {
473  mainJNI.RoutingModel_setPrimaryConstrainedDimension(swigCPtr, this, dimension_name);
474  }
475 
480  return mainJNI.RoutingModel_getPrimaryConstrainedDimension(swigCPtr, this);
481  }
482 
486  public int AddResourceGroup() {
487  return mainJNI.RoutingModel_AddResourceGroup(swigCPtr, this);
488  }
489 
490  public SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__RoutingModel__ResourceGroup_t_t GetResourceGroups() {
491  return new SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__RoutingModel__ResourceGroup_t_t(mainJNI.RoutingModel_GetResourceGroups(swigCPtr, this), false);
492  }
493 
495  long cPtr = mainJNI.RoutingModel_GetResourceGroup(swigCPtr, this, rg_index);
496  return (cPtr == 0) ? null : new RoutingModel.ResourceGroup(cPtr, false);
497  }
498 
503  return mainJNI.RoutingModel_GetDimensionResourceGroupIndices(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension);
504 }
505 
510  return mainJNI.RoutingModel_GetDimensionResourceGroupIndex(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension);
511  }
512 
516  public int addDisjunction(long[] indices, long penalty, long max_cardinality) {
517  return mainJNI.RoutingModel_addDisjunction__SWIG_0(swigCPtr, this, indices, penalty, max_cardinality);
518 }
519 
523  public int addDisjunction(long[] indices, long penalty) {
524  return mainJNI.RoutingModel_addDisjunction__SWIG_1(swigCPtr, this, indices, penalty);
525 }
526 
530  public int addDisjunction(long[] indices) {
531  return mainJNI.RoutingModel_addDisjunction__SWIG_2(swigCPtr, this, indices);
532 }
533 
537  public int[] getDisjunctionIndices(long index) {
538  return mainJNI.RoutingModel_getDisjunctionIndices(swigCPtr, this, index);
539 }
540 
544  public long[] GetDisjunctionNodeIndices(int index) {
545  return mainJNI.RoutingModel_GetDisjunctionNodeIndices(swigCPtr, this, index);
546 }
547 
551  public long getDisjunctionPenalty(int index) {
552  return mainJNI.RoutingModel_getDisjunctionPenalty(swigCPtr, this, index);
553  }
554 
558  public long getDisjunctionMaxCardinality(int index) {
559  return mainJNI.RoutingModel_getDisjunctionMaxCardinality(swigCPtr, this, index);
560  }
561 
565  public int getNumberOfDisjunctions() {
566  return mainJNI.RoutingModel_getNumberOfDisjunctions(swigCPtr, this);
567  }
568 
572  public boolean HasMandatoryDisjunctions() {
573  return mainJNI.RoutingModel_HasMandatoryDisjunctions(swigCPtr, this);
574  }
575 
580  return mainJNI.RoutingModel_HasMaxCardinalityConstrainedDisjunctions(swigCPtr, this);
581  }
582 
587  mainJNI.RoutingModel_ignoreDisjunctionsAlreadyForcedToZero(swigCPtr, this);
588  }
589 
593  public void addSoftSameVehicleConstraint(long[] indices, long cost) {
594  mainJNI.RoutingModel_addSoftSameVehicleConstraint(swigCPtr, this, indices, cost);
595  }
596 
600  public void setAllowedVehiclesForIndex(int[] vehicles, long index) {
601  mainJNI.RoutingModel_setAllowedVehiclesForIndex(swigCPtr, this, vehicles, index);
602  }
603 
607  public boolean isVehicleAllowedForIndex(int vehicle, long index) {
608  return mainJNI.RoutingModel_isVehicleAllowedForIndex(swigCPtr, this, vehicle, index);
609  }
610 
614  public void addPickupAndDelivery(long pickup, long delivery) {
615  mainJNI.RoutingModel_addPickupAndDelivery(swigCPtr, this, pickup, delivery);
616  }
617 
621  public void addPickupAndDeliverySets(int pickup_disjunction, int delivery_disjunction) {
622  mainJNI.RoutingModel_addPickupAndDeliverySets(swigCPtr, this, pickup_disjunction, delivery_disjunction);
623  }
624 
628  public void setPickupAndDeliveryPolicyOfAllVehicles(int policy) {
629  mainJNI.RoutingModel_setPickupAndDeliveryPolicyOfAllVehicles(swigCPtr, this, policy);
630  }
631 
632  public void setPickupAndDeliveryPolicyOfVehicle(int policy, int vehicle) {
633  mainJNI.RoutingModel_setPickupAndDeliveryPolicyOfVehicle(swigCPtr, this, policy, vehicle);
634  }
635 
636  public int getPickupAndDeliveryPolicyOfVehicle(int vehicle) {
637  return mainJNI.RoutingModel_getPickupAndDeliveryPolicyOfVehicle(swigCPtr, this, vehicle);
638  }
639 
643  public int getNumOfSingletonNodes() {
644  return mainJNI.RoutingModel_getNumOfSingletonNodes(swigCPtr, this);
645  }
646 
647  public void setVisitType(long index, int type, int type_policy) {
648  mainJNI.RoutingModel_setVisitType(swigCPtr, this, index, type, type_policy);
649  }
650 
651  public int getVisitType(long index) {
652  return mainJNI.RoutingModel_getVisitType(swigCPtr, this, index);
653  }
654 
655  public int[] GetSingleNodesOfType(int type) {
656  return mainJNI.RoutingModel_GetSingleNodesOfType(swigCPtr, this, type);
657 }
658 
659  public int[] GetPairIndicesOfType(int type) {
660  return mainJNI.RoutingModel_GetPairIndicesOfType(swigCPtr, this, type);
661 }
662 
663  public int GetVisitTypePolicy(long index) {
664  return mainJNI.RoutingModel_GetVisitTypePolicy(swigCPtr, this, index);
665  }
666 
670  public void closeVisitTypes() {
671  mainJNI.RoutingModel_closeVisitTypes(swigCPtr, this);
672  }
673 
674  public int getNumberOfVisitTypes() {
675  return mainJNI.RoutingModel_getNumberOfVisitTypes(swigCPtr, this);
676  }
677 
681  public void addHardTypeIncompatibility(int type1, int type2) {
682  mainJNI.RoutingModel_addHardTypeIncompatibility(swigCPtr, this, type1, type2);
683  }
684 
685  public void addTemporalTypeIncompatibility(int type1, int type2) {
686  mainJNI.RoutingModel_addTemporalTypeIncompatibility(swigCPtr, this, type1, type2);
687  }
688 
689  public SWIGTYPE_p_absl__flat_hash_setT_int_t getTemporalTypeIncompatibilitiesOfType(int type) {
690  return new SWIGTYPE_p_absl__flat_hash_setT_int_t(mainJNI.RoutingModel_getTemporalTypeIncompatibilitiesOfType(swigCPtr, this, type), false);
691  }
692 
696  public boolean hasHardTypeIncompatibilities() {
697  return mainJNI.RoutingModel_hasHardTypeIncompatibilities(swigCPtr, this);
698  }
699 
701  return mainJNI.RoutingModel_hasTemporalTypeIncompatibilities(swigCPtr, this);
702  }
703 
707  public void addRequiredTypeAlternativesWhenAddingType(int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives) {
708  mainJNI.RoutingModel_addRequiredTypeAlternativesWhenAddingType(swigCPtr, this, dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t.getCPtr(required_type_alternatives));
709  }
710 
714  public void addRequiredTypeAlternativesWhenRemovingType(int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives) {
715  mainJNI.RoutingModel_addRequiredTypeAlternativesWhenRemovingType(swigCPtr, this, dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t.getCPtr(required_type_alternatives));
716  }
717 
721  public SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t GetRequiredTypeAlternativesWhenAddingType(int type) {
722  return new SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t(mainJNI.RoutingModel_GetRequiredTypeAlternativesWhenAddingType(swigCPtr, this, type), false);
723  }
724 
728  public SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t GetRequiredTypeAlternativesWhenRemovingType(int type) {
729  return new SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t(mainJNI.RoutingModel_GetRequiredTypeAlternativesWhenRemovingType(swigCPtr, this, type), false);
730  }
731 
736  return mainJNI.RoutingModel_hasSameVehicleTypeRequirements(swigCPtr, this);
737  }
738 
739  public boolean hasTemporalTypeRequirements() {
740  return mainJNI.RoutingModel_hasTemporalTypeRequirements(swigCPtr, this);
741  }
742 
746  public long unperformedPenalty(long var_index) {
747  return mainJNI.RoutingModel_unperformedPenalty(swigCPtr, this, var_index);
748  }
749 
753  public long unperformedPenaltyOrValue(long default_value, long var_index) {
754  return mainJNI.RoutingModel_unperformedPenaltyOrValue(swigCPtr, this, default_value, var_index);
755  }
756 
760  public long getDepot() {
761  return mainJNI.RoutingModel_getDepot(swigCPtr, this);
762  }
763 
767  public void SetMaximumNumberOfActiveVehicles(int max_active_vehicles) {
768  mainJNI.RoutingModel_SetMaximumNumberOfActiveVehicles(swigCPtr, this, max_active_vehicles);
769  }
770 
775  return mainJNI.RoutingModel_GetMaximumNumberOfActiveVehicles(swigCPtr, this);
776  }
777 
781  public void setArcCostEvaluatorOfAllVehicles(int evaluator_index) {
782  mainJNI.RoutingModel_setArcCostEvaluatorOfAllVehicles(swigCPtr, this, evaluator_index);
783  }
784 
788  public void setArcCostEvaluatorOfVehicle(int evaluator_index, int vehicle) {
789  mainJNI.RoutingModel_setArcCostEvaluatorOfVehicle(swigCPtr, this, evaluator_index, vehicle);
790  }
791 
795  public void setFixedCostOfAllVehicles(long cost) {
796  mainJNI.RoutingModel_setFixedCostOfAllVehicles(swigCPtr, this, cost);
797  }
798 
802  public void setFixedCostOfVehicle(long cost, int vehicle) {
803  mainJNI.RoutingModel_setFixedCostOfVehicle(swigCPtr, this, cost, vehicle);
804  }
805 
809  public long getFixedCostOfVehicle(int vehicle) {
810  return mainJNI.RoutingModel_getFixedCostOfVehicle(swigCPtr, this, vehicle);
811  }
812 
816  public void setAmortizedCostFactorsOfAllVehicles(long linear_cost_factor, long quadratic_cost_factor) {
817  mainJNI.RoutingModel_setAmortizedCostFactorsOfAllVehicles(swigCPtr, this, linear_cost_factor, quadratic_cost_factor);
818  }
819 
823  public void setAmortizedCostFactorsOfVehicle(long linear_cost_factor, long quadratic_cost_factor, int vehicle) {
824  mainJNI.RoutingModel_setAmortizedCostFactorsOfVehicle(swigCPtr, this, linear_cost_factor, quadratic_cost_factor, vehicle);
825  }
826 
828  return mainJNI.RoutingModel_getAmortizedLinearCostFactorOfVehicles(swigCPtr, this);
829 }
830 
832  return mainJNI.RoutingModel_getAmortizedQuadraticCostFactorOfVehicles(swigCPtr, this);
833 }
834 
835  public void SetVehicleUsedWhenEmpty(boolean is_used, int vehicle) {
836  mainJNI.RoutingModel_SetVehicleUsedWhenEmpty(swigCPtr, this, is_used, vehicle);
837  }
838 
839  public boolean IsVehicleUsedWhenEmpty(int vehicle) {
840  return mainJNI.RoutingModel_IsVehicleUsedWhenEmpty(swigCPtr, this, vehicle);
841  }
842 
846  public void setFirstSolutionEvaluator(LongBinaryOperator evaluator) {
847  mainJNI.RoutingModel_setFirstSolutionEvaluator(swigCPtr, this, evaluator);
848  }
849 
853  public void addLocalSearchOperator(LocalSearchOperator ls_operator) {
854  mainJNI.RoutingModel_addLocalSearchOperator(swigCPtr, this, LocalSearchOperator.getCPtr(ls_operator), ls_operator);
855  }
856 
860  public void addSearchMonitor(SearchMonitor monitor) {
861  mainJNI.RoutingModel_addSearchMonitor(swigCPtr, this, SearchMonitor.getCPtr(monitor), monitor);
862  }
863 
867  public void addAtSolutionCallback(Runnable callback) {
868  mainJNI.RoutingModel_addAtSolutionCallback(swigCPtr, this, callback);
869  }
870 
875  mainJNI.RoutingModel_addVariableMinimizedByFinalizer(swigCPtr, this, IntVar.getCPtr(var), var);
876  }
877 
882  mainJNI.RoutingModel_addVariableMaximizedByFinalizer(swigCPtr, this, IntVar.getCPtr(var), var);
883  }
884 
888  public void AddWeightedVariableMinimizedByFinalizer(IntVar var, long cost) {
889  mainJNI.RoutingModel_AddWeightedVariableMinimizedByFinalizer(swigCPtr, this, IntVar.getCPtr(var), var, cost);
890  }
891 
895  public void addVariableTargetToFinalizer(IntVar var, long target) {
896  mainJNI.RoutingModel_addVariableTargetToFinalizer(swigCPtr, this, IntVar.getCPtr(var), var, target);
897  }
898 
902  public void closeModel() {
903  mainJNI.RoutingModel_closeModel(swigCPtr, this);
904  }
905 
910  mainJNI.RoutingModel_closeModelWithParameters(swigCPtr, this, search_parameters.toByteArray());
911  }
912 
916  public Assignment solve(Assignment assignment) {
917  long cPtr = mainJNI.RoutingModel_solve__SWIG_0(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
918  return (cPtr == 0) ? null : new Assignment(cPtr, false);
919  }
920 
924  public Assignment solve() {
925  long cPtr = mainJNI.RoutingModel_solve__SWIG_1(swigCPtr, this);
926  return (cPtr == 0) ? null : new Assignment(cPtr, false);
927  }
928 
933  long cPtr = mainJNI.RoutingModel_solveWithParameters(swigCPtr, this, search_parameters.toByteArray());
934  return (cPtr == 0) ? null : new Assignment(cPtr, false);
935  }
936 
941  long cPtr = mainJNI.RoutingModel_solveFromAssignmentWithParameters(swigCPtr, this, Assignment.getCPtr(assignment), assignment, search_parameters.toByteArray());
942  return (cPtr == 0) ? null : new Assignment(cPtr, false);
943  }
944 
948  public Assignment SolveFromAssignmentsWithParameters(SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t solutions) {
949  long cPtr = mainJNI.RoutingModel_SolveFromAssignmentsWithParameters__SWIG_0(swigCPtr, this, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t.getCPtr(assignments), search_parameters.toByteArray(), SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t.getCPtr(solutions));
950  return (cPtr == 0) ? null : new Assignment(cPtr, false);
951  }
952 
956  public Assignment SolveFromAssignmentsWithParameters(SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters) {
957  long cPtr = mainJNI.RoutingModel_SolveFromAssignmentsWithParameters__SWIG_1(swigCPtr, this, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t.getCPtr(assignments), search_parameters.toByteArray());
958  return (cPtr == 0) ? null : new Assignment(cPtr, false);
959  }
960 
964  public void setAssignmentFromOtherModelAssignment(Assignment target_assignment, RoutingModel source_model, Assignment source_assignment) {
965  mainJNI.RoutingModel_setAssignmentFromOtherModelAssignment(swigCPtr, this, Assignment.getCPtr(target_assignment), target_assignment, RoutingModel.getCPtr(source_model), source_model, Assignment.getCPtr(source_assignment), source_assignment);
966  }
967 
971  public long computeLowerBound() {
972  return mainJNI.RoutingModel_computeLowerBound(swigCPtr, this);
973  }
974 
978  public int status() {
979  return mainJNI.RoutingModel_status(swigCPtr, this);
980  }
981 
985  public IntVar applyLocks(long[] locks) {
986  long cPtr = mainJNI.RoutingModel_applyLocks(swigCPtr, this, locks);
987  return (cPtr == 0) ? null : new IntVar(cPtr, false);
988  }
989 
993  public boolean applyLocksToAllVehicles(long[][] locks, boolean close_routes) {
994  return mainJNI.RoutingModel_applyLocksToAllVehicles(swigCPtr, this, locks, close_routes);
995  }
996 
1001  long cPtr = mainJNI.RoutingModel_preAssignment(swigCPtr, this);
1002  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1003  }
1004 
1006  long cPtr = mainJNI.RoutingModel_mutablePreAssignment(swigCPtr, this);
1007  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1008  }
1009 
1013  public boolean writeAssignment(String file_name) {
1014  return mainJNI.RoutingModel_writeAssignment(swigCPtr, this, file_name);
1015  }
1016 
1020  public Assignment readAssignment(String file_name) {
1021  long cPtr = mainJNI.RoutingModel_readAssignment(swigCPtr, this, file_name);
1022  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1023  }
1024 
1029  long cPtr = mainJNI.RoutingModel_restoreAssignment(swigCPtr, this, Assignment.getCPtr(solution), solution);
1030  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1031  }
1032 
1036  public Assignment readAssignmentFromRoutes(long[][] routes, boolean ignore_inactive_indices) {
1037  long cPtr = mainJNI.RoutingModel_readAssignmentFromRoutes(swigCPtr, this, routes, ignore_inactive_indices);
1038  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1039  }
1040 
1044  public boolean routesToAssignment(long[][] routes, boolean ignore_inactive_indices, boolean close_routes, Assignment assignment) {
1045  return mainJNI.RoutingModel_routesToAssignment(swigCPtr, this, routes, ignore_inactive_indices, close_routes, Assignment.getCPtr(assignment), assignment);
1046  }
1047 
1051  public void assignmentToRoutes(Assignment assignment, long[][] routes) {
1052  mainJNI.RoutingModel_assignmentToRoutes(swigCPtr, this, Assignment.getCPtr(assignment), assignment, routes);
1053  }
1054 
1059  long cPtr = mainJNI.RoutingModel_compactAssignment(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
1060  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1061  }
1062 
1067  long cPtr = mainJNI.RoutingModel_compactAndCheckAssignment(swigCPtr, this, Assignment.getCPtr(assignment), assignment);
1068  return (cPtr == 0) ? null : new Assignment(cPtr, false);
1069  }
1070 
1074  public void addToAssignment(IntVar var) {
1075  mainJNI.RoutingModel_addToAssignment(swigCPtr, this, IntVar.getCPtr(var), var);
1076  }
1077 
1078  public void addIntervalToAssignment(IntervalVar interval) {
1079  mainJNI.RoutingModel_addIntervalToAssignment(swigCPtr, this, IntervalVar.getCPtr(interval), interval);
1080  }
1081 
1086  mainJNI.RoutingModel_addLocalSearchFilter(swigCPtr, this, LocalSearchFilter.getCPtr(filter), filter);
1087  }
1088 
1092  public long start(int vehicle) {
1093  return mainJNI.RoutingModel_start(swigCPtr, this, vehicle);
1094  }
1095 
1099  public long end(int vehicle) {
1100  return mainJNI.RoutingModel_end(swigCPtr, this, vehicle);
1101  }
1102 
1106  public boolean isStart(long index) {
1107  return mainJNI.RoutingModel_isStart(swigCPtr, this, index);
1108  }
1109 
1113  public boolean isEnd(long index) {
1114  return mainJNI.RoutingModel_isEnd(swigCPtr, this, index);
1115  }
1116 
1120  public int VehicleIndex(long index) {
1121  return mainJNI.RoutingModel_VehicleIndex(swigCPtr, this, index);
1122  }
1123 
1127  public long next(Assignment assignment, long index) {
1128  return mainJNI.RoutingModel_next(swigCPtr, this, Assignment.getCPtr(assignment), assignment, index);
1129  }
1130 
1134  public boolean isVehicleUsed(Assignment assignment, int vehicle) {
1135  return mainJNI.RoutingModel_isVehicleUsed(swigCPtr, this, Assignment.getCPtr(assignment), assignment, vehicle);
1136  }
1137 
1141  public IntVar[] nexts() {
1142  return mainJNI.RoutingModel_nexts(swigCPtr, this);
1143 }
1144 
1148  public IntVar[] vehicleVars() {
1149  return mainJNI.RoutingModel_vehicleVars(swigCPtr, this);
1150 }
1151 
1155  public IntVar[] ResourceVars(int resource_group) {
1156  return mainJNI.RoutingModel_ResourceVars(swigCPtr, this, resource_group);
1157 }
1158 
1162  public IntVar nextVar(long index) {
1163  long cPtr = mainJNI.RoutingModel_nextVar(swigCPtr, this, index);
1164  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1165  }
1166 
1170  public IntVar activeVar(long index) {
1171  long cPtr = mainJNI.RoutingModel_activeVar(swigCPtr, this, index);
1172  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1173  }
1174 
1178  public IntVar activeVehicleVar(int vehicle) {
1179  long cPtr = mainJNI.RoutingModel_activeVehicleVar(swigCPtr, this, vehicle);
1180  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1181  }
1182 
1186  public IntVar VehicleRouteConsideredVar(int vehicle) {
1187  long cPtr = mainJNI.RoutingModel_VehicleRouteConsideredVar(swigCPtr, this, vehicle);
1188  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1189  }
1190 
1194  public IntVar vehicleVar(long index) {
1195  long cPtr = mainJNI.RoutingModel_vehicleVar(swigCPtr, this, index);
1196  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1197  }
1198 
1202  public IntVar ResourceVar(int vehicle, int resource_group) {
1203  long cPtr = mainJNI.RoutingModel_ResourceVar(swigCPtr, this, vehicle, resource_group);
1204  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1205  }
1206 
1210  public IntVar costVar() {
1211  long cPtr = mainJNI.RoutingModel_costVar(swigCPtr, this);
1212  return (cPtr == 0) ? null : new IntVar(cPtr, false);
1213  }
1214 
1218  public long getArcCostForVehicle(long from_index, long to_index, long vehicle) {
1219  return mainJNI.RoutingModel_getArcCostForVehicle(swigCPtr, this, from_index, to_index, vehicle);
1220  }
1221 
1226  return mainJNI.RoutingModel_costsAreHomogeneousAcrossVehicles(swigCPtr, this);
1227  }
1228 
1232  public long getHomogeneousCost(long from_index, long to_index) {
1233  return mainJNI.RoutingModel_getHomogeneousCost(swigCPtr, this, from_index, to_index);
1234  }
1235 
1239  public long getArcCostForFirstSolution(long from_index, long to_index) {
1240  return mainJNI.RoutingModel_getArcCostForFirstSolution(swigCPtr, this, from_index, to_index);
1241  }
1242 
1246  public long getArcCostForClass(long from_index, long to_index, long cost_class_index) {
1247  return mainJNI.RoutingModel_getArcCostForClass(swigCPtr, this, from_index, to_index, cost_class_index);
1248  }
1249 
1253  public int getCostClassIndexOfVehicle(long vehicle) {
1254  return mainJNI.RoutingModel_getCostClassIndexOfVehicle(swigCPtr, this, vehicle);
1255 }
1256 
1260  public boolean hasVehicleWithCostClassIndex(int cost_class_index) {
1261  return mainJNI.RoutingModel_hasVehicleWithCostClassIndex(swigCPtr, this, cost_class_index);
1262  }
1263 
1267  public int getCostClassesCount() {
1268  return mainJNI.RoutingModel_getCostClassesCount(swigCPtr, this);
1269  }
1270 
1275  return mainJNI.RoutingModel_getNonZeroCostClassesCount(swigCPtr, this);
1276  }
1277 
1278  public int getVehicleClassIndexOfVehicle(long vehicle) {
1279  return mainJNI.RoutingModel_getVehicleClassIndexOfVehicle(swigCPtr, this, vehicle);
1280 }
1281 
1285  public int GetVehicleOfClass(int vehicle_class) {
1286  return mainJNI.RoutingModel_GetVehicleOfClass(swigCPtr, this, vehicle_class);
1287  }
1288 
1292  public int getVehicleClassesCount() {
1293  return mainJNI.RoutingModel_getVehicleClassesCount(swigCPtr, this);
1294  }
1295 
1299  public int[] getSameVehicleIndicesOfIndex(int node) {
1300  return mainJNI.RoutingModel_getSameVehicleIndicesOfIndex(swigCPtr, this, node);
1301 }
1302 
1304  return new RoutingModel.VehicleTypeContainer(mainJNI.RoutingModel_GetVehicleTypeContainer(swigCPtr, this), false);
1305  }
1306 
1310  public boolean arcIsMoreConstrainedThanArc(long from, long to1, long to2) {
1311  return mainJNI.RoutingModel_arcIsMoreConstrainedThanArc(swigCPtr, this, from, to1, to2);
1312  }
1313 
1317  public String debugOutputAssignment(Assignment solution_assignment, String dimension_to_print) {
1318  return mainJNI.RoutingModel_debugOutputAssignment(swigCPtr, this, Assignment.getCPtr(solution_assignment), solution_assignment, dimension_to_print);
1319  }
1320 
1324  public Solver solver() {
1325  long cPtr = mainJNI.RoutingModel_solver(swigCPtr, this);
1326  return (cPtr == 0) ? null : new Solver(cPtr, false);
1327  }
1328 
1332  public boolean checkLimit() {
1333  return mainJNI.RoutingModel_checkLimit(swigCPtr, this);
1334  }
1335 
1339  public int nodes() {
1340  return mainJNI.RoutingModel_nodes(swigCPtr, this);
1341  }
1342 
1346  public int vehicles() {
1347  return mainJNI.RoutingModel_vehicles(swigCPtr, this);
1348  }
1349 
1353  public long size() {
1354  return mainJNI.RoutingModel_size(swigCPtr, this);
1355  }
1356 
1361  return mainJNI.RoutingModel_getNumberOfDecisionsInFirstSolution(swigCPtr, this, search_parameters.toByteArray());
1362  }
1363 
1365  return mainJNI.RoutingModel_getNumberOfRejectsInFirstSolution(swigCPtr, this, search_parameters.toByteArray());
1366  }
1367 
1371  public boolean isMatchingModel() {
1372  return mainJNI.RoutingModel_isMatchingModel(swigCPtr, this);
1373  }
1374 
1378  public DecisionBuilder makeGuidedSlackFinalizer(RoutingDimension dimension, LongUnaryOperator initializer) {
1379  long cPtr = mainJNI.RoutingModel_makeGuidedSlackFinalizer(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension, initializer);
1380  return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
1381  }
1382 
1387  long cPtr = mainJNI.RoutingModel_makeSelfDependentDimensionFinalizer(swigCPtr, this, RoutingDimension.getCPtr(dimension), dimension);
1388  return (cPtr == 0) ? null : new DecisionBuilder(cPtr, false);
1389  }
1390 
1391  // Status
1399  public final static int ROUTING_NOT_SOLVED = mainJNI.RoutingModel_ROUTING_NOT_SOLVED_get();
1403  public final static int ROUTING_SUCCESS = mainJNI.RoutingModel_ROUTING_SUCCESS_get();
1407  public final static int ROUTING_FAIL = mainJNI.RoutingModel_ROUTING_FAIL_get();
1411  public final static int ROUTING_FAIL_TIMEOUT = mainJNI.RoutingModel_ROUTING_FAIL_TIMEOUT_get();
1415  public final static int ROUTING_INVALID = mainJNI.RoutingModel_ROUTING_INVALID_get();
1416 
1417  // PickupAndDeliveryPolicy
1425  public final static int PICKUP_AND_DELIVERY_NO_ORDER = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_NO_ORDER_get();
1429  public final static int PICKUP_AND_DELIVERY_LIFO = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_LIFO_get();
1433  public final static int PICKUP_AND_DELIVERY_FIFO = mainJNI.RoutingModel_PICKUP_AND_DELIVERY_FIFO_get();
1434 
1435  // VisitTypePolicy
1443  public final static int TYPE_ADDED_TO_VEHICLE = mainJNI.RoutingModel_TYPE_ADDED_TO_VEHICLE_get();
1447  public final static int ADDED_TYPE_REMOVED_FROM_VEHICLE = mainJNI.RoutingModel_ADDED_TYPE_REMOVED_FROM_VEHICLE_get();
1451  public final static int TYPE_ON_VEHICLE_UP_TO_VISIT = mainJNI.RoutingModel_TYPE_ON_VEHICLE_UP_TO_VISIT_get();
1455  public final static int TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED = mainJNI.RoutingModel_TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED_get();
1456 
1457 }
int vehicles()
Returns the number of vehicle routes in the model.
Assignment compactAndCheckAssignment(Assignment assignment)
Same as CompactAssignment() but also checks the validity of the final compact solution; if it is not ...
SWIGTYPE_p_operations_research__GlobalDimensionCumulOptimizer GetMutableGlobalCumulMPOptimizer(RoutingDimension dimension)
long getFixedCostOfVehicle(int vehicle)
Returns the route fixed cost taken into account if the route of the vehicle is not empty,...
int status()
Returns the current status of the routing model.
void setAmortizedCostFactorsOfVehicle(long linear_cost_factor, long quadratic_cost_factor, int vehicle)
Sets the linear and quadratic cost factor of the given vehicle.
SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t GetRequiredTypeAlternativesWhenRemovingType(int type)
Returns the set of requirement alternatives when removing the given type.
Dimensions represent quantities accumulated at nodes along the routes.
RoutingDimension getMutableDimension(String dimension_name)
Returns a dimension from its name.
IntVar [] nexts()
Returns all next variables of the model, such that Nexts(i) is the next variable of the node correspo...
void addVariableMinimizedByFinalizer(IntVar var)
Adds a variable to minimize in the solution finalizer.
long [] GetDisjunctionNodeIndices(int index)
Returns the variable indices of the nodes in the disjunction of index 'index'.
static int getKNoDimension()
Constant used to express the "no dimension" index, returned when a dimension name does not correspond...
A ResourceGroup defines a set of available Resources with attributes on one or multiple dimensions.
Solver Class A solver represents the main computation engine.
Definition: Solver.java:60
boolean HasMaxCardinalityConstrainedDisjunctions()
Returns true if the model contains at least one disjunction which is constrained by its max_cardinali...
static final int ADDED_TYPE_REMOVED_FROM_VEHICLE
When visited, one instance of type 'T' previously added to the route (TYPE_ADDED_TO_VEHICLE),...
int registerPositiveUnaryTransitCallback(LongUnaryOperator callback)
Assignment readAssignment(String file_name)
Reads an assignment from a file and returns the current solution.
int getVehicleClassesCount()
Returns the number of different vehicle classes in the model.
RoutingModel.VehicleTypeContainer GetVehicleTypeContainer()
IntVar vehicleVar(long index)
Returns the vehicle variable of the node corresponding to index.
void setVehicles_per_vehicle_class(SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t value)
int registerPositiveTransitCallback(LongBinaryOperator callback)
SWIGTYPE_p_absl__flat_hash_setT_int_t getTemporalTypeIncompatibilitiesOfType(int type)
void closeVisitTypes()
This function should be called once all node visit types have been set and prior to adding any incomp...
IntVar applyLocks(long[] locks)
Applies a lock chain to the next search.
void addTemporalTypeIncompatibility(int type1, int type2)
void setAllowedVehiclesForIndex(int[] vehicles, long index)
Sets the vehicles which can visit a given node.
void closeModel()
Closes the current routing model; after this method is called, no modification to the model can be do...
static final int TYPE_ADDED_TO_VEHICLE
Set the node visit types and incompatibilities/requirements between the types (see below).
Assignment preAssignment()
Returns an assignment used to fix some of the variables of the problem.
Manager for any NodeIndex <-> variable index conversion.
static final int ROUTING_INVALID
Model, model parameters or flags are not valid.
boolean isVehicleUsed(Assignment assignment, int vehicle)
Returns true if the route of 'vehicle' is non empty in 'assignment'.
void setPrimaryConstrainedDimension(String dimension_name)
Set the given dimension as "primary constrained".
SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__GlobalDimensionCumulOptimizer_t_t GetGlobalDimensionCumulMPOptimizers()
Assignment solve(Assignment assignment)
Solves the current routing model; closes the current model.
static long getKNoPenalty()
Constant used to express a hard constraint instead of a soft penalty.
RoutingModel.ResourceGroup.Resource GetResource(int resource_index)
We call domain any subset of Int64 = [kint64min, kint64max].
SWIGTYPE_p_std__vectorT_std__unique_ptrT_operations_research__RoutingModel__ResourceGroup_t_t GetResourceGroups()
void addRequiredTypeAlternativesWhenAddingType(int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives)
If type_D depends on type_R when adding type_D, any node_D of type_D and VisitTypePolicy TYPE_ADDED_T...
int AddResourceGroup()
Adds a resource group to the routing model.
boolean writeAssignment(String file_name)
Writes the current solution to a file containing an AssignmentProto.
boolean hasHardTypeIncompatibilities()
Returns true iff any hard (resp.
int [] getDisjunctionIndices(long index)
Returns the indices of the disjunctions to which an index belongs.
int getCostClassesCount()
Returns the number of different cost classes in the model.
boolean isMatchingModel()
Returns true if a vehicle/node matching problem is detected.
int getNumOfSingletonNodes()
Returns the number of non-start/end nodes which do not appear in a pickup/delivery pair.
static final int ROUTING_FAIL_TIMEOUT
Time limit reached before finding a solution with RoutingModel::Solve().
boolean addDimensionWithVehicleTransitAndCapacity(int[] evaluator_indices, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name)
boolean addDimensionWithVehicleCapacity(int evaluator_index, long slack_max, long[] vehicle_capacities, boolean fix_start_cumul_to_zero, String name)
IntVar ResourceVar(int vehicle, int resource_group)
Returns the resource variable for the given vehicle index in the given resource group.
long unperformedPenalty(long var_index)
Get the "unperformed" penalty of a node.
long getDisjunctionMaxCardinality(int index)
Returns the maximum number of possible active nodes of the node disjunction of index 'index'.
Assignment SolveFromAssignmentsWithParameters(SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
Same as above but will try all assignments in order as first solutions until one succeeds.
void addSearchMonitor(SearchMonitor monitor)
Adds a search monitor to the search used to solve the routing model.
static final int TYPE_ON_VEHICLE_UP_TO_VISIT
With the following policy, the visit enforces that type 'T' is considered on the route from its start...
int VehicleIndex(long index)
Returns the vehicle of the given start/end index, and -1 if the given index is not a vehicle start/en...
long getDepot()
Returns the variable index of the first starting or ending node of all routes.
long computeLowerBound()
Computes a lower bound to the routing problem solving a linear assignment problem.
static final int PICKUP_AND_DELIVERY_LIFO
Deliveries must be performed in reverse order of pickups.
boolean addDimension(int evaluator_index, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name)
Model creation Methods to add dimensions to routes; dimensions represent quantities accumulated at no...
long getHomogeneousCost(long from_index, long to_index)
Returns the cost of the segment between two nodes supposing all vehicle costs are the same (returns t...
Assignment solveFromAssignmentWithParameters(Assignment assignment, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
Same as above, except that if assignment is not null, it will be used as the initial solution.
void setAssignmentFromOtherModelAssignment(Assignment target_assignment, RoutingModel source_model, Assignment source_assignment)
Given a "source_model" and its "source_assignment", resets "target_assignment" with the IntVar variab...
boolean isStart(long index)
Returns true if 'index' represents the first node of a route.
void addLocalSearchOperator(LocalSearchOperator ls_operator)
Adds a local search operator to the set of operators used to solve the vehicle routing problem.
SWIGTYPE_p_absl__flat_hash_setT_operations_research__RoutingModel__DimensionIndex_t GetAffectedDimensionIndices()
static final int ROUTING_NOT_SOLVED
Status of the search.
void addSoftSameVehicleConstraint(long[] indices, long cost)
Adds a soft constraint to force a set of variable indices to be on the same vehicle.
long getDisjunctionPenalty(int index)
Returns the penalty of the node disjunction of index 'index'.
boolean arcIsMoreConstrainedThanArc(long from, long to1, long to2)
Returns whether the arc from->to1 is more constrained than from->to2, taking into account,...
void AddWeightedVariableMinimizedByFinalizer(IntVar var, long cost)
Adds a variable to minimize in the solution finalizer, with a weighted priority: the higher the more ...
int addDisjunction(long[] indices, long penalty, long max_cardinality)
Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active.
Struct used to sort and store vehicles by their type.
IntVar activeVar(long index)
Returns the active variable of the node corresponding to index.
Assignment solve()
Solves the current routing model; closes the current model.
int [] getSameVehicleIndicesOfIndex(int node)
Returns variable indices of nodes constrained to be on the same route.
long size()
Returns the number of next variables in the model.
long next(Assignment assignment, long index)
Assignment inspection Returns the variable index of the node directly after the node corresponding to...
boolean checkLimit()
Returns true if the search limit has been crossed.
IntVar [] vehicleVars()
Returns all vehicle variables of the model, such that VehicleVars(i) is the vehicle variable of the n...
IntVar VehicleRouteConsideredVar(int vehicle)
Returns the variable specifying whether or not the given vehicle route is considered for costs and co...
RoutingModel(long cPtr, boolean cMemoryOwn)
Assignment solveWithParameters(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
Solves the current routing model with the given parameters.
void addRequiredTypeAlternativesWhenRemovingType(int dependent_type, SWIGTYPE_p_absl__flat_hash_setT_int_t required_type_alternatives)
The following requirements apply when visiting dependent nodes that remove their type from the route,...
SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t getSorted_vehicle_classes_per_type()
int GetDimensionResourceGroupIndex(RoutingDimension dimension)
Returns the index of the resource group attached to the dimension.
Constraint MakePathSpansAndTotalSlacks(RoutingDimension dimension, IntVar[] spans, IntVar[] total_slacks)
For every vehicle of the routing model: - if total_slacks[vehicle] is not nullptr,...
void SetVehicleUsedWhenEmpty(boolean is_used, int vehicle)
void addPickupAndDeliverySets(int pickup_disjunction, int delivery_disjunction)
Same as AddPickupAndDelivery but notifying that the performed node from the disjunction of index 'pic...
A search monitor is a simple set of callbacks to monitor all search events.
long start(int vehicle)
Model inspection.
long getArcCostForVehicle(long from_index, long to_index, long vehicle)
Returns the cost of the transit arc between two nodes for a given vehicle.
IntVar nextVar(long index)
Returns the next variable of the node corresponding to index.
A DecisionBuilder is responsible for creating the search tree.
boolean hasSameVehicleTypeRequirements()
Returns true iff any same-route (resp.
boolean isEnd(long index)
Returns true if 'index' represents the last node of a route.
void addHardTypeIncompatibility(int type1, int type2)
Incompatibilities: Two nodes with "hard" incompatible types cannot share the same route at all,...
void addVariableTargetToFinalizer(IntVar var, long target)
Add a variable to set the closest possible to the target value in the solution finalizer.
boolean applyLocksToAllVehicles(long[][] locks, boolean close_routes)
Applies lock chains to all vehicles to the next search, such that locks[p] is the lock chain for rout...
void NotifyVehicleRequiresAResource(int vehicle)
Notifies that the given vehicle index requires a resource from this group if the vehicle is used (i....
int addDisjunction(long[] indices, long penalty)
Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active.
boolean addDimensionWithVehicleTransits(int[] evaluator_indices, long slack_max, long capacity, boolean fix_start_cumul_to_zero, String name)
IntBoolPair addVectorDimension(long[] values, long capacity, boolean fix_start_cumul_to_zero, String name)
Creates a dimension where the transit variable is constrained to be equal to 'values[i]' for node i; ...
SWIGTYPE_p_std__vectorT_std__dequeT_int_t_t getVehicles_per_vehicle_class()
IntBoolPair addMatrixDimension(long[][] values, long capacity, boolean fix_start_cumul_to_zero, String name)
Creates a dimension where the transit variable is constrained to be equal to 'values[i][next(i)]' for...
int getNonZeroCostClassesCount()
Ditto, minus the 'always zero', built-in cost class.
int AddResource(RoutingModel.ResourceGroup.Attributes attributes, RoutingDimension dimension)
Adds a Resource with the given attributes for the corresponding dimension.
void SetMaximumNumberOfActiveVehicles(int max_active_vehicles)
Constrains the maximum number of active vehicles, aka the number of vehicles which do not have an emp...
void addPickupAndDelivery(long pickup, long delivery)
Notifies that index1 and index2 form a pair of nodes which should belong to the same route.
void closeModelWithParameters(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
Same as above taking search parameters (as of 10/2015 some the parameters have to be set when closing...
void addToAssignment(IntVar var)
Adds an extra variable to the vehicle routing assignment.
int GetVehicleOfClass(int vehicle_class)
Returns a vehicle of the given vehicle class, and -1 if there are no vehicles for this class.
This class represent a reversible FIFO structure.
long end(int vehicle)
Returns the variable index of the ending node of a vehicle route.
RoutingModel(RoutingIndexManager index_manager, com.google.ortools.constraintsolver.RoutingModelParameters parameters)
IntVar [] ResourceVars(int resource_group)
Returns vehicle resource variables for a given resource group, such that ResourceVars(r_g)[v] is the ...
void ignoreDisjunctionsAlreadyForcedToZero()
SPECIAL: Makes the solver ignore all the disjunctions whose active variables are all trivially zero (...
void addVariableMaximizedByFinalizer(IntVar var)
Adds a variable to maximize in the solution finalizer (see above for information on the solution fina...
Assignment restoreAssignment(Assignment solution)
Restores an assignment as a solution in the routing model and returns the new solution.
Classes to which this template function can be applied to as of 04/2014.
int addDisjunction(long[] indices)
Adds a disjunction constraint on the indices: exactly 'max_cardinality' of the indices are active.
void setVisitType(long index, int type, int type_policy)
void setPickupAndDeliveryPolicyOfAllVehicles(int policy)
Sets the Pickup and delivery policy of all vehicles.
boolean isVehicleAllowedForIndex(int vehicle, long index)
Returns true if a vehicle is allowed to visit a given node.
static final int PICKUP_AND_DELIVERY_NO_ORDER
Types of precedence policy applied to pickup and delivery pairs.
DecisionBuilder makeGuidedSlackFinalizer(RoutingDimension dimension, LongUnaryOperator initializer)
The next few members are in the public section only for testing purposes.
Assignment compactAssignment(Assignment assignment)
Converts the solution in the given assignment to routes for all vehicles.
IntVar costVar()
Returns the global cost variable which is being minimized.
An Assignment is a variable -> domains mapping, used to report solutions to the user.
Definition: Assignment.java:14
String getPrimaryConstrainedDimension()
Get the primary constrained dimension, or an empty string if it is unset.
Assignment readAssignmentFromRoutes(long[][] routes, boolean ignore_inactive_indices)
Restores the routes as the current solution.
RoutingModel.ResourceGroup GetResourceGroup(int rg_index)
int registerTransitCallback(LongBinaryOperator callback)
int registerUnaryTransitCallback(LongUnaryOperator callback)
RoutingModel.ResourceGroup.Attributes GetDimensionAttributes(RoutingDimension dimension)
void setFixedCostOfVehicle(long cost, int vehicle)
Sets the fixed cost of one vehicle route.
RoutingModel(RoutingIndexManager index_manager)
Constructor taking an index manager.
Solver solver()
Returns a vector cumul_bounds, for which cumul_bounds[i][j] is a pair containing the minimum and maxi...
long getArcCostForFirstSolution(long from_index, long to_index)
Returns the cost of the arc in the context of the first solution strategy.
int getCostClassIndexOfVehicle(long vehicle)
Get the cost class index of the given vehicle.
long getArcCostForClass(long from_index, long to_index, long cost_class_index)
Returns the cost of the segment between two nodes for a given cost class.
IntBoolPair addConstantDimension(long value, long capacity, boolean fix_start_cumul_to_zero, String name)
void addLocalSearchFilter(LocalSearchFilter filter)
Adds a custom local search filter to the list of filters used to speed up local search by pruning unf...
String debugOutputAssignment(Assignment solution_assignment, String dimension_to_print)
Print some debugging information about an assignment, including the feasible intervals of the CumulVa...
void setFixedCostOfAllVehicles(long cost)
Sets the fixed cost of all vehicle routes.
int registerUnaryTransitVector(long[] values)
Registers 'callback' and returns its index.
Assignment SolveFromAssignmentsWithParameters(SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t assignments, com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters, SWIGTYPE_p_std__vectorT_operations_research__Assignment_const_p_t solutions)
Same as above but will try all assignments in order as first solutions until one succeeds.
void setSorted_vehicle_classes_per_type(SWIGTYPE_p_std__vectorT_std__setT_operations_research__RoutingModel__VehicleTypeContainer__VehicleClassEntry_t_t value)
void setArcCostEvaluatorOfVehicle(int evaluator_index, int vehicle)
Sets the cost function for a given vehicle route.
static final int ROUTING_FAIL
No solution found to the problem after calling RoutingModel::Solve().
IntBoolPair addConstantDimensionWithSlack(long value, long capacity, long slack_max, boolean fix_start_cumul_to_zero, String name)
Creates a dimension where the transit variable is constrained to be equal to 'value'; 'capacity' is t...
long unperformedPenaltyOrValue(long default_value, long var_index)
Same as above except that it returns default_value instead of 0 when penalty is not well defined (def...
void assignmentToRoutes(Assignment assignment, long[][] routes)
Converts the solution in the given assignment to routes for all vehicles.
SWIGTYPE_p_std__vectorT_absl__flat_hash_setT_int_t_t GetRequiredTypeAlternativesWhenAddingType(int type)
Returns the set of requirement alternatives when adding the given type.
RoutingDimension getDimensionOrDie(String dimension_name)
Returns a dimension from its name.
int GetMaximumNumberOfActiveVehicles()
Returns the maximum number of active vehicles.
A Resource sets attributes (costs/constraints) for a set of dimensions.
SWIGTYPE_p_std__vectorT_operations_research__RoutingModel__ResourceGroup__Resource_t GetResources()
boolean hasDimension(String dimension_name)
Returns true if a dimension exists for a given dimension name.
IntVar activeVehicleVar(int vehicle)
Returns the active variable of the vehicle.
long getNumberOfRejectsInFirstSolution(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
static final int PICKUP_AND_DELIVERY_FIFO
Deliveries must be performed in the same order as pickups.
long getNumberOfDecisionsInFirstSolution(com.google.ortools.constraintsolver.RoutingSearchParameters search_parameters)
Returns statistics on first solution search, number of decisions sent to filters, number of decisions...
static final int TYPE_SIMULTANEOUSLY_ADDED_AND_REMOVED
The visit doesn't have an impact on the number of types 'T' on the route, as it's (virtually) added a...
boolean costsAreHomogeneousAcrossVehicles()
Whether costs are homogeneous across all vehicles.
boolean hasVehicleWithCostClassIndex(int cost_class_index)
Returns true iff the model contains a vehicle with the given cost_class_index.
void setArcCostEvaluatorOfAllVehicles(int evaluator_index)
Sets the cost function of the model such that the cost of a segment of a route between node 'from' an...
int nodes()
Sizes and indices Returns the number of nodes in the model.
int [] GetDimensionResourceGroupIndices(RoutingDimension dimension)
Returns the indices of resource groups for this dimension.
boolean routesToAssignment(long[][] routes, boolean ignore_inactive_indices, boolean close_routes, Assignment assignment)
Fills an assignment from a specification of the routes of the vehicles.
void setAmortizedCostFactorsOfAllVehicles(long linear_cost_factor, long quadratic_cost_factor)
The following methods set the linear and quadratic cost factors of vehicles (must be positive values)...
boolean HasMandatoryDisjunctions()
Returns true if the model contains mandatory disjunctions (ones with kNoPenalty as penalty).
void setPickupAndDeliveryPolicyOfVehicle(int policy, int vehicle)
void setFirstSolutionEvaluator(LongBinaryOperator evaluator)
Gets/sets the evaluator used during the search.
DecisionBuilder makeSelfDependentDimensionFinalizer(RoutingDimension dimension)
MakeSelfDependentDimensionFinalizer is a finalizer for the slacks of a self-dependent dimension.
static int getKNoDisjunction()
Constant used to express the "no disjunction" index, returned when a node does not appear in any disj...
int getNumberOfDisjunctions()
Returns the number of node disjunctions in the model.
static final int ROUTING_SUCCESS
Problem solved successfully after calling RoutingModel::Solve().
void addAtSolutionCallback(Runnable callback)
Adds a callback called each time a solution is found during the search.