60 oc.
addDescription(
"device.fcd.begin",
"FCD Device",
TL(
"Recording begin time for FCD-data"));
63 oc.
addDescription(
"device.fcd.period",
"FCD Device",
TL(
"Recording period for FCD-data"));
66 oc.
addDescription(
"device.fcd.radius",
"FCD Device",
TL(
"Record objects in a radius around equipped vehicles"));
75 into.push_back(device);
133 if (oc.
isSet(
"fcd-output.filter-shapes")) {
136 for (std::string attrName : oc.
getStringVector(
"fcd-output.filter-shapes")) {
138 WRITE_ERRORF(
TL(
"Specified shape '%' for filtering fcd-output could not be found."), attrName);
159 if (oc.
isSet(
"fcd-output.filter-edges.input-file")) {
160 const std::string file = oc.
getString(
"fcd-output.filter-edges.input-file");
161 std::ifstream strm(file.c_str());
163 throw ProcessError(
TLF(
"Could not load names of edges for filtering fcd-output from '%'.", file));
165 while (strm.good()) {
170 name = name.substr(5);
175 if (oc.
isSet(
"fcd-output.attributes")) {
177 for (std::string attrName : oc.
getStringVector(
"fcd-output.attributes")) {
179 if (attrName ==
"all") {
182 WRITE_ERRORF(
TL(
"Unknown attribute '%' to write in fcd output."), attrName);
191 if (oc.
isSet(
"fcd-output.filter-shapes")) {
#define WRITE_ERRORF(...)
std::bitset< 96 > SumoXMLAttrMask
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.
~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 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 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 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.
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.
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.
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.
static SequentialStringBijection Attrs
The names of SUMO-XML attributes for use in netbuild.
int get(const std::string &str) const
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.