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
24namespace operations_research {
25
35DEFINE_INT_TYPE(RoutingNodeIndex, int);
36DEFINE_INT_TYPE(RoutingCostClassIndex, int);
37DEFINE_INT_TYPE(RoutingDimensionIndex, int);
38DEFINE_INT_TYPE(RoutingDisjunctionIndex, int);
39DEFINE_INT_TYPE(RoutingVehicleClassIndex, int);
40
41typedef std::function<int64(int64)> RoutingTransitCallback1;
42typedef std::function<int64(int64, int64)> RoutingTransitCallback2;
43// NOTE(user): keep the "> >" for SWIG.
44typedef std::pair<std::vector<int64>, std::vector<int64> > RoutingIndexPair;
45typedef std::vector<RoutingIndexPair> RoutingIndexPairs;
46
47} // namespace operations_research
48
49#endif // OR_TOOLS_CONSTRAINT_SOLVER_ROUTING_TYPES_H_
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
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, int64)> RoutingTransitCallback2
Definition: routing_types.h:42
std::function< int64(int64)> RoutingTransitCallback1
Definition: routing_types.h:41
std::vector< RoutingIndexPair > RoutingIndexPairs
Definition: routing_types.h:45