Java Reference

Java Reference

RoutingIndexManager.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
9package com.google.ortools.constraintsolver;
10
34public class RoutingIndexManager {
35 private transient long swigCPtr;
36 protected transient boolean swigCMemOwn;
37
38 protected RoutingIndexManager(long cPtr, boolean cMemoryOwn) {
39 swigCMemOwn = cMemoryOwn;
40 swigCPtr = cPtr;
41 }
42
43 protected static long getCPtr(RoutingIndexManager obj) {
44 return (obj == null) ? 0 : obj.swigCPtr;
45 }
46
47 @SuppressWarnings("deprecation")
48 protected void finalize() {
49 delete();
50 }
51
52 public synchronized void delete() {
53 if (swigCPtr != 0) {
54 if (swigCMemOwn) {
55 swigCMemOwn = false;
56 mainJNI.delete_RoutingIndexManager(swigCPtr);
57 }
58 swigCPtr = 0;
59 }
60 }
61
68 public RoutingIndexManager(int num_nodes, int num_vehicles, int depot) {
69 this(mainJNI.new_RoutingIndexManager__SWIG_0(num_nodes, num_vehicles, depot), true);
70 }
71
72 public RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends) {
73 this(mainJNI.new_RoutingIndexManager__SWIG_1(num_nodes, num_vehicles, starts, ends), true);
74 }
75
76 public int getNumberOfNodes() {
77 return mainJNI.RoutingIndexManager_getNumberOfNodes(swigCPtr, this);
78 }
79
80 public int getNumberOfVehicles() {
81 return mainJNI.RoutingIndexManager_getNumberOfVehicles(swigCPtr, this);
82 }
83
84 public int getNumberOfIndices() {
85 return mainJNI.RoutingIndexManager_getNumberOfIndices(swigCPtr, this);
86 }
87
88 public long getStartIndex(int vehicle) {
89 return mainJNI.RoutingIndexManager_getStartIndex(swigCPtr, this, vehicle);
90 }
91
92 public long getEndIndex(int vehicle) {
93 return mainJNI.RoutingIndexManager_getEndIndex(swigCPtr, this, vehicle);
94 }
95
96 public long nodeToIndex(int node) {
97 return mainJNI.RoutingIndexManager_nodeToIndex(swigCPtr, this, node);
98 }
99
100 public long[] nodesToIndices(int[] nodes) {
101 return mainJNI.RoutingIndexManager_nodesToIndices(swigCPtr, this, nodes);
102}
103
104 public int indexToNode(long index) {
105 return mainJNI.RoutingIndexManager_indexToNode(swigCPtr, this, index);
106}
107
108}
Manager for any NodeIndex <-> variable index conversion.
RoutingIndexManager(int num_nodes, int num_vehicles, int depot)
Creates a NodeIndex to variable index mapping for a problem containing 'num_nodes',...
RoutingIndexManager(int num_nodes, int num_vehicles, int[] starts, int[] ends)