scenario_simulator_v2 C++ API
phase.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__PHASE_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__PHASE_HPP_
17 
23 #include <pugixml.hpp>
24 
26 {
27 inline namespace syntax
28 {
29 /* ---- Phase ------------------------------------------------------------------
30  *
31  * <xsd:complexType name="Phase">
32  * <xsd:sequence>
33  * <xsd:element name="TrafficSignalState" minOccurs="0" maxOccurs="unbounded" type="TrafficSignalState"/>
34  * </xsd:sequence>
35  * <xsd:attribute name="name" type="String" use="required"/>
36  * <xsd:attribute name="duration" type="Double" use="required"/>
37  * </xsd:complexType>
38  *
39  * -------------------------------------------------------------------------- */
41 {
42  // Name of the phase.
43  const String name;
44 
45  // Duration of the phase. Unit: s; Range: [0..inf[.
47 
48  /* ---- NOTE -----------------------------------------------------------------
49  *
50  * Each phase has multiple TrafficSignalStates. One for each TrafficSignal
51  * that is controlled.
52  *
53  * E.g. phase1 (trafficSignal1: true; false; false,
54  * trafficSignal2: false; false; true).
55  *
56  * ------------------------------------------------------------------------ */
57  const std::list<TrafficSignalState> traffic_signal_states;
58 
59  explicit Phase(const pugi::xml_node &, Scope &);
60 
61  auto evaluate() const -> Object;
62 
63  auto clearStates() const -> void;
64 };
65 } // namespace syntax
66 } // namespace openscenario_interpreter
67 
68 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__PHASE_HPP_
Definition: scope.hpp:158
std::string String
Definition: string.hpp:24
Definition: hypot.hpp:22
Definition: phase.hpp:41
const Double duration
Definition: phase.hpp:46
auto clearStates() const -> void
Definition: phase.cpp:41
const std::list< TrafficSignalState > traffic_signal_states
Definition: phase.hpp:57
auto evaluate() const -> Object
Definition: phase.cpp:30
const String name
Definition: phase.hpp:43
Phase(const pugi::xml_node &, Scope &)
Definition: phase.cpp:23