15#ifndef XWSFROADTRAFFIC_HPP
16#define XWSFROADTRAFFIC_HPP
18#include "wsf_export.h"
24#include "UtCallbackHolder.hpp"
25#include "UtRandom.hpp"
55 void AdvanceTime(
double aSimTime);
173 NetworkInput::VerifyData(aInput);
176 std::vector<VehicleInput>::iterator vehItr;
179 sum += vehItr->mFraction;
181 if (fabs(1.0 - sum) > 10E-3)
183 throw UtInput::BadValue(aInput,
"XWsfRoadTraffic the sum of all the vehicle 'fraction' values must be 1.0");
248 void AddPlatformToSimulation(
double aSimTime,
int aVehicleNumber);
263 void ClearVehicleList();
267 bool CreateConvoyVehicle(
WsfStringId aVehicleType,
int& aVehicleNumber);
269 void DeletePlatformFromSimulation(
double aSimTime,
int aVehicleNumber);
271 void ReverseVehicleRoute(
int aVehicleNumber,
double aSimTime);
280 UtCallbackHolder mCallbacks;
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfMover.hpp:37
Definition WsfRoadMover.hpp:32
A collection of WsfRoute object that represents a connected network (such as a road network).
Definition WsfRouteNetwork.hpp:40
A collection of WsfWaypoint objects that represent a path to be followed.
Definition WsfRoute.hpp:40
const WsfScenario & GetScenario() const
Definition WsfSimulationExtension.cpp:31
WsfSimulationExtension()
Definition WsfSimulationExtension.cpp:23
virtual bool Initialize()
Definition WsfSimulationExtension.cpp:49
Definition WsfWaypoint.hpp:57
double mSegmentWeight
Definition XWsfRoadTraffic.hpp:146
bool operator<(const WeightedRouteSegment &aSegment) const
Definition XWsfRoadTraffic.hpp:155
double mCumulativeWeight
Definition XWsfRoadTraffic.hpp:147
WeightedRouteSegment()=default
double mNode2Weight
Definition XWsfRoadTraffic.hpp:145
WeightedRouteSegment(WsfRoute *aRoutePtr, const WsfWaypoint &aNode1, const WsfWaypoint &aNode2)
Definition XWsfRoadTraffic.hpp:134
WsfRoute * mRoutePtr
Definition XWsfRoadTraffic.hpp:141
WsfWaypoint mNode2
Definition XWsfRoadTraffic.hpp:143
WsfWaypoint mNode1
Definition XWsfRoadTraffic.hpp:142
double mNode1Weight
Definition XWsfRoadTraffic.hpp:144
bool operator==(double aWeight) const
Equal if the provided weight is enclosed by this segment's boundary weights.
Definition XWsfRoadTraffic.hpp:150
Definition XWsfRoadTraffic.hpp:42
XWsfRoadTraffic & operator=(const XWsfRoadTraffic &aRhs)=delete
EndOfPath
Definition XWsfRoadTraffic.hpp:208
@ cRESPAWN
Definition XWsfRoadTraffic.hpp:209
@ cREVERSE_DIRECTION
Definition XWsfRoadTraffic.hpp:210
XWsfRoadTraffic(const Data &aData)
Definition XWsfRoadTraffic.hpp:46
XWsfRoadTraffic(const XWsfRoadTraffic &aSrc)=delete
Copy constructor and assignment operator are declared but not defined in order to prevent use.
XWsfRouteNetwork()=default
virtual bool ProcessCommand(UtInput &aInput, NetworkInput &aNetworkInput)
Definition XWsfRouteNetwork.cpp:110
Networks mNetworks
Definition XWsfRouteNetwork.hpp:104
std::vector< ut::CloneablePtr< NetworkInput > > Networks
Definition XWsfRouteNetwork.hpp:101
Holds the data for XWsfRoadTraffic populated during the ProcessInput phase.
Definition XWsfRoadTraffic.hpp:215
const Networks & GetNetworks() const
Definition XWsfRoadTraffic.hpp:233
bool mVerbose
Definition XWsfRoadTraffic.hpp:218
Networks & GetNetworks()
Definition XWsfRoadTraffic.hpp:230
std::vector< SGroundTraffic > mTraffic
Definition XWsfRoadTraffic.hpp:221
bool mProcessedInput
Definition XWsfRoadTraffic.hpp:216
bool mDebug
Definition XWsfRoadTraffic.hpp:217
EndOfPath mEndOfPathOption
Definition XWsfRoadTraffic.hpp:219
int mNumVehiclesActive
Definition XWsfRoadTraffic.hpp:225
int mMaxVehiclesActive
Definition XWsfRoadTraffic.hpp:226
double mNextUpdateTime
Definition XWsfRoadTraffic.hpp:222
int mNextVehicleIdentifier
Definition XWsfRoadTraffic.hpp:224
Definition XWsfRoadTraffic.hpp:60
double mRouteDist
Index value of network vehicle is traveling on.
Definition XWsfRoadTraffic.hpp:67
double mSpeed
The length of the path (meters).
Definition XWsfRoadTraffic.hpp:68
WsfPlatform * mRoadPlatform
Time vehicle starts moving off the road (sec).
Definition XWsfRoadTraffic.hpp:73
bool mStationary
Is this vehicle now off-road?
Definition XWsfRoadTraffic.hpp:65
int mIdentifier
Definition XWsfRoadTraffic.hpp:61
double mOffRoadTime
Time vehicle stops moving and is removed (sec).
Definition XWsfRoadTraffic.hpp:72
size_t mRoadPlatformIndex
Definition XWsfRoadTraffic.hpp:74
double mDeadTime
Time vehicle starts moving (sec).
Definition XWsfRoadTraffic.hpp:71
int mNetwork
Is this vehicle stationary?
Definition XWsfRoadTraffic.hpp:66
bool mVehicleOffRoad
Is this vehicle alive?
Definition XWsfRoadTraffic.hpp:64
bool mConvoyVehicle
Definition XWsfRoadTraffic.hpp:75
bool mAlive
Vehicle type.
Definition XWsfRoadTraffic.hpp:63
double mStartTime
Amount of time vehicle is moving along road (sec).
Definition XWsfRoadTraffic.hpp:70
WsfStringId mVehicleTypeId
Unique identifier for ground vehicle.
Definition XWsfRoadTraffic.hpp:62
double mTravelTime
Speed (meters/sec).
Definition XWsfRoadTraffic.hpp:69