Java Reference
Java Reference
Detailed Description
Manager for any NodeIndex <-> variable index conversion.
The routing solver uses variable indices internally and through its API. These variable indices are tricky to manage directly because one Node can correspond to a multitude of variables, depending on the number of times they appear in the model, and if they're used as start and/or end points. This class aims to simplify variable index usage, allowing users to use NodeIndex instead. Usage: .cpp} auto starts_ends = ...; /// These are NodeIndex. RoutingIndexManager manager(10, 4, starts_ends); // 10 nodes, 4 vehicles. RoutingModel model(manager);
Definition at line 14 of file RoutingIndexManager.java.
Public Member Functions | |
| synchronized void | delete () |
| RoutingIndexManager (int num_nodes, int num_vehicles, int depot) | |
| Creates a NodeIndex to variable index mapping for a problem containing 'num_nodes', 'num_vehicles' and the given starts and ends for each vehicle. More... | |
| RoutingIndexManager (int num_nodes, int num_vehicles, int[] starts, int[] ends) | |
| int | getNumberOfNodes () |
| int | getNumberOfVehicles () |
| int | getNumberOfIndices () |
| long | getStartIndex (int vehicle) |
| long | getEndIndex (int vehicle) |
| long | nodeToIndex (int node) |
| long[] | nodesToIndices (int[] nodes) |
| int | indexToNode (long index) |
Protected Member Functions | |
| RoutingIndexManager (long cPtr, boolean cMemoryOwn) | |
Constructor & Destructor Documentation
◆ RoutingIndexManager() [1/3]
|
inlineprotected |
Definition at line 18 of file RoutingIndexManager.java.
◆ RoutingIndexManager() [2/3]
|
inline |
Creates a NodeIndex to variable index mapping for a problem containing 'num_nodes', 'num_vehicles' and the given starts and ends for each vehicle.
If used, any start/end arrays have to have exactly 'num_vehicles' elements.
Definition at line 45 of file RoutingIndexManager.java.
◆ RoutingIndexManager() [3/3]
|
inline |
Definition at line 49 of file RoutingIndexManager.java.
Member Function Documentation
◆ delete()
|
inline |
Definition at line 32 of file RoutingIndexManager.java.
◆ getEndIndex()
|
inline |
Definition at line 69 of file RoutingIndexManager.java.
◆ getNumberOfIndices()
|
inline |
Definition at line 61 of file RoutingIndexManager.java.
◆ getNumberOfNodes()
|
inline |
Definition at line 53 of file RoutingIndexManager.java.
◆ getNumberOfVehicles()
|
inline |
Definition at line 57 of file RoutingIndexManager.java.
◆ getStartIndex()
|
inline |
Definition at line 65 of file RoutingIndexManager.java.
◆ indexToNode()
|
inline |
Definition at line 81 of file RoutingIndexManager.java.
◆ nodesToIndices()
|
inline |
Definition at line 77 of file RoutingIndexManager.java.
◆ nodeToIndex()
|
inline |
Definition at line 73 of file RoutingIndexManager.java.
The documentation for this class was generated from the following file: