WSF
WsfOSM_TrafficInput.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2019 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFOSMTRAFFICINPUT_HPP
13#define WSFOSMTRAFFICINPUT_HPP
14
15#include "XWsfRouteNetwork.hpp"
16
19{
20public:
22 {
23 public:
24 VehicleInput() = default;
26 : mTypeId(aTypeId)
27 {
28 }
29
31 int mCount{0};
32 double mFraction{0.0};
33 double mMeanSpeed{0.0};
34 double mSigmaSpeed{0.0};
35 bool mIgnoreSpeedLimits{false};
36 };
37
39 {
40 std::string mStartingRoute;
41 double mDistanceAlongRoute{0.0};
42 double mSpacing{0.0};
43 double mSpeed{0.0};
44 std::vector<VehicleInput> mVehicleInput;
45 };
46
48 {
49 std::string mMinSpeed{"minspeed"};
50 std::string mMaxSpeed{"maxspeed"};
51 std::string mSurface{"surface"};
52 std::string mLanes{"lanes"};
53 std::string mDensity{
54 "density"};
55 std::string mOneWay{"oneway"};
56 };
57
59 {
60 std::string mStop{"stop"};
61 std::string mTrafficSignals{"traffic_signals"};
62 std::string mHighway{"highway"};
63 };
64
66 {
67 public:
70 : NetworkInput(aNetworkId)
71 {
72 }
73
74 NetworkInput* Clone() const noexcept override { return new RoadTrafficNetworkInput{*this}; }
75
76 std::vector<VehicleInput> mVehicleInput;
77 std::vector<ConvoyInput> mConvoyInput;
81 double mMaxSpeed{0.0};
82 unsigned int mNetIndex{0};
83
84 protected:
86 };
87
89 ~WsfOSM_TrafficInput() override = default;
90
91 bool ProcessInput(UtInput& aInput) override;
92
93protected:
94 WsfOSM_TrafficInput(const WsfOSM_TrafficInput& /* aSrc */) = default;
95 bool ProcessRoadTraffic(UtInput& aInput);
96
97 bool mProcessedInput{false};
98 bool mDebug{false};
99};
100
101#endif
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
RoadTrafficNetworkInput(const RoadTrafficNetworkInput &aRhs)=default
The network's index, used for easier access to the network.
double mMaxSpeed
Data to map aux data variables to waypoint variables.
Definition WsfOSM_TrafficInput.hpp:81
RouteAuxMapping mRouteAuxDataMap
Data for each of the convoys in this road network.
Definition WsfOSM_TrafficInput.hpp:78
unsigned int mNetIndex
Maximum speed of any vehicle (m/s).
Definition WsfOSM_TrafficInput.hpp:82
WaypointAuxMapping mWaypointAuxDataMap
Definition WsfOSM_TrafficInput.hpp:80
RoadTrafficNetworkInput(WsfStringId aNetworkId)
Definition WsfOSM_TrafficInput.hpp:69
NetworkInput * Clone() const noexcept override
Definition WsfOSM_TrafficInput.hpp:74
std::vector< VehicleInput > mVehicleInput
Definition WsfOSM_TrafficInput.hpp:76
std::vector< ConvoyInput > mConvoyInput
Data for each of the vehicle types on this road network.
Definition WsfOSM_TrafficInput.hpp:77
double mFraction
The number of vehicles that should be created of this type.
Definition WsfOSM_TrafficInput.hpp:32
double mSigmaSpeed
Mean velocity in m/s: will only be considered when no speed limit exists.
Definition WsfOSM_TrafficInput.hpp:34
WsfStringId mTypeId
Definition WsfOSM_TrafficInput.hpp:30
int mCount
String Id of the type of the vehicle.
Definition WsfOSM_TrafficInput.hpp:31
bool mIgnoreSpeedLimits
Sigma velocity in m/s: will only be considered when no speed limit exists.
Definition WsfOSM_TrafficInput.hpp:35
double mMeanSpeed
The percentage of this vehicle type that should exist in the simulation.
Definition WsfOSM_TrafficInput.hpp:33
VehicleInput(WsfStringId aTypeId)
Definition WsfOSM_TrafficInput.hpp:25
WsfOSM_TrafficInput()=default
~WsfOSM_TrafficInput() override=default
bool ProcessRoadTraffic(UtInput &aInput)
Definition WsfOSM_TrafficInput.cpp:255
WsfOSM_TrafficInput(const WsfOSM_TrafficInput &)=default
bool mDebug
Definition WsfOSM_TrafficInput.hpp:98
bool mProcessedInput
Definition WsfOSM_TrafficInput.hpp:97
Definition XWsfRouteNetwork.hpp:55
NetworkInput(WsfStringId aNetworkId)
Definition XWsfRouteNetwork.hpp:57
XWsfRouteNetwork()=default
virtual bool ProcessInput(UtInput &aInput)
Definition XWsfRouteNetwork.cpp:69
Definition WsfOSM_TrafficInput.hpp:39
std::vector< VehicleInput > mVehicleInput
Definition WsfOSM_TrafficInput.hpp:44
double mDistanceAlongRoute
The road that the convoy starts at.
Definition WsfOSM_TrafficInput.hpp:41
double mSpacing
The distance along the route where the last vehicle of the convoy is located.
Definition WsfOSM_TrafficInput.hpp:42
std::string mStartingRoute
Definition WsfOSM_TrafficInput.hpp:40
double mSpeed
Definition WsfOSM_TrafficInput.hpp:43
Definition WsfOSM_TrafficInput.hpp:48
std::string mMaxSpeed
Definition WsfOSM_TrafficInput.hpp:50
std::string mSurface
Definition WsfOSM_TrafficInput.hpp:51
std::string mLanes
Definition WsfOSM_TrafficInput.hpp:52
std::string mDensity
Definition WsfOSM_TrafficInput.hpp:53
std::string mMinSpeed
Definition WsfOSM_TrafficInput.hpp:49
std::string mOneWay
Corresponds to the density a particular route should have, create based on highway type.
Definition WsfOSM_TrafficInput.hpp:55
Definition WsfOSM_TrafficInput.hpp:59
std::string mHighway
Definition WsfOSM_TrafficInput.hpp:62
std::string mTrafficSignals
Definition WsfOSM_TrafficInput.hpp:61
std::string mStop
Definition WsfOSM_TrafficInput.hpp:60
Copyrights Multiple, All Rights Reserved