scenario_simulator_v2 C++ API
lane_change_action.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__LANE_CHANGE_ACTION_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__LANE_CHANGE_ACTION_HPP_
17 
25 #include <pugixml.hpp>
26 #include <unordered_map>
27 
29 {
30 inline namespace syntax
31 {
32 /* ---- LaneChangeAction -------------------------------------------------------
33  *
34  * <xsd:complexType name="LaneChangeAction">
35  * <xsd:all>
36  * <xsd:element name="LaneChangeActionDynamics" type="TransitionDynamics"/>
37  * <xsd:element name="LaneChangeTarget" type="LaneChangeTarget"/>
38  * </xsd:all>
39  * <xsd:attribute name="targetLaneOffset" type="Double" use="optional"/>
40  * </xsd:complexType>
41  *
42  * -------------------------------------------------------------------------- */
43 struct LaneChangeAction : private Scope,
46 {
48 
50 
52 
53  explicit LaneChangeAction(const pugi::xml_node &, Scope &);
54 
55  std::unordered_map<String, Boolean> accomplishments;
56 
57  /* */ auto accomplished() -> bool;
58 
59  static auto endsImmediately() noexcept -> bool;
60 
61  static auto run() noexcept -> void;
62 
63  /* */ auto start() -> void;
64 
65  explicit operator traffic_simulator::lane_change::AbsoluteTarget() const;
66 
67  explicit operator traffic_simulator::lane_change::RelativeTarget() const;
68 };
69 } // namespace syntax
70 } // namespace openscenario_interpreter
71 
72 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__LANE_CHANGE_ACTION_HPP_
Definition: scope.hpp:154
Definition: escape_sequence.hpp:22
Definition: api.hpp:48
Definition: lane_change_action.hpp:46
LaneChangeAction(const pugi::xml_node &, Scope &)
Definition: lane_change_action.cpp:26
auto start() -> void
Definition: lane_change_action.cpp:49
static auto run() noexcept -> void
Definition: lane_change_action.cpp:47
auto accomplished() -> bool
Definition: lane_change_action.cpp:35
const Double target_lane_offset
Definition: lane_change_action.hpp:47
std::unordered_map< String, Boolean > accomplishments
Definition: lane_change_action.hpp:55
const LaneChangeTarget lane_change_target
Definition: lane_change_action.hpp:51
const TransitionDynamics lane_change_action_dynamics
Definition: lane_change_action.hpp:49
static auto endsImmediately() noexcept -> bool
Definition: lane_change_action.cpp:45
Definition: lane_change_target.hpp:36
Definition: transition_dynamics.hpp:38