scenario_simulator_v2 C++ API
routing_algorithm.hpp
Go to the documentation of this file.
1 // Copyright 2015 TIER IV, Inc. All rights reserved.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef OPENSCENARIO_INTERPRETER__SYNTAX__ROUTING_ALGORITHM_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__ROUTING_ALGORITHM_HPP_
17 
18 #include <iostream>
19 
21 {
22 inline namespace syntax
23 {
24 /*
25  RoutingAlgorithm (OpenSCENARIO XML 1.3)
26 
27  Algorithm for path selection/calculation between two positions across roads.
28  To be used for distance calculations in road/lane coordinates during runtime.
29 
30  <xsd:simpleType name="RoutingAlgorithm">
31  <xsd:union>
32  <xsd:simpleType>
33  <xsd:restriction base="xsd:string">
34  <xsd:enumeration value="assignedRoute"/>
35  <xsd:enumeration value="fastest"/>
36  <xsd:enumeration value="leastIntersections"/>
37  <xsd:enumeration value="shortest"/>
38  <xsd:enumeration value="undefined"/>
39  </xsd:restriction>
40  </xsd:simpleType>
41  <xsd:simpleType>
42  <xsd:restriction base="parameter"/>
43  </xsd:simpleType>
44  </xsd:union>
45  </xsd:simpleType>
46 */
48 {
49  enum value_type {
50  /*
51  It is up to the simulator how to calculate the route between the start
52  and target positions.
53  */
54  undefined, // NOTE: DEFAULT VALUE
55 
56  /*
57  Use the route which has already been assigned to the entity at the start
58  position at the point in time when the distance shall be calculated.
59  */
61 
62  /*
63  Calculate the route with the shortest travelling time between start and
64  target position.
65  */
67 
68  /*
69  Calculate the route with as few junctions as possible between start and
70  target position.
71  */
73 
74  /*
75  Calculate the route with the shortest path between start and target
76  position.
77  */
79  } value;
80 
81  RoutingAlgorithm() = default;
82 
84 
85  constexpr operator value_type() const noexcept { return value; }
86 };
87 
88 auto operator>>(std::istream &, RoutingAlgorithm &) -> std::istream &;
89 
90 auto operator<<(std::ostream &, const RoutingAlgorithm &) -> std::ostream &;
91 } // namespace syntax
92 } // namespace openscenario_interpreter
93 
94 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__ROUTING_ALGORITHM_HPP_
auto operator>>(std::istream &, Boolean &) -> std::istream &
Definition: boolean.cpp:52
auto operator<<(std::ostream &, const Boolean &) -> std::ostream &
Definition: boolean.cpp:46
Definition: escape_sequence.hpp:22
Definition: routing_algorithm.hpp:48
value_type
Definition: routing_algorithm.hpp:49
@ shortest
Definition: routing_algorithm.hpp:78
@ least_intersections
Definition: routing_algorithm.hpp:72
@ fastest
Definition: routing_algorithm.hpp:66
@ undefined
Definition: routing_algorithm.hpp:54
@ assigned_route
Definition: routing_algorithm.hpp:60
constexpr RoutingAlgorithm(value_type value)
Definition: routing_algorithm.hpp:83
enum openscenario_interpreter::syntax::RoutingAlgorithm::value_type value