![]() |
Eclipse SUMO - Simulation of Urban MObility
|
A global update performer. More...
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 * > ¤tlySeen) |
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... | |
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... | |
A global update performer.
Definition at line 293 of file MSDevice_BTreceiver.h.
MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate | ( | ) |
Constructor.
Definition at line 93 of file MSDevice_BTreceiver.cpp.
References MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().
MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate | ( | ) |
Destructor.
Definition at line 98 of file MSDevice_BTreceiver.cpp.
References MSNet::getInstance(), MSDevice_BTreceiver::sVehicles, and MSDevice_BTsender::sVehicles.
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.
[in] | tEnd | The time of the recognition |
[in] | receiverState | The position, speed, lane etc. the observer had at the time |
[in] | senderState | The position, speed, lane etc. the seen vehicle had at the time |
[in] | senderDevice | The device of the entering sender |
Definition at line 314 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.
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.
[in] | atOffset | The time offset to the current time step |
[in] | receiverState | The position, speed, lane etc. the observer had at the time |
[in] | senderID | The ID of the entering sender |
[in] | senderState | The position, speed, lane etc. the seen vehicle had at the time |
[in] | currentlySeen | The container storing episodes |
Definition at line 254 of file MSDevice_BTreceiver.cpp.
Performs the update.
[in] | currentTime | The current simulation time |
Implements Command.
Definition at line 112 of file MSDevice_BTreceiver.cpp.
References DELTA_T, OptionsCont::getBool(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), OptionsCont::getOptions(), Boundary::grow(), MSDevice_BTsender::VehicleInformation::haveArrived, NamedRTree::Insert(), OptionsCont::isSet(), POSITION_EPS, MSDevice_BTreceiver::VehicleInformation::range, NamedRTree::Search(), MSDevice_BTreceiver::VehicleInformation::seen, MSDevice_BTreceiver::sVehicles, MSDevice_BTsender::sVehicles, MSDevice_BTsender::VehicleInformation::updates, Boundary::xmax(), Boundary::xmin(), Boundary::ymax(), and Boundary::ymin().
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.
[in] | receiverInfo | The static information of the observer (id, route, etc.) |
[in] | receiverState | The position, speed, lane etc. the observer had at the time |
[in] | senderInfo | The static information of the seen vehicle (id, route, etc.) |
[in] | senderState | The position, speed, lane etc. the seen vehicle had at the time |
[in] | tOffset | The time offset to the current time step |
Definition at line 265 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.
void MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility | ( | MSDevice_BTreceiver::VehicleInformation & | receiver, |
MSDevice_BTsender::VehicleInformation & | sender | ||
) |
Rechecks the visibility for a given receiver/sender pair.
[in] | receiver | Definition of the receiver vehicle |
[in] | sender | Definition of the sender vehicle |
Definition at line 178 of file MSDevice_BTreceiver.cpp.
References MSDevice_BTsender::VehicleInformation::amOnNet, MSDevice_BTreceiver::VehicleInformation::currentlySeen, Position::distanceTo(), GeomHelper::findLineCircleIntersections(), Named::getID(), MSDevice_BTsender::VehicleState::position, MSDevice_BTreceiver::VehicleInformation::range, SIMTIME, TS, MSDevice_BTsender::VehicleInformation::updates, and WRITE_WARNING.
void MSDevice_BTreceiver::BTreceiverUpdate::writeOutput | ( | const std::string & | id, |
const std::map< std::string, std::vector< SeenDevice * > > & | seen, | ||
bool | allRecognitions | ||
) |
Writes the output.
[in] | id | The id of the receiver |
[in] | seen | The information about seen senders |
[in] | allRecognitions | Whether all recognitions shall be written |
Definition at line 330 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().