Eclipse SUMO - Simulation of Urban MObility
MSDevice_BTreceiver::BTreceiverUpdate Class Reference

A global update performer. More...

#include <MSDevice_BTreceiver.h>

Inheritance diagram for MSDevice_BTreceiver::BTreceiverUpdate:
[legend]
Collaboration diagram for MSDevice_BTreceiver::BTreceiverUpdate:
[legend]

Public Member Functions

void addRecognitionPoint (const double tEnd, const MSDevice_BTsender::VehicleState &receiverState, const MSDevice_BTsender::VehicleState &senderState, SeenDevice *senderDevice) const
 Adds a point of recognition. More...
 
 BTreceiverUpdate ()
 Constructor. More...
 
void enterRange (double atOffset, const MSDevice_BTsender::VehicleState &receiverState, const std::string &senderID, const MSDevice_BTsender::VehicleState &senderState, std::map< std::string, SeenDevice * > &currentlySeen)
 Informs the receiver about a sender entering it's radius. More...
 
SUMOTime execute (SUMOTime currentTime)
 Performs the update. More...
 
void leaveRange (VehicleInformation &receiverInfo, const MSDevice_BTsender::VehicleState &receiverState, MSDevice_BTsender::VehicleInformation &senderInfo, const MSDevice_BTsender::VehicleState &senderState, double tOffset)
 Removes the sender from the currently seen devices to past episodes. More...
 
virtual SUMOTime shiftTime (SUMOTime, SUMOTime, SUMOTime)
 Reschedule or deschedule the command when quick-loading state. More...
 
void updateVisibility (VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender)
 Rechecks the visibility for a given receiver/sender pair. More...
 
void writeOutput (const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions)
 Writes the output. More...
 
 ~BTreceiverUpdate ()
 Destructor. More...
 

Data Fields

int priority = 0
 

Detailed Description

A global update performer.

Definition at line 274 of file MSDevice_BTreceiver.h.

Constructor & Destructor Documentation

◆ BTreceiverUpdate()

MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate ( )

◆ ~BTreceiverUpdate()

MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate ( )

Member Function Documentation

◆ addRecognitionPoint()

void MSDevice_BTreceiver::BTreceiverUpdate::addRecognitionPoint ( const double  tEnd,
const MSDevice_BTsender::VehicleState receiverState,
const MSDevice_BTsender::VehicleState senderState,
SeenDevice senderDevice 
) const

Adds a point of recognition.

Parameters
[in]tEndThe time of the recognition
[in]receiverStateThe position, speed, lane etc. the observer had at the time
[in]senderStateThe position, speed, lane etc. the seen vehicle had at the time
[in]senderDeviceThe device of the entering sender

Definition at line 337 of file MSDevice_BTreceiver.cpp.

References MSDevice_BTreceiver::inquiryDelaySlots(), MSDevice_BTreceiver::SeenDevice::lastView, MSDevice_BTreceiver::myOffTime, MSDevice_BTreceiver::SeenDevice::nextView, and MSDevice_BTreceiver::SeenDevice::recognitionPoints.

◆ enterRange()

void MSDevice_BTreceiver::BTreceiverUpdate::enterRange ( double  atOffset,
const MSDevice_BTsender::VehicleState receiverState,
const std::string &  senderID,
const MSDevice_BTsender::VehicleState senderState,
std::map< std::string, SeenDevice * > &  currentlySeen 
)

Informs the receiver about a sender entering it's radius.

Parameters
[in]atOffsetThe time offset to the current time step
[in]receiverStateThe position, speed, lane etc. the observer had at the time
[in]senderIDThe ID of the entering sender
[in]senderStateThe position, speed, lane etc. the seen vehicle had at the time
[in]currentlySeenThe container storing episodes

Definition at line 306 of file MSDevice_BTreceiver.cpp.

References sd, and SIMTIME.

◆ execute()

◆ leaveRange()

void MSDevice_BTreceiver::BTreceiverUpdate::leaveRange ( VehicleInformation receiverInfo,
const MSDevice_BTsender::VehicleState receiverState,
MSDevice_BTsender::VehicleInformation senderInfo,
const MSDevice_BTsender::VehicleState senderState,
double  tOffset 
)

Removes the sender from the currently seen devices to past episodes.

Parameters
[in]receiverInfoThe static information of the observer (id, route, etc.)
[in]receiverStateThe position, speed, lane etc. the observer had at the time
[in]senderInfoThe static information of the seen vehicle (id, route, etc.)
[in]senderStateThe position, speed, lane etc. the seen vehicle had at the time
[in]tOffsetThe time offset to the current time step

Definition at line 317 of file MSDevice_BTreceiver.cpp.

References MSDevice_BTreceiver::VehicleInformation::currentlySeen, Named::getID(), MSNet::getInstance(), MSDevice_BTsender::VehicleInformation::route, MSDevice_BTsender::VehicleState::routePos, MSDevice_BTreceiver::VehicleInformation::seen, SIMTIME, and STEPS2TIME.

◆ shiftTime()

virtual SUMOTime Command::shiftTime ( SUMOTime  ,
SUMOTime  ,
SUMOTime   
)
inlinevirtualinherited

Reschedule or deschedule the command when quick-loading state.

The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.

Parameters
[in]currentTimeThe current simulation time
[in]execTimeThe time at which the command would have been executed
[in]newTimeThe simulation time at which the simulation is restarted
Returns
The time at which the command shall be executed again

Reimplemented in MSCalibrator::CalibratorCommand, and MSTrafficLightLogic::SwitchCommand.

Definition at line 83 of file Command.h.

◆ updateVisibility()

void MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility ( MSDevice_BTreceiver::VehicleInformation receiver,
MSDevice_BTsender::VehicleInformation sender 
)

◆ writeOutput()

void MSDevice_BTreceiver::BTreceiverUpdate::writeOutput ( const std::string &  id,
const std::map< std::string, std::vector< SeenDevice * > > &  seen,
bool  allRecognitions 
)

Writes the output.

Parameters
[in]idThe id of the receiver
[in]seenThe information about seen senders
[in]allRecognitionsWhether all recognitions shall be written

Definition at line 353 of file MSDevice_BTreceiver.cpp.

References OutputDevice::closeTag(), OutputDevice::getDeviceByOption(), MSDevice_BTsender::VehicleState::laneID, MSDevice_BTsender::VehicleState::lanePos, OutputDevice::openTag(), MSDevice_BTsender::VehicleState::position, MSDevice_BTsender::VehicleState::speed, and OutputDevice::writeAttr().

Field Documentation

◆ priority

int Command::priority = 0
inherited

The documentation for this class was generated from the following files: