41 #ifdef CHECK_MEMORY_LEAKS
43 #endif // CHECK_MEMORY_LEAKS
59 oc.
addDescription(
"device.btreceiver.range",
"Communication",
"The period with which the vehicle shall be rerouted");
68 into.push_back(device);
77 :
MSDevice(holder, id), myRange(range) {
90 std::set<std::string> tmp;
92 std::set<std::string> inRange;
97 for (std::set<std::string>::const_iterator i = tmp.begin(); i != tmp.end(); ++i) {
104 for (MSLane::VehCont::const_iterator j = vehs.begin(); j != vehs.end(); ++j) {
105 if (static_cast<MSVehicle&>(
myHolder).getPosition().distanceTo((*j)->getPosition()) >
myRange) {
109 inRange.insert((*j)->getID());
123 if (inRange.find((*i).first) != inRange.end()) {
131 mySeen[(*i).first] = std::vector<SeenDevice*>();
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Representation of a vehicle in the micro simulation.
virtual void releaseVehicles() const
Allows to use the container for microsimulation again.
SUMOVehicle & myHolder
The vehicle that stores the device.
static bool dictionary(std::string id, MSLane *lane)
Inserts a MSLane into the static dictionary Returns true if the key id isn't already in the dictionar...
std::vector< MSVehicle * > VehCont
Container for vehicles.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
Position getPosition(SUMOReal offset=0) const
Return current position (x/y, cartesian)
static OptionsCont & getOptions()
Retrieves the options.
virtual const VehCont & getVehiclesSecure() const
Returns the vehicles container; locks it for microsimulation.
SUMOReal myRange
The range of the device.
Class representing a single seen device.
Representation of a vehicle.
A point in 2D or 3D with translation and scaling methods.
MSVehicleControl & getVehicleControl()
Returns the vehicle control.
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc)
Adds common command options that allow to assign devices to vehicles.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
~MSDevice_BTreceiver()
Destructor.
std::map< std::string, std::vector< SeenDevice * > > mySeen
Abstract in-vehicle device.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, SUMOVehicle &v)
Determines whether a vehicle should get a certain device.
Allows to store the object; used as context while traveling the rtree in TraCI.
virtual SUMOReal getSpeed() const =0
Returns the vehicle's current speed.
A storage for options typed value containers)
SUMOReal getSpeed() const
Returns the vehicle's current speed.
SUMOVehicle * getVehicle(const std::string &id) const
Returns the vehicle with the given id.
std::map< std::string, SeenDevice * > myCurrentlySeen
MSDevice_BTreceiver(SUMOVehicle &holder, const std::string &id, SUMOReal range)
Constructor.
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
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 for waiting steps when the vehicle moves.
Representation of a lane in the micro simulation.
void generateOutput() const
Called on writing tripinfo output.
virtual const std::string & getID() const =0
Get the vehicle's ID.