|
WSF
|
#include <XWsfSeaTraffic.hpp>


Classes | |
| class | SeaRegion |
| class | SeaPort |
| class | SeaLane |
| class | Vehicle |
| class | DepartureEvent |
| class | ExitLoiterEvent |
Public Member Functions | |
| XWsfSeaTraffic () | |
| XWsfSeaTraffic (const XWsfSeaTraffic &aSrc, WsfSimulation *aSimPtr) | |
| virtual XWsfSeaTraffic * | Clone () 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 |
| SeaPort * | GetSeaPort (WsfStringId aNameId) |
| SeaLane * | GetSeaLane (WsfStringId aNameId) |
| Vehicle * | GetDepVehicle (WsfStringId aTypeId) |
| Vehicle * | GetLocVehicle (WsfStringId aTypeId) |
| Public Member Functions inherited from WsfSimulationExtension | |
| WsfSimulationExtension () | |
| ~WsfSimulationExtension () override=default | |
| WsfSimulation & | GetSimulation () const |
| const WsfScenario & | GetScenario () 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) |
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.
| XWsfSeaTraffic::XWsfSeaTraffic | ( | ) |
The XWsfSeaTraffic constructor aSimulation: The simulation that the sea traffic simulation will participate in.
Referenced by Clone(), XWsfSeaTraffic::DepartureEvent::DepartureEvent(), XWsfSeaTraffic::SeaLane::Initialize(), XWsfSeaTraffic::SeaPort::Initialize(), XWsfSeaTraffic::Vehicle::Initialize(), XWsfSeaTraffic(), and XWsfSeaTrafficExtension.
| XWsfSeaTraffic::XWsfSeaTraffic | ( | const XWsfSeaTraffic & | aSrc, |
| WsfSimulation * | aSimPtr ) |
|
override |
The XWsfSeaTraffic destructor. Cleans up the port, lane, and vehicle data.
|
virtual |
References XWsfSeaTraffic().
Referenced by XWsfSeaTraffic().
|
inline |
Returns true if the specified departure vehicle exits. aTypeId: The string id of the vehicle type.
|
inline |
Returns true if the specified lane exits. aNameId: The string id of the lane name.
Referenced by XWsfSeaTraffic::SeaPort::Initialize().
|
inline |
Returns true if the specified local vehicle exits. aTypeId: The string id of the vehicle type.
|
inline |
Returns true if the specified port exits. aNameId: The string id of the port name.
Referenced by XWsfSeaTraffic::SeaLane::Initialize().
|
inline |
Returns a pointer to the specified departure vehicle. aTypeId: The string id of the vehicle type.
|
inline |
Returns a pointer to the specified local vehicle. aTypeId: The string id of the vehicle type.
|
inline |
Returns a pointer to the specified lane. aNameId: The string id of the lane name.
Referenced by XWsfSeaTraffic::SeaPort::Initialize().
| 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().
|
inline |
Returns a pointer to the specified port. aNameId: The string id of the port name.
Referenced by XWsfSeaTraffic::SeaPort::Initialize().
| 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().
| 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().
|
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.
|
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().
|
friend |
References XWsfSeaTraffic(), and XWsfSeaTrafficExtension.
Referenced by XWsfSeaTrafficExtension.
|
static |
Referenced by XWsfSeaTraffic::SeaPort::Initialize().