scenario_simulator_v2 C++ API
speed_change.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 TRAFFIC_SIMULATOR__DATA_TYPE__SPEED_CHANGE_HPP_
16 #define TRAFFIC_SIMULATOR__DATA_TYPE__SPEED_CHANGE_HPP_
17 
18 #include <iostream>
21 
22 namespace traffic_simulator
23 {
24 namespace speed_change
25 {
26 enum class Transition {
28  LINEAR,
30  STEP,
31  AUTO
32 };
33 
34 struct Constraint
35 {
36  enum class Type {
39  TIME,
40  NONE
41  };
42  explicit constexpr Constraint(const Constraint::Type type, const double value)
43  : type(type), value(value)
44  {
45  }
47  double value;
48 };
49 
51 {
52  enum class Type {
53  DELTA,
54  FACTOR,
55  };
58  const double value)
60  {
61  }
62  double getAbsoluteValue(
63  const CanonicalizedEntityStatus & status,
64  const std::unordered_map<std::string, CanonicalizedEntityStatus> & other_status) const;
67  double value;
68 };
69 } // namespace speed_change
70 } // namespace traffic_simulator
71 
72 #endif // TRAFFIC_SIMULATOR__DATA_TYPE__SPEED_CHANGE_HPP_
Definition: entity_status.hpp:32
Transition
Definition: speed_change.hpp:26
Definition: api.hpp:48
std::string string
Definition: junit5.hpp:26
Definition: speed_change.hpp:35
Type
Definition: speed_change.hpp:36
constexpr Constraint(const Constraint::Type type, const double value)
Definition: speed_change.hpp:42
Type type
Definition: speed_change.hpp:46
double value
Definition: speed_change.hpp:47
double getAbsoluteValue(const CanonicalizedEntityStatus &status, const std::unordered_map< std::string, CanonicalizedEntityStatus > &other_status) const
Definition: speed_change.cpp:33
std::string reference_entity_name
Definition: speed_change.hpp:65
RelativeTargetSpeed(const std::string &reference_entity_name, const RelativeTargetSpeed::Type type, const double value)
Definition: speed_change.hpp:56
double value
Definition: speed_change.hpp:67
Type type
Definition: speed_change.hpp:66