scenario_simulator_v2 C++ API
time_headway_condition.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__TIME_HEADWAY_CONDITION_HPP_
16 #define OPENSCENARIO_INTERPRETER__SYNTAX__TIME_HEADWAY_CONDITION_HPP_
17 
25 #include <pugixml.hpp>
26 
28 {
29 inline namespace syntax
30 {
31 /* ---- TimeHeadwayCondition ---------------------------------------------------
32  *
33  * Condition based on the headway time between a triggering entity/entities
34  * and a reference entity. The logical operator used for comparison is defined
35  * by the rule attribute.
36  *
37  * <xsd:complexType name="TimeHeadwayCondition">
38  * <xsd:attribute name="entityRef" type="String" use="required"/>
39  * <xsd:attribute name="value" type="Double" use="required"/>
40  * <xsd:attribute name="freespace" type="Boolean" use="required"/>
41  * <xsd:attribute name="alongRoute" type="Boolean" use="required"/>
42  * <xsd:attribute name="rule" type="Rule" use="required"/>
43  * </xsd:complexType>
44  *
45  * -------------------------------------------------------------------------- */
47 {
49 
50  const Double value;
51 
53 
55 
56  const Rule compare;
57 
59 
60  std::vector<Double> results; // for description
61 
62  explicit TimeHeadwayCondition(const pugi::xml_node &, Scope &, const TriggeringEntities &);
63 
64  auto description() const -> String;
65 
66  auto evaluate() -> Object;
67 };
68 } // namespace syntax
69 } // namespace openscenario_interpreter
70 
71 #endif // OPENSCENARIO_INTERPRETER__SYNTAX__TIME_HEADWAY_CONDITION_HPP_
Definition: scope.hpp:154
std::string String
Definition: string.hpp:24
Definition: escape_sequence.hpp:22
Definition: time_headway_condition.hpp:47
const TriggeringEntities triggering_entities
Definition: time_headway_condition.hpp:58
const Boolean along_route
Definition: time_headway_condition.hpp:54
TimeHeadwayCondition(const pugi::xml_node &, Scope &, const TriggeringEntities &)
Definition: time_headway_condition.cpp:23
std::vector< Double > results
Definition: time_headway_condition.hpp:60
const Double value
Definition: time_headway_condition.hpp:50
auto evaluate() -> Object
Definition: time_headway_condition.cpp:49
const String entity_ref
Definition: time_headway_condition.hpp:48
const Rule compare
Definition: time_headway_condition.hpp:56
const Boolean freespace
Definition: time_headway_condition.hpp:52
auto description() const -> String
Definition: time_headway_condition.cpp:35
Definition: triggering_entities.hpp:39