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