193 static void cleanUp(std::map<std::string, SeenDevice*>& c, std::map<std::string, std::vector<SeenDevice*> >& s);
238 std::map<std::string, SeenDevice*>::iterator i;
242 std::map<std::string, std::vector<SeenDevice*> >::iterator j;
243 std::vector<SeenDevice*>::iterator k;
244 for (j =
seen.begin(); j !=
seen.end(); j++) {
245 for (k = j->second.begin(); k != j->second.end(); k++) {
258 std::map<std::string, std::vector<SeenDevice*> >
seen;
305 std::map<std::string, SeenDevice*>& currentlySeen);
338 void writeOutput(
const std::string&
id,
const std::map<std::string, std::vector<SeenDevice*> >& seen,
339 bool allRecognitions);
353 static std::map<std::string, VehicleInformation*>
sVehicles;
Base (microsim) event class.
A global update performer.
~BTreceiverUpdate()
Destructor.
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.
void writeOutput(const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions)
Writes the output.
void addRecognitionPoint(const double tEnd, const MSDevice_BTsender::VehicleState &receiverState, const MSDevice_BTsender::VehicleState &senderState, SeenDevice *senderDevice) const
Adds a point of recognition.
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.
void updateVisibility(VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender)
Rechecks the visibility for a given receiver/sender pair.
BTreceiverUpdate()
Constructor.
SUMOTime execute(SUMOTime currentTime)
Performs the update.
Holds the information about exact positions/speeds/time of the begin/end of a meeting.
const MSDevice_BTsender::VehicleState seenState
The state the seen vehicle had at the time.
~MeetingPoint()
Destructor.
MeetingPoint & operator=(const MeetingPoint &)=delete
Invalidated assignment operator.
const double t
The time of the meeting.
MeetingPoint(double _t, const MSDevice_BTsender::VehicleState &_observerState, const MSDevice_BTsender::VehicleState &_seenState)
Constructor.
const MSDevice_BTsender::VehicleState observerState
The state the observer had at the time.
Class representing a single seen device.
std::string receiverRoute
string of travelled receiver edges
std::string senderRoute
string of travelled sender edges
SeenDevice(const MeetingPoint &meetingBegin_)
Constructor.
MeetingPoint * meetingEnd
Description of the meeting's end.
SeenDevice & operator=(const SeenDevice &)
Invalidated assignment operator.
double nextView
Next possible recognition point.
const MeetingPoint meetingBegin
Description of the meeting's begin.
double lastView
Last recognition point.
std::vector< MeetingPoint * > recognitionPoints
List of recognition points.
MSDevice_BTreceiver()
Constructor.
static double getRange()
Returns the configured range.
static bool myWasInitialised
Whether the bt-system was already initialised.
static double inquiryDelaySlots(const int backoffLimit)
static double myRange
The range of the device.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
MSDevice_BTreceiver & operator=(const MSDevice_BTreceiver &)
Invalidated assignment operator.
static void hasSendingPersons()
~MSDevice_BTreceiver()
Destructor.
MSDevice_BTreceiver(const MSDevice_BTreceiver &)
Invalidated copy constructor.
static SumoRNG sRecognitionRNG
A random number generator used to determine whether the opposite was recognized.
static SumoRNG * getRNG()
static std::map< std::string, VehicleInformation * > sVehicles
The list of arrived receivers.
static SumoRNG * getRecognitionRNG()
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.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Adds the vehicle to running vehicles if it (re-) enters the network.
static bool myHasPersons
Whether the bt-system includes persons.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Moves (the known) vehicle from running to arrived vehicles' list.
static double myOffTime
The offtime of the device.
A single movement state of the vehicle.
Representation of a lane in the micro simulation.
Notification
Definition of a vehicle state.
bool notifyEnter(SUMOTrafficObject &veh, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
MSTransportableDevice_BTreceiver(MSTransportable &holder, const std::string &id)
Constructor.
const std::string deviceName() const
return the name for this type of device
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, MSMoveReminder::Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
static void buildDevices(MSTransportable &t, std::vector< MSTransportableDevice * > &into)
Build devices for the given vehicle, if needed.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
Abstract in-person device.
MSVehicleDevice_BTreceiver(SUMOVehicle &holder, const std::string &id)
Constructor.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
const std::string deviceName() const
return the name for this type of device
bool notifyEnter(SUMOTrafficObject &veh, Notification reason, const MSLane *enteredLane=0)
Checks whether the reminder is activated by a vehicle entering the lane.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
bool notifyLeave(SUMOTrafficObject &veh, double lastPos, Notification reason, const MSLane *enteredLane=0)
Called if the vehicle leaves the reminder's lane.
bool notifyMove(SUMOTrafficObject &veh, double oldPos, double newPos, double newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
Abstract in-vehicle device.
A storage for options typed value containers)
Representation of a vehicle, person, or container.
Representation of a vehicle.