Eclipse SUMO - Simulation of Urban MObility
|
A global update performer. More...
#include <MSDevice_BTreceiver.h>
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. | |
BTreceiverUpdate () | |
Constructor. | |
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. | |
SUMOTime | execute (SUMOTime currentTime) |
Performs the update. | |
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. | |
virtual SUMOTime | shiftTime (SUMOTime, SUMOTime, SUMOTime) |
Reschedule or deschedule the command when quick-loading state. | |
void | updateVisibility (VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender) |
Rechecks the visibility for a given receiver/sender pair. | |
void | writeOutput (const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions) |
Writes the output. | |
~BTreceiverUpdate () | |
Destructor. | |
Data Fields | |
int | priority = 0 |
A global update performer.
Definition at line 274 of file MSDevice_BTreceiver.h.
MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate | ( | ) |
Constructor.
Definition at line 121 of file MSDevice_BTreceiver.cpp.
References MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().
MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate | ( | ) |
Destructor.
Definition at line 126 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 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.
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 306 of file MSDevice_BTreceiver.cpp.
Performs the update.
[in] | currentTime | The current simulation time |
Implements Command.
Definition at line 140 of file MSDevice_BTreceiver.cpp.
References DELTA_T, OptionsCont::getBool(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), MSTransportable::getCurrentStageType(), MSTransportable::getDevice(), MSTransportable::getEdge(), Named::getID(), MSNet::getInstance(), OptionsCont::getOptions(), MSNet::getPersonControl(), MSTransportable::getPositionOnLane(), MSTransportable::getSpeed(), Boundary::grow(), MSDevice_BTsender::VehicleInformation::haveArrived, NamedRTree::Insert(), OptionsCont::isSet(), MSTransportableControl::loadedBegin(), MSTransportableControl::loadedEnd(), MSDevice_BTreceiver::myHasPersons, MSDevice_BTreceiver::notifyMove(), MSDevice_BTsender::notifyMove(), MSDevice_BTreceiver::VehicleInformation::range, NamedRTree::Search(), MSDevice_BTreceiver::VehicleInformation::seen, MSDevice_BTreceiver::sVehicles, MSDevice_BTsender::sVehicles, MSDevice_BTsender::VehicleInformation::updates, WAITING_FOR_DEPART, 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 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.
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.
[in] | currentTime | The current simulation time |
[in] | execTime | The time at which the command would have been executed |
[in] | newTime | The simulation time at which the simulation is restarted |
Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.
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 230 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, TL, TS, MSDevice_BTsender::VehicleInformation::updates, WRITE_WARNING, and WRITE_WARNINGF.
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 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().
|
inherited |
Definition at line 87 of file Command.h.
Referenced by MSTransportableDevice_FCDReplay::MovePedestrians::MovePedestrians(), and MSTrafficLightLogic::SwitchCommand::SwitchCommand().