WSF
XWsfOSM_Traffic Class Reference

#include <XWsfOSM_Traffic.hpp>

Inheritance diagram for XWsfOSM_Traffic:
Collaboration diagram for XWsfOSM_Traffic:

Classes

struct  SGroundTraffic
class  QueuedOperation
class  QueuedConvoyOperation
class  QueuedSpeedChange
class  WeightedRouteEdge
struct  RoutePair
struct  RoutePairHash
class  WeightedRouteNode
struct  WeightedRouteNodeHash
class  TrackerDetails
class  QueuedRoadRelease

Public Types

enum class  IntersectionRestriction { cNONE , cSTOP , cTRAFFIC }

Public Member Functions

 XWsfOSM_Traffic (WsfOSM_TrafficInput &aData)
 ~XWsfOSM_Traffic () override
 XWsfOSM_Traffic (const XWsfOSM_Traffic &aRoadTraffic)=delete
XWsfOSM_Trafficoperator= (const XWsfOSM_Traffic &aRoadTraffic)=delete
void AddedToSimulation () override
bool Initialize () override
void AdvanceTime (double aSimTime)
std::vector< WsfRoute * > GetRoutesOnNetwork (const std::string &aNetworkName)
WsfRouteGetIndividualRoute (const std::string &aNetworkName, const std::string &aBaseName, int aLaneNumber=1, bool aDirection=true, int aSegmentNumber=1)
std::vector< WsfPlatform * > GetPlatformsAlongRoute (const std::string &aNetworkName, const std::string &aRouteName)
WsfWaypointGetNextWaypoint (const std::string &aNetworkname, const std::string &aRouteName, double aDistance)
std::string GetTrafficFlow (double aSimTime, const std::string &aNetworkName, const std::string &aNodeId)
std::string GetNodeOnRoute (const std::string &aNetworkName, const std::string &aRouteName, bool aFirstOrLast)
std::vector< WsfRoute * > GetConnectedRoutes (const std::string &aNetworkName, const std::string &aNodeId)
bool AddScriptedVehicle (WsfPlatform *aPlatformPtr, const std::string &aNetworkName, WsfRoute *aRoute, int &aVehicleNumber)
bool AddScriptedConvoy (const std::vector< WsfPlatform * > aPlatformList, const std::string &aNetworkName, WsfRoute *aRoute, double aInitialSpacing)
void UpdateScriptedVehicleRoute (WsfPlatform *aPlatformPtr, WsfRoute *aRoute, int aWaypointIndex=0)
bool ChangeScriptedLane (WsfPlatform *aPlatformPtr, bool aDirection)
bool ScriptLockIntersection (const std::string &aNetworkName, const std::string &aNodeId)
bool ScriptUnlockIntersection (const std::string &aNetworkName, const std::string &aNodeId)
void ScriptGoOffroad (WsfPlatform *aVehicle, const WsfGeoPoint &aGeoPoint)
Public Member Functions inherited from WsfSimulationExtension
 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
virtual bool PrepareExtension ()
virtual bool PlatformsInitialized ()
virtual void PendingStart ()
virtual void Start ()
virtual void Complete (double aSimTime)
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const
Public Member Functions inherited from WsfOSM_TrafficInput
 WsfOSM_TrafficInput ()=default
 ~WsfOSM_TrafficInput () override=default
bool ProcessInput (UtInput &aInput) override
Public Member Functions inherited from XWsfRouteNetwork
 XWsfRouteNetwork ()=default
virtual ~XWsfRouteNetwork ()=default
virtual bool Initialize (const WsfScenario &aScenario)
 If Initialize is redefined, make sure to call XWsfRouteNetwork::Initialize().
virtual void Update (double)
 An update method for applications that need simulation updates.

Static Public Member Functions

static XWsfOSM_TrafficFind (const WsfSimulation &aSimulation)
static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)

Additional Inherited Members

Protected Types inherited from XWsfRouteNetwork
using Networks = std::vector<ut::CloneablePtr<NetworkInput>>
Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)
Protected Member Functions inherited from WsfOSM_TrafficInput
 WsfOSM_TrafficInput (const WsfOSM_TrafficInput &)=default
bool ProcessRoadTraffic (UtInput &aInput)
Protected Member Functions inherited from XWsfRouteNetwork
 XWsfRouteNetwork (const XWsfRouteNetwork &aSrc)=default
XWsfRouteNetworkoperator= (const XWsfRouteNetwork &aRhs)=delete
virtual bool ProcessCommand (UtInput &aInput, NetworkInput &aNetworkInput)
Protected Attributes inherited from WsfOSM_TrafficInput
bool mProcessedInput {false}
bool mDebug {false}
Protected Attributes inherited from XWsfRouteNetwork
ut::Random mRandom
Networks mNetworks

Detailed Description

XWsfOSM_Traffic provides basic background traffic capability. Based on the provided input file, a specified number of ground vehicles are created and placed randomly on the specified road network. The road networks themselves should be generated via the OSM Converter, but user-generated road networks can still be used. This implementation relies on route and waypoint aux_data to specify important details such as speed limits, route density (how congested individual routes should be on average), intersection restraints and road type. The initial number of vehicles is always maintained, so whenever a vehicle reaches a route endpoint without intersections, it is placed at some other endpoint without an intersection heading in the opposite direction.

Member Enumeration Documentation

◆ IntersectionRestriction

Enumerator
cNONE 
cSTOP 
cTRAFFIC 

Constructor & Destructor Documentation

◆ XWsfOSM_Traffic() [1/2]

◆ ~XWsfOSM_Traffic()

XWsfOSM_Traffic::~XWsfOSM_Traffic ( )
override

◆ XWsfOSM_Traffic() [2/2]

XWsfOSM_Traffic::XWsfOSM_Traffic ( const XWsfOSM_Traffic & aRoadTraffic)
delete

References XWsfOSM_Traffic().

Member Function Documentation

◆ AddedToSimulation()

void XWsfOSM_Traffic::AddedToSimulation ( )
overridevirtual

Called in response to WsfSimulation::RegisterExtension. The extension has now been registered in the simulation.

Reimplemented from WsfSimulationExtension.

References WsfObserver::AdvanceTime(), AdvanceTime(), WsfSimulationExtension::GetSimulation(), WsfObserver::MoverPathEnded(), and WsfObserver::PlatformDeleted().

◆ AddScriptedConvoy()

bool XWsfOSM_Traffic::AddScriptedConvoy ( const std::vector< WsfPlatform * > aPlatformList,
const std::string & aNetworkName,
WsfRoute * aRoute,
double aInitialSpacing )

◆ AddScriptedVehicle()

◆ AdvanceTime()

void XWsfOSM_Traffic::AdvanceTime ( double aSimTime)

Referenced by AddedToSimulation(), and operator=().

◆ ChangeScriptedLane()

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > XWsfOSM_Traffic::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

Referenced by operator=().

◆ Find()

XWsfOSM_Traffic * XWsfOSM_Traffic::Find ( const WsfSimulation & aSimulation)
static

◆ GetConnectedRoutes()

std::vector< WsfRoute * > XWsfOSM_Traffic::GetConnectedRoutes ( const std::string & aNetworkName,
const std::string & aNodeId )

References XWsfRouteNetwork::mNetworks.

Referenced by operator=().

◆ GetIndividualRoute()

WsfRoute * XWsfOSM_Traffic::GetIndividualRoute ( const std::string & aNetworkName,
const std::string & aBaseName,
int aLaneNumber = 1,
bool aDirection = true,
int aSegmentNumber = 1 )

References GetRoutesOnNetwork().

Referenced by operator=().

◆ GetNextWaypoint()

WsfWaypoint * XWsfOSM_Traffic::GetNextWaypoint ( const std::string & aNetworkname,
const std::string & aRouteName,
double aDistance )

References WsfWaypoint::Clone(), and GetRoutesOnNetwork().

Referenced by operator=().

◆ GetNodeOnRoute()

std::string XWsfOSM_Traffic::GetNodeOnRoute ( const std::string & aNetworkName,
const std::string & aRouteName,
bool aFirstOrLast )

References GetRoutesOnNetwork().

Referenced by operator=().

◆ GetPlatformsAlongRoute()

std::vector< WsfPlatform * > XWsfOSM_Traffic::GetPlatformsAlongRoute ( const std::string & aNetworkName,
const std::string & aRouteName )

Referenced by operator=().

◆ GetRoutesOnNetwork()

std::vector< WsfRoute * > XWsfOSM_Traffic::GetRoutesOnNetwork ( const std::string & aNetworkName)

◆ GetTrafficFlow()

std::string XWsfOSM_Traffic::GetTrafficFlow ( double aSimTime,
const std::string & aNetworkName,
const std::string & aNodeId )

Referenced by operator=().

◆ Initialize()

bool XWsfOSM_Traffic::Initialize ( )
overridevirtual

Called in response to WsfSimulation::Initialize. This is called to allow the extension to perform any initialization that is required.

Note
The extension should not assume that another extension has been initialized unless it this extension has been registered as a dependency of the other extension.

Reimplemented from WsfSimulationExtension.

References WsfSimulationExtension::GetScenario(), WsfSimulationExtension::GetSimulation(), XWsfRouteNetwork::Initialize(), WsfOSM_TrafficInput::RoadTrafficNetworkInput::mNetIndex, XWsfRouteNetwork::mNetworks, WsfOSM_TrafficInput::mProcessedInput, XWsfRouteNetwork::NetworkInput::mRouteNetworkPtr, and ok.

◆ operator=()

◆ ScriptGoOffroad()

◆ ScriptLockIntersection()

bool XWsfOSM_Traffic::ScriptLockIntersection ( const std::string & aNetworkName,
const std::string & aNodeId )

References XWsfRouteNetwork::mNetworks.

Referenced by operator=().

◆ ScriptUnlockIntersection()

bool XWsfOSM_Traffic::ScriptUnlockIntersection ( const std::string & aNetworkName,
const std::string & aNodeId )

References XWsfRouteNetwork::mNetworks.

Referenced by operator=().

◆ UpdateScriptedVehicleRoute()

void XWsfOSM_Traffic::UpdateScriptedVehicleRoute ( WsfPlatform * aPlatformPtr,
WsfRoute * aRoute,
int aWaypointIndex = 0 )

The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved