SUMO - Simulation of Urban MObility
|
A global update performer. More...
Public Member Functions | |
void | addRecognitionPoint (SUMOReal tEnd, const Position &thisPos, SUMOReal thisSpeed, const std::string &thisLaneID, SUMOReal thisLanePos, const std::string &otherID, const Position &otherPos, SUMOReal otherSpeed, const std::string &otherLaneID, SUMOReal otherLanePos, std::map< std::string, SeenDevice * > ¤tlySeen) |
Determines whether the other vehicle got visible until the given time. More... | |
BTreceiverUpdate () | |
Constructor. More... | |
void | enterRange (SUMOReal atOffset, const Position &thisPos, SUMOReal thisSpeed, const std::string &thisLaneID, SUMOReal thisLanePos, const std::string &otherID, const Position &otherPos, SUMOReal otherSpeed, const std::string &otherLaneID, SUMOReal otherLanePos, 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 (std::map< std::string, SeenDevice * > ¤tlySeen, std::map< std::string, std::vector< SeenDevice * > > &seen, const Position &thisPos, SUMOReal thisSpeed, const std::string &thisLaneID, SUMOReal thisLanePos, const std::string &otherID, const Position &otherPos, SUMOReal otherSpeed, const std::string &otherLaneID, SUMOReal otherLanePos, SUMOReal tOffset) |
Removes the sender from the currently seen devices to past episodes. More... | |
void | updateVisibility (VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender, const Position &receiverPos, const Position &receiverD) |
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 334 of file MSDevice_BTreceiver.h.
MSDevice_BTreceiver::BTreceiverUpdate::BTreceiverUpdate | ( | ) |
Constructor.
Definition at line 94 of file MSDevice_BTreceiver.cpp.
References MSEventControl::ADAPT_AFTER_EXECUTION, MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().
MSDevice_BTreceiver::BTreceiverUpdate::~BTreceiverUpdate | ( | ) |
Destructor.
Definition at line 99 of file MSDevice_BTreceiver.cpp.
References MSNet::getInstance(), MSDevice_BTsender::sVehicles, and MSDevice_BTreceiver::sVehicles.
void MSDevice_BTreceiver::BTreceiverUpdate::addRecognitionPoint | ( | SUMOReal | tEnd, |
const Position & | thisPos, | ||
SUMOReal | thisSpeed, | ||
const std::string & | thisLaneID, | ||
SUMOReal | thisLanePos, | ||
const std::string & | otherID, | ||
const Position & | otherPos, | ||
SUMOReal | otherSpeed, | ||
const std::string & | otherLaneID, | ||
SUMOReal | otherLanePos, | ||
std::map< std::string, SeenDevice * > & | currentlySeen | ||
) |
Determines whether the other vehicle got visible until the given time.
[in] | otherID | The ID of the other vehicle |
[in] | tEnd | The end of contact |
changed] | currentlySeen Contact information, updated if the sender was recognized |
[in] | thisPos | The receiver's position at the time |
[in] | thisSpeed | The receiver's speed at the time |
[in] | thisLaneID | The lane the observer was at |
[in] | thisLanePos | The position at the lane of the observer |
[in] | otherID | The ID of the entering sender |
[in] | otherPos | The position of the entering sender |
[in] | otherSpeed | The speed of the entering sender |
[in] | otherLaneID | The lane the sender was at |
[in] | otherLanePos | The position at the lane of the sender |
[in] | tOffset | The time offset to the current time step |
filled] | currentlySeen The contact information storage for saving the contact point |
Definition at line 306 of file MSDevice_BTreceiver.cpp.
References MTRand::rand(), MSDevice_BTreceiver::sRecognitionRNG, SUMOReal, and WRITE_WARNING.
void MSDevice_BTreceiver::BTreceiverUpdate::enterRange | ( | SUMOReal | atOffset, |
const Position & | thisPos, | ||
SUMOReal | thisSpeed, | ||
const std::string & | thisLaneID, | ||
SUMOReal | thisLanePos, | ||
const std::string & | otherID, | ||
const Position & | otherPos, | ||
SUMOReal | otherSpeed, | ||
const std::string & | otherLaneID, | ||
SUMOReal | otherLanePos, | ||
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] | thisPos | The receiver's position at the time |
[in] | thisSpeed | The receiver's speed at the time |
[in] | thisLaneID | The lane the observer was at |
[in] | thisLanePos | The position at the lane of the observer |
[in] | otherID | The ID of the entering sender |
[in] | otherPos | The position of the entering sender |
[in] | otherSpeed | The speed of the entering sender |
[in] | otherLaneID | The lane the sender was at |
[in] | otherLanePos | The position at the lane of the sender |
[in] | currentlySeen | The container storing episodes |
Definition at line 273 of file MSDevice_BTreceiver.cpp.
References MSNet::getInstance(), and STEPS2TIME.
Performs the update.
[in] | currentTime | The current simulation time |
Implements Command.
Definition at line 113 of file MSDevice_BTreceiver.cpp.
References MSDevice_BTreceiver::VehicleState::angle, DELTA_T, OptionsCont::getBool(), MSDevice_BTsender::VehicleInformation::getBoxBoundary(), MSDevice_BTreceiver::VehicleInformation::getBoxBoundary(), OptionsCont::getOptions(), Boundary::grow(), MSDevice_BTreceiver::VehicleInformation::haveArrived, NamedRTree::Insert(), OptionsCont::isSet(), M_PI, MSDevice_BTreceiver::VehicleState::position, MSDevice_BTreceiver::VehicleInformation::range, NamedRTree::Search(), MSDevice_BTreceiver::VehicleInformation::seen, MSDevice_BTreceiver::VehicleState::speed, SPEED2DIST, SUMOReal, MSDevice_BTsender::sVehicles, MSDevice_BTreceiver::sVehicles, Position::x(), Boundary::xmax(), Boundary::xmin(), Position::y(), Boundary::ymax(), and Boundary::ymin().
void MSDevice_BTreceiver::BTreceiverUpdate::leaveRange | ( | std::map< std::string, SeenDevice * > & | currentlySeen, |
std::map< std::string, std::vector< SeenDevice * > > & | seen, | ||
const Position & | thisPos, | ||
SUMOReal | thisSpeed, | ||
const std::string & | thisLaneID, | ||
SUMOReal | thisLanePos, | ||
const std::string & | otherID, | ||
const Position & | otherPos, | ||
SUMOReal | otherSpeed, | ||
const std::string & | otherLaneID, | ||
SUMOReal | otherLanePos, | ||
SUMOReal | tOffset | ||
) |
Removes the sender from the currently seen devices to past episodes.
[in] | currentlySeen | The currently seen devices |
[in] | seen | The lists of episodes to add this one to |
[in] | thisPos | The receiver's position at the time |
[in] | thisSpeed | The receiver's speed at the time |
[in] | thisLaneID | The lane the observer was at |
[in] | thisLanePos | The position at the lane of the observer |
[in] | otherID | The ID of the entering sender |
[in] | otherPos | The position of the entering sender |
[in] | otherSpeed | The speed of the entering sender |
[in] | otherLaneID | The lane the sender was at |
[in] | otherLanePos | The position at the lane of the sender |
[in] | tOffset | The time offset to the current time step |
[in] | remove | Whether the sender shall be removed from this device's myCurrentlySeen |
Definition at line 286 of file MSDevice_BTreceiver.cpp.
References MSNet::getInstance(), and STEPS2TIME.
void MSDevice_BTreceiver::BTreceiverUpdate::updateVisibility | ( | MSDevice_BTreceiver::VehicleInformation & | receiver, |
MSDevice_BTsender::VehicleInformation & | sender, | ||
const Position & | receiverPos, | ||
const Position & | receiverD | ||
) |
Rechecks the visibility for a given receiver/sender pair.
[in] | receiver | Definition of the receiver vehicle |
[in] | sender | Definition of the sender vehicle |
[in] | receiverPos | The initial receiver position |
[in] | receiverD | The direction vector of the receiver |
Definition at line 192 of file MSDevice_BTreceiver.cpp.
References MSDevice_BTsender::VehicleInformation::amOnNet, MSDevice_BTreceiver::VehicleInformation::amOnNet, MSDevice_BTreceiver::VehicleInformation::currentlySeen, Position::distanceTo(), GeomHelper::FindLineCircleIntersections(), Named::getID(), MSNet::getInstance(), M_PI, MSDevice_BTreceiver::VehicleInformation::range, MSDevice_BTreceiver::VehicleInformation::seen, SPEED2DIST, STEPS2TIME, SUMOReal, MSDevice_BTsender::VehicleInformation::updates, MSDevice_BTreceiver::VehicleInformation::updates, WRITE_WARNING, Position::x(), and Position::y().
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 324 of file MSDevice_BTreceiver.cpp.
References OutputDevice::closeTag(), OutputDevice::getDeviceByOption(), OutputDevice::openTag(), and OutputDevice::writeAttr().