|
WSF
|
#include <XWsfOSM_Traffic.hpp>


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_Traffic & | operator= (const XWsfOSM_Traffic &aRoadTraffic)=delete |
| void | AddedToSimulation () override |
| bool | Initialize () override |
| void | AdvanceTime (double aSimTime) |
| std::vector< WsfRoute * > | GetRoutesOnNetwork (const std::string &aNetworkName) |
| WsfRoute * | GetIndividualRoute (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) |
| WsfWaypoint * | GetNextWaypoint (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 | |
| WsfSimulation & | GetSimulation () const |
| const WsfScenario & | GetScenario () 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_Traffic * | Find (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 | |
| XWsfRouteNetwork & | operator= (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 |
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.
|
strong |
| XWsfOSM_Traffic::XWsfOSM_Traffic | ( | WsfOSM_TrafficInput & | aData | ) |
References WsfOSM_TrafficInput::WsfOSM_TrafficInput(), and WsfSimulationExtension::WsfSimulationExtension().
Referenced by Find(), operator=(), and XWsfOSM_Traffic().
|
override |
References WsfOSM_TrafficInput::mDebug.
|
delete |
References XWsfOSM_Traffic().
|
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().
| bool XWsfOSM_Traffic::AddScriptedConvoy | ( | const std::vector< WsfPlatform * > | aPlatformList, |
| const std::string & | aNetworkName, | ||
| WsfRoute * | aRoute, | ||
| double | aInitialSpacing ) |
| bool XWsfOSM_Traffic::AddScriptedVehicle | ( | WsfPlatform * | aPlatformPtr, |
| const std::string & | aNetworkName, | ||
| WsfRoute * | aRoute, | ||
| int & | aVehicleNumber ) |
References WsfRoute::Clone(), WsfPlatform::GetIndex(), WsfPlatform::GetMover(), WsfObject::GetName(), WsfSimulationExtension::GetSimulation(), WsfObject::GetType(), XWsfRouteNetwork::mNetworks, WsfOSM_TrafficInput::RoadTrafficNetworkInput::mRouteAuxDataMap, WsfOSM_TrafficInput::RoadTrafficNetworkInput::mVehicleInput, and WsfMover::SetRoute().
Referenced by AddScriptedConvoy(), and operator=().
| void XWsfOSM_Traffic::AdvanceTime | ( | double | aSimTime | ) |
Referenced by AddedToSimulation(), and operator=().
| bool XWsfOSM_Traffic::ChangeScriptedLane | ( | WsfPlatform * | aPlatformPtr, |
| bool | aDirection ) |
|
static |
Referenced by operator=().
|
static |
References WsfSimulation::FindExtension(), WsfSimulationExtension::WsfSimulation, and XWsfOSM_Traffic().
Referenced by operator=(), and UT_DEFINE_SCRIPT_METHOD().
| std::vector< WsfRoute * > XWsfOSM_Traffic::GetConnectedRoutes | ( | const std::string & | aNetworkName, |
| const std::string & | aNodeId ) |
References XWsfRouteNetwork::mNetworks.
Referenced by operator=().
| 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=().
| WsfWaypoint * XWsfOSM_Traffic::GetNextWaypoint | ( | const std::string & | aNetworkname, |
| const std::string & | aRouteName, | ||
| double | aDistance ) |
References WsfWaypoint::Clone(), and GetRoutesOnNetwork().
Referenced by operator=().
| std::string XWsfOSM_Traffic::GetNodeOnRoute | ( | const std::string & | aNetworkName, |
| const std::string & | aRouteName, | ||
| bool | aFirstOrLast ) |
References GetRoutesOnNetwork().
Referenced by operator=().
| std::vector< WsfPlatform * > XWsfOSM_Traffic::GetPlatformsAlongRoute | ( | const std::string & | aNetworkName, |
| const std::string & | aRouteName ) |
Referenced by operator=().
| std::vector< WsfRoute * > XWsfOSM_Traffic::GetRoutesOnNetwork | ( | const std::string & | aNetworkName | ) |
Referenced by GetIndividualRoute(), GetNextWaypoint(), GetNodeOnRoute(), and operator=().
| std::string XWsfOSM_Traffic::GetTrafficFlow | ( | double | aSimTime, |
| const std::string & | aNetworkName, | ||
| const std::string & | aNodeId ) |
Referenced by operator=().
|
overridevirtual |
Called in response to WsfSimulation::Initialize. This is called to allow the extension to perform any initialization that is required.
Reimplemented from WsfSimulationExtension.
References WsfSimulationExtension::GetScenario(), WsfSimulationExtension::GetSimulation(), XWsfRouteNetwork::Initialize(), WsfOSM_TrafficInput::RoadTrafficNetworkInput::mNetIndex, XWsfRouteNetwork::mNetworks, WsfOSM_TrafficInput::mProcessedInput, XWsfRouteNetwork::NetworkInput::mRouteNetworkPtr, and ok.
|
delete |
References AddScriptedConvoy(), AddScriptedVehicle(), AdvanceTime(), ChangeScriptedLane(), CreateScriptClass(), Find(), GetConnectedRoutes(), GetIndividualRoute(), GetNextWaypoint(), GetNodeOnRoute(), GetPlatformsAlongRoute(), GetRoutesOnNetwork(), GetTrafficFlow(), ScriptGoOffroad(), ScriptLockIntersection(), ScriptUnlockIntersection(), UpdateScriptedVehicleRoute(), WsfSimulationExtension::WsfSimulation, and XWsfOSM_Traffic().
| void XWsfOSM_Traffic::ScriptGoOffroad | ( | WsfPlatform * | aVehicle, |
| const WsfGeoPoint & | aGeoPoint ) |
| bool XWsfOSM_Traffic::ScriptLockIntersection | ( | const std::string & | aNetworkName, |
| const std::string & | aNodeId ) |
References XWsfRouteNetwork::mNetworks.
Referenced by operator=().
| bool XWsfOSM_Traffic::ScriptUnlockIntersection | ( | const std::string & | aNetworkName, |
| const std::string & | aNodeId ) |
References XWsfRouteNetwork::mNetworks.
Referenced by operator=().
| void XWsfOSM_Traffic::UpdateScriptedVehicleRoute | ( | WsfPlatform * | aPlatformPtr, |
| WsfRoute * | aRoute, | ||
| int | aWaypointIndex = 0 ) |
References WsfPlatform::GetMover(), WsfObject::GetName(), and WsfSimulationExtension::GetSimulation().
Referenced by operator=().