C++ Reference

C++ Reference: Routing

routing_types.h
Go to the documentation of this file.
1 // Copyright 2010-2018 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
15 #define OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
16 
17 #include <functional>
18 #include <utility>
19 #include <vector>
20 
21 #include "ortools/base/int_type.h"
22 #include "ortools/base/integral_types.h"
23 
24 namespace operations_research {
25 
35 DEFINE_INT_TYPE(RoutingNodeIndex, int);
36 DEFINE_INT_TYPE(RoutingCostClassIndex, int);
37 DEFINE_INT_TYPE(RoutingDimensionIndex, int);
38 DEFINE_INT_TYPE(RoutingDisjunctionIndex, int);
39 DEFINE_INT_TYPE(RoutingVehicleClassIndex, int);
40 
41 typedef std::function<int64(int64)> RoutingTransitCallback1;
42 typedef std::function<int64(int64, int64)> RoutingTransitCallback2;
43 // NOTE(user): keep the "> >" for SWIG.
44 typedef std::pair<std::vector<int64>, std::vector<int64> > RoutingIndexPair;
45 typedef std::vector<RoutingIndexPair> RoutingIndexPairs;
46 
47 } // namespace operations_research
48 
49 #endif // OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
DEFINE_INT_TYPE(RoutingNodeIndex, int)
Defining common types used in the routing library outside the main RoutingModel class has several pur...
std::function< int64(int64)> RoutingTransitCallback1
Definition: routing_types.h:41
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
std::pair< std::vector< int64 >, std::vector< int64 > > RoutingIndexPair
Definition: routing_types.h:44
std::vector< RoutingIndexPair > RoutingIndexPairs
Definition: routing_types.h:45
std::function< int64(int64, int64)> RoutingTransitCallback2
Definition: routing_types.h:42