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