21 #ifndef MSDevice_BTreceiver_h
22 #define MSDevice_BTreceiver_h
147 const std::string& _observerLaneID,
SUMOReal _observerLanePos,
149 const std::string& _seenLaneID,
SUMOReal _seenLanePos)
218 static void cleanUp(std::map<std::string, SeenDevice*>& c, std::map<std::string, std::vector<SeenDevice*> >& s);
297 for (std::vector<VehicleState>::const_iterator i =
updates.begin(); i !=
updates.end(); ++i) {
298 ret.
add((*i).position);
319 std::map<std::string, std::vector<SeenDevice*> >
seen;
374 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
375 std::map<std::string, SeenDevice*>& currentlySeen);
393 void leaveRange(std::map<std::string, SeenDevice*>& currentlySeen, std::map<std::string, std::vector<SeenDevice*> >& seen,
395 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
423 void writeOutput(
const std::string&
id,
const std::map<std::string, std::vector<SeenDevice*> >& seen,
424 bool allRecognitions);
436 static std::map<std::string, VehicleInformation*>
sVehicles;
Position observerPos
The position the observer had at the time.
A global update performer.
void updateVisibility(VehicleInformation &receiver, MSDevice_BTsender::VehicleInformation &sender, const Position &receiverPos, const Position &receiverD)
Rechecks the visibility for a given receiver/sender pair.
std::string seenLaneID
The lane the vehicle was at.
VehicleState(SUMOReal _time, SUMOReal _speed, SUMOReal _angle, const Position &_position, const std::string &_laneID, SUMOReal _lanePos)
Constructor.
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.
A class that stores a 2D geometrical boundary.
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.
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.
SUMOReal lanePos
The position at the lane of the vehicle.
A point in 2D or 3D with translation and scaling methods.
SUMOReal time
The current time.
void writeOutput(const std::string &id, const std::map< std::string, std::vector< SeenDevice * > > &seen, bool allRecognitions)
Writes the output.
Position position
The position of the vehicle.
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.
Base class for objects which have an id.
Abstract in-vehicle device.
Holds the information about exact positions/speeds/time of the begin/end of a meeting.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
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.
~VehicleState()
Destructor.
A storage for options typed value containers)
SUMOReal seenLanePos
The position at the lane of the vehicle.
MSDevice_BTreceiver(SUMOVehicle &holder, const std::string &id, SUMOReal range)
Constructor.
MeetingPoint meetingBegin
Description of the meeting's begin.
SUMOReal speed
The speed of the vehicle.
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.
SUMOReal angle
The angle of the vehicle.
BTreceiverUpdate()
Constructor.
std::string laneID
The lane the vehicle was at.