21 #ifndef MSDevice_BTreceiver_h
22 #define MSDevice_BTreceiver_h
155 const std::string& _observerLaneID,
SUMOReal _observerLanePos,
157 const std::string& _seenLaneID,
SUMOReal _seenLanePos)
226 static void cleanUp(std::map<std::string, SeenDevice*>& c, std::map<std::string, std::vector<SeenDevice*> >& s);
272 std::map<std::string, std::vector<SeenDevice*> >
seen;
324 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
325 std::map<std::string, SeenDevice*>& currentlySeen);
343 void leaveRange(std::map<std::string, SeenDevice*>& currentlySeen, std::map<std::string, std::vector<SeenDevice*> >& seen,
345 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
373 void writeOutput(
const std::string&
id,
const std::map<std::string, std::vector<SeenDevice*> >& seen,
374 bool allRecognitions);
386 static std::map<std::string, VehicleInformation*>
sVehicles;
Position observerPos
The position the observer had at the time.
A global update performer.
std::string seenLaneID
The lane the vehicle was at.
SUMOReal seenSpeed
The speed the vehicle had at the time.
SeenDevice(const MeetingPoint &meetingBegin_)
Constructor.
Notification
Definition of a vehicle state.
std::vector< MeetingPoint * > recognitionPoints
List of recognition points.
static MTRand sRecognitionRNG
A random number generator used to determine whether the opposite was recognized.
SUMOReal observerLanePos
The position at the lane of the observer.
MSDevice_BTreceiver & operator=(const MSDevice_BTreceiver &)
Invalidated assignment operator.
bool notifyLeave(SUMOVehicle &veh, SUMOReal lastPos, Notification reason)
Moves (the known) vehicle from running to arrived vehicles' list.
SUMOReal lastView
Last recognition point.
MeetingPoint meetingEnd
Description of the meeting's end.
Base (microsim) event class.
MSDevice_BTreceiver(SUMOVehicle &holder, const std::string &id)
Constructor.
SUMOReal t
The time of the meeting.
std::string observerLaneID
The lane the observer was at.
Position seenPos
The position the seen vehicle had at the time.
static SUMOReal myRange
The range of the device.
Class representing a single seen device.
~BTreceiverUpdate()
Destructor.
Representation of a vehicle.
static bool myWasInitialised
Whether the bt-system was already initialised.
A point in 2D or 3D with translation and scaling methods.
void writeOutput(const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions)
Writes the output.
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(SUMOVehicle &veh, Notification reason)
Adds the vehicle to running vehicles if it (re-) enters the network.
~MSDevice_BTreceiver()
Destructor.
SUMOTime execute(SUMOTime currentTime)
Performs the update.
static std::map< std::string, VehicleInformation * > sVehicles
The list of arrived receivers.
Abstract in-vehicle device.
Holds the information about exact positions/speeds/time of the begin/end of a meeting.
void addRecognitionPoint(const SUMOReal tEnd, const Position &thisPos, const SUMOReal thisSpeed, const std::string &thisLaneID, const SUMOReal thisLanePos, const Position &otherPos, const SUMOReal otherSpeed, const std::string &otherLaneID, const SUMOReal otherLanePos, SeenDevice *otherDevice) const
Adds a point of recognition.
~MeetingPoint()
Destructor.
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.
static SUMOReal myOffTime
The offtime of the device.
A storage for options typed value containers)
SUMOReal seenLanePos
The position at the lane of the vehicle.
MeetingPoint meetingBegin
Description of the meeting's begin.
void updateVisibility(VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender)
Rechecks the visibility for a given receiver/sender pair.
static SUMOReal getRange()
Returns the configured range.
MeetingPoint(SUMOReal _t, const Position &_observerPos, SUMOReal _observerSpeed, const std::string &_observerLaneID, SUMOReal _observerLanePos, const Position &_seenPos, SUMOReal _seenSpeed, const std::string &_seenLaneID, SUMOReal _seenLanePos)
Constructor.
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSDevice * > &into)
Build devices for the given vehicle, if needed.
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_BTreceiver-options.
bool notifyMove(SUMOVehicle &veh, SUMOReal oldPos, SUMOReal newPos, SUMOReal newSpeed)
Checks whether the reminder still has to be notified about the vehicle moves.
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.
SUMOReal observerSpeed
The speed the observer had at the time.
BTreceiverUpdate()
Constructor.