66 oc.
addDescription(
"device.fcd.begin",
"FCD Device",
"Recording begin time for FCD-data");
69 oc.
addDescription(
"device.fcd.period",
"FCD Device",
"Recording period for FCD-data");
72 oc.
addDescription(
"device.fcd.radius",
"FCD Device",
"Record objects in a radius around equipped vehicles");
81 into.push_back(device);
117 if (oc.
isSet(
"fcd-output.filter-shapes")) {
120 for (std::string attrName : oc.
getStringVector(
"fcd-output.filter-shapes")) {
122 WRITE_ERROR(
"Specified shape '" + attrName +
"' for filtering fcd-output could not be found.");
143 if (oc.
isSet(
"fcd-output.filter-edges.input-file")) {
144 const std::string file = oc.
getString(
"fcd-output.filter-edges.input-file");
145 std::ifstream strm(file.c_str());
147 throw ProcessError(
"Could not load names of edges for filtering fcd-output from '" + file +
"'.");
149 while (strm.good()) {
154 name = name.substr(5);
159 if (oc.
isSet(
"fcd-output.attributes")) {
161 for (std::string attrName : oc.
getStringVector(
"fcd-output.attributes")) {
163 if (attrName ==
"all") {
166 WRITE_ERROR(
"Unknown attribute '" + attrName +
"' to write in fcd output.");
176 if (oc.
isSet(
"fcd-output.filter-shapes")) {
A device which collects info on the vehicle trip (mainly on departure and arrival)
static void cleanup()
resets the edge filter
static long long int myWrittenAttributes
bit mask for checking attributes to be written
static const long long int myDefaultMask
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 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.
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
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 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 whether 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 StringBijection< int > Attrs
The names of SUMO-XML attributes for use in netbuild.
Storage for geometrical objects.
const Polygons & getPolygons() const
Returns all polygons.
T get(const std::string &str) const
static bool startsWith(const std::string &str, const std::string prefix)
Checks whether a given string starts with the prefix.