WSF
XWsfSeaTraffic Class Reference

#include <XWsfSeaTraffic.hpp>

Inheritance diagram for XWsfSeaTraffic:
Collaboration diagram for XWsfSeaTraffic:

Classes

class  SeaRegion
class  SeaPort
class  SeaLane
class  Vehicle
class  DepartureEvent
class  ExitLoiterEvent

Public Member Functions

 XWsfSeaTraffic ()
 XWsfSeaTraffic (const XWsfSeaTraffic &aSrc, WsfSimulation *aSimPtr)
virtual XWsfSeaTrafficClone () const
 ~XWsfSeaTraffic () override
virtual bool ProcessInput (UtInput &aInput)
bool Initialize () override
void HandleDeparture (WsfStringId aPortId, double aSimTime)
void HandleEnterLoiter (WsfPlatform *aPlatformPtr, double aSimTime)
void GetSeaLaneIds (WsfStringId aPortId, std::vector< WsfStringId > &aLaneIds)
bool DoesPortExist (WsfStringId aNameId) const
bool DoesLaneExist (WsfStringId aNameId) const
bool DoesDepVehicleExist (WsfStringId aTypeId) const
bool DoesLocVehicleExist (WsfStringId aTypeId) const
SeaPortGetSeaPort (WsfStringId aNameId)
SeaLaneGetSeaLane (WsfStringId aNameId)
VehicleGetDepVehicle (WsfStringId aTypeId)
VehicleGetLocVehicle (WsfStringId aTypeId)
Public Member Functions inherited from WsfSimulationExtension
 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
virtual void AddedToSimulation ()
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

Static Public Attributes

static const double cEPSILON

Friends

class XWsfSeaTrafficExtension

Additional Inherited Members

static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)
Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)

Detailed Description

XWsfSeaTraffic provides the ability to create sea based background traffic. It uses an input syntax defined by the sea_traffic ... end_sea_traffic input block, which is described in the WSF User Input Guide.

Constructor & Destructor Documentation

◆ XWsfSeaTraffic() [1/2]

XWsfSeaTraffic::XWsfSeaTraffic ( )

◆ XWsfSeaTraffic() [2/2]

◆ ~XWsfSeaTraffic()

XWsfSeaTraffic::~XWsfSeaTraffic ( )
override

The XWsfSeaTraffic destructor. Cleans up the port, lane, and vehicle data.

Member Function Documentation

◆ Clone()

XWsfSeaTraffic * XWsfSeaTraffic::Clone ( ) const
virtual

References XWsfSeaTraffic().

Referenced by XWsfSeaTraffic().

◆ DoesDepVehicleExist()

bool XWsfSeaTraffic::DoesDepVehicleExist ( WsfStringId aTypeId) const
inline

Returns true if the specified departure vehicle exits. aTypeId: The string id of the vehicle type.

◆ DoesLaneExist()

bool XWsfSeaTraffic::DoesLaneExist ( WsfStringId aNameId) const
inline

Returns true if the specified lane exits. aNameId: The string id of the lane name.

Referenced by XWsfSeaTraffic::SeaPort::Initialize().

◆ DoesLocVehicleExist()

bool XWsfSeaTraffic::DoesLocVehicleExist ( WsfStringId aTypeId) const
inline

Returns true if the specified local vehicle exits. aTypeId: The string id of the vehicle type.

◆ DoesPortExist()

bool XWsfSeaTraffic::DoesPortExist ( WsfStringId aNameId) const
inline

Returns true if the specified port exits. aNameId: The string id of the port name.

Referenced by XWsfSeaTraffic::SeaLane::Initialize().

◆ GetDepVehicle()

Vehicle * XWsfSeaTraffic::GetDepVehicle ( WsfStringId aTypeId)
inline

Returns a pointer to the specified departure vehicle. aTypeId: The string id of the vehicle type.

◆ GetLocVehicle()

Vehicle * XWsfSeaTraffic::GetLocVehicle ( WsfStringId aTypeId)
inline

Returns a pointer to the specified local vehicle. aTypeId: The string id of the vehicle type.

◆ GetSeaLane()

SeaLane * XWsfSeaTraffic::GetSeaLane ( WsfStringId aNameId)
inline

Returns a pointer to the specified lane. aNameId: The string id of the lane name.

Referenced by XWsfSeaTraffic::SeaPort::Initialize().

◆ GetSeaLaneIds()

void XWsfSeaTraffic::GetSeaLaneIds ( WsfStringId aPortId,
std::vector< WsfStringId > & aLaneIds )

Returns the list of sea lanes that have the given port as one of the endpoints. aPortId: The port's name as a string id. aLaneIds: The returned list of sea lane string ids.

Referenced by XWsfSeaTraffic::SeaPort::Initialize(), and XWsfSeaTraffic().

◆ GetSeaPort()

SeaPort * XWsfSeaTraffic::GetSeaPort ( WsfStringId aNameId)
inline

Returns a pointer to the specified port. aNameId: The string id of the port name.

Referenced by XWsfSeaTraffic::SeaPort::Initialize().

◆ HandleDeparture()

void XWsfSeaTraffic::HandleDeparture ( WsfStringId aPortId,
double aSimTime )

Creates a vehicle that departs the given port at the current simulation time. Each call to HandleDeparture schedules another event, which calls Departure again at aSimTime + "the port's departure interval". This guarantees a vehicle will depart a given port at its defined departure interval. aPortId: The port's name as a string id. aSimTime: The current simulation time.

References WsfSimulation::AddEvent(), WsfSimulation::GetRandom(), WsfSimulationExtension::GetSimulation(), XWsfSeaTraffic::SeaPort::mDepartureInterval, and success.

Referenced by XWsfSeaTraffic().

◆ HandleEnterLoiter()

void XWsfSeaTraffic::HandleEnterLoiter ( WsfPlatform * aPlatformPtr,
double aSimTime )

When a platform enters a loiter pattern an 'ExitLoiter' event is scheduled some time in the future to break it out of its loiter pattern. The loiter time is calculated based on the platform's type, which is mapped to the data entered in the input file. aPlatformPtr: A pointer to the simulation platform. aSimTime: The current simulation time.

References WsfSimulation::AddEvent(), WsfObject::GetNameId(), WsfSimulationExtension::GetSimulation(), and WsfObject::GetTypeId().

Referenced by XWsfSeaTraffic().

◆ Initialize()

bool XWsfSeaTraffic::Initialize ( )
overridevirtual

Initializes anything that cannot be determined during the ProcessInput stage and checks for errors. Returns true if successful. aInput: the input object.

Reimplemented from WsfSimulationExtension.

References success.

◆ ProcessInput()

bool XWsfSeaTraffic::ProcessInput ( UtInput & aInput)
virtual

Processes the input object passed from the simulation via the input processor. XWsfSeaTraffic handles the sea_traffic input block. If a different input block is encountered false is returned. Throws an input exception if an error is encountered. Returns true if successful. aInput: The input object.

Referenced by XWsfSeaTraffic().

◆ XWsfSeaTrafficExtension

friend class XWsfSeaTrafficExtension
friend

Member Data Documentation

◆ cEPSILON

const double XWsfSeaTraffic::cEPSILON
static

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