67 oc.
addDescription(
"device.fcd.begin",
"FCD Device",
TL(
"Recording begin time for FCD-data"));
70 oc.
addDescription(
"device.fcd.period",
"FCD Device",
TL(
"Recording period for FCD-data"));
73 oc.
addDescription(
"device.fcd.radius",
"FCD Device",
TL(
"Record objects in a radius around equipped vehicles"));
82 into.push_back(device);
142 if (oc.
isSet(
"fcd-output.filter-shapes")) {
145 for (std::string attrName : oc.
getStringVector(
"fcd-output.filter-shapes")) {
147 WRITE_ERRORF(
TL(
"Specified shape '%' for filtering fcd-output could not be found."), attrName);
174 if (oc.
isSet(
"fcd-output.filter-edges.input-file")) {
175 const std::string file = oc.
getString(
"fcd-output.filter-edges.input-file");
176 std::ifstream strm(file.c_str());
178 throw ProcessError(
TLF(
"Could not load names of edges for filtering fcd-output from '%'.", file));
180 while (strm.good()) {
185 name = name.substr(5);
214 const std::map<std::string, SumoXMLAttrMask> special = {{
"location",
getDefaultMask()}, {
"emissions", emissions}, {
"misc", misc}};
215 if (oc.
isSet(
"fcd-output.attributes")) {
226 if (oc.
getBool(
"fcd-output.signals")) {
229 if (oc.
getBool(
"fcd-output.acceleration")) {
233 if (oc.
getBool(
"fcd-output.distance")) {
237 if (oc.
isSet(
"fcd-output.filter-shapes")) {
#define WRITE_ERRORF(...)
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
std::bitset< 96 > SumoXMLAttrMask
@ SUMO_ATTR_ACCELERATION_LAT
A device which collects info on the vehicle trip (mainly on departure and arrival)
static void cleanup()
resets the edge filter
static SumoXMLAttrMask getDefaultMask()
MSDevice_FCD(SUMOVehicle &holder, const std::string &id)
Constructor.
static SUMOTime myBegin
begin time
~MSDevice_FCD()
Destructor.
static bool myShapeFilterInitialized
static std::vector< PositionVector > myShape4Filters
polygon spatial filter for FCD output
static SumoXMLAttrMask myWrittenAttributes
bit mask for checking attributes to be written
static std::set< const MSEdge * > myEdgeFilter
edge filter for FCD output
static std::vector< std::string > myParamsToWrite
static void insertOptions(OptionsCont &oc)
Inserts MSDevice_FCD-options.
static bool myEdgeFilterInitialized
static bool myShapeFilterDesired
static void initOnce()
initialize edge filter and attribute mask (once)
static void buildVehicleDevices(SUMOVehicle &v, std::vector< MSVehicleDevice * > &into)
Build devices for the given vehicle, if needed.
static double myMaxLeaderDistance
static void buildShapeFilter()
static bool shapeFilter(const SUMOTrafficObject *veh)
checks if in polygon
static void insertDefaultAssignmentOptions(const std::string &deviceName, const std::string &optionsTopic, OptionsCont &oc, const bool isPerson=false)
Adds common command options that allow to assign devices to vehicles.
static bool equippedByDefaultAssignmentOptions(const OptionsCont &oc, const std::string &deviceName, DEVICEHOLDER &v, bool outputOptionSet, const bool isPerson=false)
Determines whether a vehicle should get a certain device.
static bool dictionary(const std::string &id, MSEdge *edge)
Inserts edge into the static dictionary Returns true if the key id isn't already in the dictionary....
static bool gSublane
whether sublane simulation is enabled (sublane model or continuous lanechanging)
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
ShapeContainer & getShapeContainer()
Returns the shapes container.
Abstract in-vehicle device.
Representation of a vehicle in the micro simulation.
const Position getBackPosition() const
const std::string & getID() const
Returns the id.
T get(const std::string &id) const
Retrieves an item.
int size() const
Returns the number of stored items within the container.
A storage for options typed value containers)
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
static OptionsCont & getOptions()
Retrieves the options.
static const SumoXMLAttrMask parseWrittenAttributes(const std::vector< std::string > &attrList, const std::string &desc, const std::map< std::string, SumoXMLAttrMask > &special=std::map< std::string, SumoXMLAttrMask >())
Parses a list of strings for attribute names and sets the relevant bits in the returned mask.
void setExpectedAttributes(const SumoXMLAttrMask &expected, const int depth=2)
static OutputDevice & getDeviceByOption(const std::string &name)
Returns the device described by the option.
const PositionVector & getShape() const
Returns the shape of the polygon.
Representation of a vehicle, person, or container.
virtual Position getPosition(const double offset=0) const =0
Return current position (x/y, cartesian)
Representation of a vehicle.
Storage for geometrical objects.
const Polygons & getPolygons() const
Returns all polygons.
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.