From 37776ddc6f1c12daa5426b7fc9b954f492ba97fd Mon Sep 17 00:00:00 2001 From: Laurent Perron Date: Mon, 17 Dec 2018 09:10:37 +0100 Subject: [PATCH] cleanup routing API and examples on transits --- examples/contrib/SimpleRoutingTest.java | 6 ++--- examples/cpp/cvrptw_lib.h | 17 +++++++------ examples/cpp/tsp.cc | 25 ++++++++++++------- examples/cpp/vrp.cc | 15 ++++++----- examples/dotnet/cscvrptw.cs | 16 ++++++------ examples/dotnet/cstsp.cs | 8 +++--- examples/dotnet/tsp.cs | 6 ++--- examples/dotnet/vrp.cs | 6 ++--- ...dVehicleRoutingProblemWithTimeWindows.java | 20 +++++++-------- examples/java/Tsp.java | 14 +++++------ examples/java/Vrp.java | 8 +++--- .../csharp/constraint_solver.i | 2 +- ortools/constraint_solver/csharp/routing.i | 8 +++--- ortools/constraint_solver/routing_types.h | 4 +-- 14 files changed, 83 insertions(+), 72 deletions(-) diff --git a/examples/contrib/SimpleRoutingTest.java b/examples/contrib/SimpleRoutingTest.java index d882540701..2404f48211 100644 --- a/examples/contrib/SimpleRoutingTest.java +++ b/examples/contrib/SimpleRoutingTest.java @@ -1,6 +1,6 @@ import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.IntIntToLong; +import com.google.ortools.constraintsolver.LongLongToLong; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; import com.google.ortools.constraintsolver.RoutingSearchParameters; @@ -49,7 +49,7 @@ public class SimpleRoutingTest { } // Node Distance Evaluation - public static class NodeDistance extends IntIntToLong { + public static class NodeDistance extends LongLongToLong { private int[][] costMatrix; private RoutingIndexManager indexManager; @@ -59,7 +59,7 @@ public class SimpleRoutingTest { } @Override - public long run(int firstIndex, int secondIndex) { + public long run(long firstIndex, long secondIndex) { final int firstNode = indexManager.indexToNode(firstIndex); final int secondNode = indexManager.indexToNode(secondIndex); return costMatrix[firstNode][secondNode]; diff --git a/examples/cpp/cvrptw_lib.h b/examples/cpp/cvrptw_lib.h index 619029b3a4..887821e6b5 100644 --- a/examples/cpp/cvrptw_lib.h +++ b/examples/cpp/cvrptw_lib.h @@ -26,7 +26,8 @@ namespace operations_research { - typedef std::function IntPairToLong; +typedef std::function + RoutingNodeEvaluator2; // Random seed generator. int32 GetSeed(bool deterministic); @@ -91,15 +92,15 @@ class ServiceTimePlusTransition { public: ServiceTimePlusTransition( int64 time_per_demand_unit, - operations_research::RoutingNodeEvaluator2 demand, - operations_research::RoutingNodeEvaluator2 transition_time); + RoutingNodeEvaluator2 demand, + RoutingNodeEvaluator2 transition_time); int64 Compute(RoutingIndexManager::NodeIndex from, RoutingIndexManager::NodeIndex to) const; private: const int64 time_per_demand_unit_; - operations_research::RoutingNodeEvaluator2 demand_; - operations_research::RoutingNodeEvaluator2 transition_time_; + RoutingNodeEvaluator2 demand_; + RoutingNodeEvaluator2 transition_time_; }; // Stop service time + transition time callback. @@ -107,15 +108,15 @@ class StopServiceTimePlusTransition { public: StopServiceTimePlusTransition( int64 stop_time, const LocationContainer& location_container, - operations_research::RoutingNodeEvaluator2 transition_time); + RoutingNodeEvaluator2 transition_time); int64 Compute(RoutingIndexManager::NodeIndex from, RoutingIndexManager::NodeIndex to) const; private: const int64 stop_time_; const LocationContainer& location_container_; - operations_research::RoutingNodeEvaluator2 demand_; - operations_research::RoutingNodeEvaluator2 transition_time_; + RoutingNodeEvaluator2 demand_; + RoutingNodeEvaluator2 transition_time_; }; // Route plan displayer. diff --git a/examples/cpp/tsp.cc b/examples/cpp/tsp.cc index 125378eddb..467fd33c76 100644 --- a/examples/cpp/tsp.cc +++ b/examples/cpp/tsp.cc @@ -68,18 +68,22 @@ namespace operations_research { std::vector( data.GetLocations().size(), 0LL)); - for (std::size_t fromNode = 0; fromNode < data.GetLocations().size(); fromNode++) { - for (std::size_t toNode = 0; toNode < data.GetLocations().size(); toNode++) { + const int size = data.GetLocations().size(); + for (int fromNode = 0; fromNode < size; fromNode++) { + for (int toNode = 0; toNode < size; toNode++) { if (fromNode != toNode) distances_[fromNode][toNode] = - std::abs(data.GetLocations()[toNode][0] - data.GetLocations()[fromNode][0]) + - std::abs(data.GetLocations()[toNode][1] - data.GetLocations()[fromNode][1]); + std::abs(data.GetLocations()[toNode][0] - + data.GetLocations()[fromNode][0]) + + std::abs(data.GetLocations()[toNode][1] - + data.GetLocations()[fromNode][1]); } } } //! @brief Returns the manhattan distance between the two nodes. - int64 operator()(RoutingIndexManager::NodeIndex FromNode, RoutingIndexManager::NodeIndex ToNode) { + int64 operator()(RoutingIndexManager::NodeIndex FromNode, + RoutingIndexManager::NodeIndex ToNode) { return distances_[FromNode.value()][ToNode.value()]; } }; @@ -104,7 +108,8 @@ namespace operations_research { route << manager.IndexToNode(index).value() << " -> "; int64 previous_index = index; index = solution.Value(routing.NextVar(index)); - distance += const_cast(routing).GetArcCostForVehicle(previous_index, index, 0LL); + distance += const_cast(routing).GetArcCostForVehicle( + previous_index, index, 0LL); } LOG(INFO) << route.str() << manager.IndexToNode(index).value(); LOG(INFO) << "Distance of the route: " << distance << "m"; @@ -127,14 +132,16 @@ namespace operations_research { // Define weight of each edge ManhattanDistance distance(data); const int vehicle_cost = routing.RegisterTransitCallback( - [&distance, &manager](int64 fromNode, int64 toNode) -> int64 { - return distance(manager.IndexToNode(fromNode), manager.IndexToNode(toNode)); + [&distance, &manager](int64 fromIndex, int64 toIndex) -> int64 { + return distance(manager.IndexToNode(fromIndex), + manager.IndexToNode(toIndex)); }); routing.SetArcCostEvaluatorOfAllVehicles(vehicle_cost); // Setting first solution heuristic (cheapest addition). RoutingSearchParameters searchParameters = DefaultRoutingSearchParameters(); - searchParameters.set_first_solution_strategy(FirstSolutionStrategy::PATH_CHEAPEST_ARC); + searchParameters.set_first_solution_strategy( + FirstSolutionStrategy::PATH_CHEAPEST_ARC); const Assignment* solution = routing.SolveWithParameters(searchParameters); PrintSolution(data, manager, routing, *solution); diff --git a/examples/cpp/vrp.cc b/examples/cpp/vrp.cc index 764f9fd8d9..e4227d536a 100644 --- a/examples/cpp/vrp.cc +++ b/examples/cpp/vrp.cc @@ -68,12 +68,15 @@ namespace operations_research { std::vector( data.GetLocations().size(), 0LL)); - for (std::size_t fromNode = 0; fromNode < data.GetLocations().size(); fromNode++) { - for (std::size_t toNode = 0; toNode < data.GetLocations().size(); toNode++) { + const int size = data.GetLocations().size(); + for (int fromNode = 0; fromNode < size; fromNode++) { + for (int toNode = 0; toNode < size; toNode++) { if (fromNode != toNode) distances_[fromNode][toNode] = - std::abs(data.GetLocations()[toNode][0] - data.GetLocations()[fromNode][0]) + - std::abs(data.GetLocations()[toNode][1] - data.GetLocations()[fromNode][1]); + std::abs(data.GetLocations()[toNode][0] - + data.GetLocations()[fromNode][0]) + + std::abs(data.GetLocations()[toNode][1] - + data.GetLocations()[fromNode][1]); } } } @@ -147,8 +150,8 @@ namespace operations_research { // Define weight of each edge ManhattanDistance distance(data); const int vehicle_cost = routing.RegisterTransitCallback( - [&distance, &manager](int64 fromNode, int64 toNode) -> int64 { - return distance(manager.IndexToNode(fromNode), manager.IndexToNode(toNode)); + [&distance, &manager](int64 fromIndex, int64 toIndex) -> int64 { + return distance(manager.IndexToNode(fromIndex), manager.IndexToNode(toIndex)); }); routing.SetArcCostEvaluatorOfAllVehicles(vehicle_cost); AddDistanceDimension(data, vehicle_cost, &routing); diff --git a/examples/dotnet/cscvrptw.cs b/examples/dotnet/cscvrptw.cs index 091659dbe9..f07c083d10 100644 --- a/examples/dotnet/cscvrptw.cs +++ b/examples/dotnet/cscvrptw.cs @@ -63,7 +63,7 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { /// positions and computes the Manhattan distance between the two /// positions of two different indices. /// - class Manhattan : IntIntToLong { + class Manhattan : LongLongToLong { public Manhattan(RoutingIndexManager manager, Position[] locations, int coefficient) { this.locations_ = locations; @@ -71,7 +71,7 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { this.manager_ = manager; } - public override long Run(int first_index, int second_index) { + public override long Run(long first_index, long second_index) { if (first_index >= locations_.Length || second_index >= locations_.Length) { return 0; @@ -93,12 +93,12 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { /// A callback that computes the volume of a demand stored in an /// integer array. /// - class Demand : IntToLong { + class Demand : LongToLong { public Demand(int[] order_demands) { this.order_demands_ = order_demands; } - public override long Run(int index) { + public override long Run(long index) { if (index < order_demands_.Length) { return order_demands_[index]; } @@ -240,22 +240,22 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { // Setting up dimensions const int big_number = 100000; - IntIntToLong manhattan_callback = new Manhattan(manager, locations_, 1); + LongLongToLong manhattan_callback = new Manhattan(manager, locations_, 1); model.AddDimension( model.RegisterTransitCallback(manhattan_callback), big_number, big_number, false, "time"); RoutingDimension time_dimension = model.GetDimensionOrDie("time"); - IntToLong demand_callback = new Demand(order_demands_); + LongToLong demand_callback = new Demand(order_demands_); model.AddDimension(model.RegisterUnaryTransitCallback(demand_callback), 0, vehicle_capacity_, true, "capacity"); RoutingDimension capacity_dimension = model.GetDimensionOrDie("capacity"); // Setting up vehicles - IntIntToLong[] cost_callbacks = new IntIntToLong[number_of_vehicles]; + LongLongToLong[] cost_callbacks = new LongLongToLong[number_of_vehicles]; for (int vehicle = 0; vehicle < number_of_vehicles; ++vehicle) { int cost_coefficient = vehicle_cost_coefficients_[vehicle]; - IntIntToLong manhattan_cost_callback = + LongLongToLong manhattan_cost_callback = new Manhattan(manager, locations_, cost_coefficient); cost_callbacks[vehicle] = manhattan_cost_callback; int manhattan_cost_index = diff --git a/examples/dotnet/cstsp.cs b/examples/dotnet/cstsp.cs index f92f9cc6e1..693b92ad91 100644 --- a/examples/dotnet/cstsp.cs +++ b/examples/dotnet/cstsp.cs @@ -17,7 +17,7 @@ using Google.OrTools.ConstraintSolver; class Tsp { - class RandomManhattan : IntIntToLong { + class RandomManhattan : LongLongToLong { public RandomManhattan(RoutingIndexManager manager, int size, int seed) { this.xs_ = new int[size]; @@ -31,7 +31,7 @@ class Tsp } } - public override long Run(int first_index, int second_index) { + public override long Run(long first_index, long second_index) { int first_node = manager_.IndexToNode(first_index); int second_node = manager_.IndexToNode(second_index); return Math.Abs(xs_[first_node] - xs_[second_node]) + @@ -43,8 +43,8 @@ class Tsp private RoutingIndexManager manager_; }; - class ConstantCallback : IntToLong { - public override long Run(int index) { + class ConstantCallback : LongToLong { + public override long Run(long index) { return 1; } }; diff --git a/examples/dotnet/tsp.cs b/examples/dotnet/tsp.cs index f16f603b78..775de22e2d 100644 --- a/examples/dotnet/tsp.cs +++ b/examples/dotnet/tsp.cs @@ -62,7 +62,7 @@ public class TSP { /// positions and computes the Manhattan distance between the two /// positions of two different indices. /// - class ManhattanDistance : IntIntToLong { + class ManhattanDistance : LongLongToLong { private int[,] distances_; private RoutingIndexManager manager_; @@ -88,7 +88,7 @@ public class TSP { /// /// Returns the manhattan distance between the two nodes /// - public override long Run(int FromIndex, int ToIndex) { + public override long Run(long FromIndex, long ToIndex) { int FromNode = manager_.IndexToNode(FromIndex); int ToNode = manager_.IndexToNode(ToIndex); return distances_[FromNode, ToNode]; @@ -133,7 +133,7 @@ public class TSP { RoutingModel routing = new RoutingModel(manager); // Define weight of each edge - IntIntToLong distanceEvaluator = new ManhattanDistance(data, manager); + LongLongToLong distanceEvaluator = new ManhattanDistance(data, manager); //protect callbacks from the GC GC.KeepAlive(distanceEvaluator); routing.SetArcCostEvaluatorOfAllVehicles( diff --git a/examples/dotnet/vrp.cs b/examples/dotnet/vrp.cs index 6768827b89..57b3ee7d51 100644 --- a/examples/dotnet/vrp.cs +++ b/examples/dotnet/vrp.cs @@ -61,7 +61,7 @@ public class VRP { /// positions and computes the Manhattan distance between the two /// positions of two different indices. /// - class ManhattanDistance : IntIntToLong { + class ManhattanDistance : LongLongToLong { private int[,] distances_; private RoutingIndexManager manager_; @@ -87,7 +87,7 @@ public class VRP { /// /// Returns the manhattan distance between the two nodes /// - public override long Run(int FromIndex, int ToIndex) { + public override long Run(long FromIndex, long ToIndex) { int FromNode = manager_.IndexToNode(FromIndex); int ToNode = manager_.IndexToNode(ToIndex); return distances_[FromNode, ToNode]; @@ -154,7 +154,7 @@ public class VRP { RoutingModel routing = new RoutingModel(manager); // Define weight of each edge - IntIntToLong distanceEvaluator = new ManhattanDistance(data, manager); + LongLongToLong distanceEvaluator = new ManhattanDistance(data, manager); //protect callbacks from the GC GC.KeepAlive(distanceEvaluator); int distance_index = routing.RegisterTransitCallback(distanceEvaluator); diff --git a/examples/java/CapacitatedVehicleRoutingProblemWithTimeWindows.java b/examples/java/CapacitatedVehicleRoutingProblemWithTimeWindows.java index d8f429fee4..e7f7f784bd 100644 --- a/examples/java/CapacitatedVehicleRoutingProblemWithTimeWindows.java +++ b/examples/java/CapacitatedVehicleRoutingProblemWithTimeWindows.java @@ -14,8 +14,8 @@ // limitations under the License. import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.IntIntToLong; -import com.google.ortools.constraintsolver.IntToLong; +import com.google.ortools.constraintsolver.LongLongToLong; +import com.google.ortools.constraintsolver.LongToLong; import com.google.ortools.constraintsolver.IntVar; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; @@ -87,10 +87,10 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { * @param manager Node Index Manager. * @param costCoefficient The coefficient to apply to the evaluator. */ - private IntIntToLong buildManhattanCallback(RoutingIndexManager manager, int costCoefficient) { - return new IntIntToLong() { + private LongLongToLong buildManhattanCallback(RoutingIndexManager manager, int costCoefficient) { + return new LongLongToLong() { @Override - public long run(int firstIndex, int secondIndex) { + public long run(long firstIndex, long secondIndex) { try { int firstNode = manager.indexToNode(firstIndex); int secondNode = manager.indexToNode(secondIndex); @@ -179,16 +179,16 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { // Setting up dimensions final int bigNumber = 100000; - final IntIntToLong callback = buildManhattanCallback(manager, 1); + final LongLongToLong callback = buildManhattanCallback(manager, 1); final String timeStr = "time"; model.addDimension( model.registerTransitCallback(callback), bigNumber, bigNumber, false, timeStr); RoutingDimension timeDimension = model.getMutableDimension(timeStr); - IntToLong demandCallback = - new IntToLong() { + LongToLong demandCallback = + new LongToLong() { @Override - public long run(int index) { + public long run(long index) { try { int node = manager.indexToNode(index); if (node < numberOfOrders) { @@ -207,7 +207,7 @@ public class CapacitatedVehicleRoutingProblemWithTimeWindows { RoutingDimension capacityDimension = model.getMutableDimension(capacityStr); // Setting up vehicles - IntIntToLong[] callbacks = new IntIntToLong[numberOfVehicles]; + LongLongToLong[] callbacks = new LongLongToLong[numberOfVehicles]; for (int vehicle = 0; vehicle < numberOfVehicles; ++vehicle) { final int costCoefficient = vehicleCostCoefficients.get(vehicle); callbacks[vehicle] = buildManhattanCallback(manager, costCoefficient); diff --git a/examples/java/Tsp.java b/examples/java/Tsp.java index a955ac5c6e..d99c5f3ad1 100644 --- a/examples/java/Tsp.java +++ b/examples/java/Tsp.java @@ -14,8 +14,8 @@ // limitations under the License. import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.IntIntToLong; -import com.google.ortools.constraintsolver.IntToLong; +import com.google.ortools.constraintsolver.LongLongToLong; +import com.google.ortools.constraintsolver.LongToLong; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; import com.google.ortools.constraintsolver.RoutingSearchParameters; @@ -29,7 +29,7 @@ class Tsp { System.loadLibrary("jniortools"); } - static class RandomManhattan extends IntIntToLong { + static class RandomManhattan extends LongLongToLong { public RandomManhattan(RoutingIndexManager manager, int size, int seed) { this.xs = new int[size]; this.ys = new int[size]; @@ -42,7 +42,7 @@ class Tsp { } @Override - public long run(int firstIndex, int secondIndex) { + public long run(long firstIndex, long secondIndex) { int firstNode = indexManager.indexToNode(firstIndex); int secondNode = indexManager.indexToNode(secondIndex); return Math.abs(xs[firstNode] - xs[secondNode]) + Math.abs(ys[firstNode] - ys[secondNode]); @@ -53,9 +53,9 @@ class Tsp { private RoutingIndexManager indexManager; } - static class ConstantCallback extends IntToLong { + static class ConstantCallback extends LongToLong { @Override - public long run(int index) { + public long run(long index) { return 1; } } @@ -68,7 +68,7 @@ class Tsp { // Put a permanent callback to the distance accessor here. The callback // has the following signature: ResultCallback2. // The two arguments are the from and to node inidices. - IntIntToLong distances = new RandomManhattan(manager, size, seed); + LongLongToLong distances = new RandomManhattan(manager, size, seed); routing.setArcCostEvaluatorOfAllVehicles(routing.registerTransitCallback(distances)); // Forbid node connections (randomly). diff --git a/examples/java/Vrp.java b/examples/java/Vrp.java index 5fe232a353..5f6835edc3 100644 --- a/examples/java/Vrp.java +++ b/examples/java/Vrp.java @@ -14,7 +14,7 @@ import static java.lang.Math.abs; import com.google.ortools.constraintsolver.Assignment; import com.google.ortools.constraintsolver.FirstSolutionStrategy; -import com.google.ortools.constraintsolver.IntIntToLong; +import com.google.ortools.constraintsolver.LongLongToLong; import com.google.ortools.constraintsolver.RoutingDimension; import com.google.ortools.constraintsolver.RoutingIndexManager; import com.google.ortools.constraintsolver.RoutingModel; @@ -66,7 +66,7 @@ class DataProblem { /// @details It uses an array of positions and computes /// the Manhattan distance between the two positions of /// two different indices. -class ManhattanDistance extends IntIntToLong { +class ManhattanDistance extends LongLongToLong { private int[][] distances; private RoutingIndexManager indexManager; @@ -87,7 +87,7 @@ class ManhattanDistance extends IntIntToLong { @Override /// @brief Returns the manhattan distance between the two nodes. - public long run(int fromIndex, int toIndex) { + public long run(long fromIndex, long toIndex) { int fromNode = indexManager.indexToNode(fromIndex); int toNode = indexManager.indexToNode(toIndex); return distances[fromNode][toNode]; @@ -147,7 +147,7 @@ class Vrp { // Setting the cost function. // [todo]: protect callback from the GC - IntIntToLong distanceEvaluator = new ManhattanDistance(data, manager); + LongLongToLong distanceEvaluator = new ManhattanDistance(data, manager); int distanceIndex = routing.registerTransitCallback(distanceEvaluator); routing.setArcCostEvaluatorOfAllVehicles(distanceIndex); addDistanceDimension(routing, data, distanceIndex); diff --git a/ortools/constraint_solver/csharp/constraint_solver.i b/ortools/constraint_solver/csharp/constraint_solver.i index a7d2edc896..7256b49f4e 100644 --- a/ortools/constraint_solver/csharp/constraint_solver.i +++ b/ortools/constraint_solver/csharp/constraint_solver.i @@ -622,7 +622,7 @@ namespace operations_research { LocalSearchOperator* ConcatenateOperators( const std::vector& ops, swig_util::IntIntToLong* evaluator) { - return $self->ConcatenateOperators(ops, [evaluator](int i, int64 j) { + return $self->ConcatenateOperators(ops, [evaluator](int i, int j) { return evaluator->Run(i, j); }); } SearchMonitor* MakeSearchLog( diff --git a/ortools/constraint_solver/csharp/routing.i b/ortools/constraint_solver/csharp/routing.i index 08d5e705c0..2ffc876aaf 100644 --- a/ortools/constraint_solver/csharp/routing.i +++ b/ortools/constraint_solver/csharp/routing.i @@ -59,13 +59,13 @@ class RoutingSearchParameters; operations_research::TransitCallback1); %extend operations_research::RoutingModel { - int RegisterTransitCallback(swig_util::IntIntToLong* callback) { - return $self->RegisterTransitCallback([callback](int i, int j) { + int RegisterTransitCallback(swig_util::LongLongToLong* callback) { + return $self->RegisterTransitCallback([callback](int64 i, int64 j) { return callback->Run(i, j); }); } - int RegisterUnaryTransitCallback(swig_util::IntToLong* callback) { - return $self->RegisterUnaryTransitCallback([callback](int i) { + int RegisterUnaryTransitCallback(swig_util::LongToLong* callback) { + return $self->RegisterUnaryTransitCallback([callback](int64 i) { return callback->Run(i); }); } diff --git a/ortools/constraint_solver/routing_types.h b/ortools/constraint_solver/routing_types.h index 1b13f86f7b..f5a72dd2e4 100644 --- a/ortools/constraint_solver/routing_types.h +++ b/ortools/constraint_solver/routing_types.h @@ -37,8 +37,8 @@ DEFINE_INT_TYPE(RoutingDimensionIndex, int); DEFINE_INT_TYPE(RoutingDisjunctionIndex, int); DEFINE_INT_TYPE(RoutingVehicleClassIndex, int); -typedef std::function RoutingTransitCallback1; -typedef std::function RoutingTransitCallback2; +typedef std::function RoutingTransitCallback1; +typedef std::function RoutingTransitCallback2; // NOTE(user): keep the "> >" for SWIG. typedef std::pair, std::vector > RoutingIndexPair; typedef std::vector RoutingIndexPairs;