 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
17 #ifndef MSDevice_BTreceiver_h
18 #define MSDevice_BTreceiver_h
219 static void cleanUp(std::map<std::string, SeenDevice*>& c, std::map<std::string, std::vector<SeenDevice*> >& s);
257 std::map<std::string, SeenDevice*>::iterator i;
261 std::map<std::string, std::vector<SeenDevice*> >::iterator j;
262 std::vector<SeenDevice*>::iterator k;
263 for (j =
seen.begin(); j !=
seen.end(); j++) {
264 for (k = j->second.begin(); k != j->second.end(); k++) {
277 std::map<std::string, std::vector<SeenDevice*> >
seen;
324 std::map<std::string, SeenDevice*>& currentlySeen);
357 void writeOutput(
const std::string&
id,
const std::map<std::string, std::vector<SeenDevice*> >& seen,
358 bool allRecognitions);
372 static std::map<std::string, VehicleInformation*>
sVehicles;
SeenDevice(const MeetingPoint &meetingBegin_)
Constructor.
Representation of a vehicle or person.
MeetingPoint * meetingEnd
Description of the meeting's end.
static void cleanUp(std::map< std::string, SeenDevice * > &c, std::map< std::string, std::vector< SeenDevice * > > &s)
Clears the given containers deleting the stored items.
Representation of a lane in the micro simulation.
static double inquiryDelaySlots(const int backoffLimit)
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, Notification reason, const MSLane *enteredLane=0)
Moves (the known) vehicle from running to arrived vehicles' list.
SUMOTime execute(SUMOTime currentTime)
Performs the update.
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0)
Adds the vehicle to running vehicles if it (re-) enters the network.
double lastView
Last recognition point.
Class representing a single seen device.
static std::map< std::string, VehicleInformation * > sVehicles
The list of arrived receivers.
double nextView
Next possible recognition point.
MSDevice_BTreceiver & operator=(const MSDevice_BTreceiver &)
Invalidated assignment operator.
static bool myWasInitialised
Whether the bt-system was already initialised.
const MSDevice_BTsender::VehicleState observerState
The state the observer had at the time.
const MeetingPoint meetingBegin
Description of the meeting's begin.
Representation of a vehicle.
~MeetingPoint()
Destructor.
static std::mt19937 sRecognitionRNG
A random number generator used to determine whether the opposite was recognized.
const MSDevice_BTsender::VehicleState seenState
The state the seen vehicle had at the time.
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.
MSDevice_BTreceiver(SUMOVehicle &holder, const std::string &id)
Constructor.
static double getRange()
Returns the configured range.
SeenDevice & operator=(const SeenDevice &)
Invalidated assignment operator.
A storage for options typed value containers)
const std::string deviceName() const
return the name for this type of device
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.
static std::mt19937 * getRNG()
void addRecognitionPoint(const double tEnd, const MSDevice_BTsender::VehicleState &receiverState, const MSDevice_BTsender::VehicleState &senderState, SeenDevice *senderDevice) const
Adds a point of recognition.
const double t
The time of the meeting.
Holds the information about exact positions/speeds/time of the begin/end of a meeting.
std::string senderRoute
string of travelled sender edges
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
~MSDevice_BTreceiver()
Destructor.
A global update performer.
Base (microsim) event class.
MeetingPoint(double _t, const MSDevice_BTsender::VehicleState &_observerState, const MSDevice_BTsender::VehicleState &_seenState)
Constructor.
BTreceiverUpdate()
Constructor.
void updateVisibility(VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender)
Rechecks the visibility for a given receiver/sender pair.
std::string receiverRoute
string of travelled receiver edges
~BTreceiverUpdate()
Destructor.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
static double myRange
The range of the device.
Notification
Definition of a vehicle state.
A single movement state of the vehicle.
std::vector< MeetingPoint * > recognitionPoints
List of recognition points.
MeetingPoint & operator=(const MeetingPoint &)
Invalidated assignment operator.
static double myOffTime
The offtime of the device.
void writeOutput(const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions)
Writes the output.
Abstract in-vehicle device.