20 #ifndef MSDevice_BTreceiver_h
21 #define MSDevice_BTreceiver_h
146 const std::string& _observerLaneID,
SUMOReal _observerLanePos,
148 const std::string& _seenLaneID,
SUMOReal _seenLanePos)
217 static void cleanUp(std::map<std::string, SeenDevice*>& c, std::map<std::string, std::vector<SeenDevice*> >& s);
296 for (std::vector<VehicleState>::const_iterator i =
updates.begin(); i !=
updates.end(); ++i) {
297 ret.
add((*i).position);
318 std::map<std::string, std::vector<SeenDevice*> >
seen;
373 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
374 std::map<std::string, SeenDevice*>& currentlySeen);
392 void leaveRange(std::map<std::string, SeenDevice*>& currentlySeen, std::map<std::string, std::vector<SeenDevice*> >& seen,
394 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
423 const std::string& otherID,
const Position& otherPos,
SUMOReal otherSpeed,
const std::string& otherLaneID,
SUMOReal otherLanePos,
424 std::map<std::string, SeenDevice*>& currentlySeen);
432 void writeOutput(
const std::string&
id,
const std::map<std::string, std::vector<SeenDevice*> >& seen,
433 bool allRecognitions);
445 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 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.
void add(SUMOReal x, SUMOReal y)
Makes the boundary include the given coordinate.
~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.