54 WRITE_WARNING(
TL(
"MeanData elements cannot load attributes as params"));
163 bool parsedOk =
true;
165 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
"", parsedOk);
166 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), parsedOk);
174 const std::vector<std::string> edges = attrs.
getOpt<std::vector<std::string> >(
SUMO_ATTR_EDGES,
id.c_str(), parsedOk, {});
181 const std::vector<std::string> vTypes = attrs.
getOpt<std::vector<std::string> >(
SUMO_ATTR_VTYPES,
id.c_str(), parsedOk, {});
212 bool parsedOk =
true;
214 const std::string
id = attrs.
get<std::string>(
SUMO_ATTR_ID,
"", parsedOk);
215 const std::string file = attrs.
get<std::string>(
SUMO_ATTR_FILE,
id.c_str(), parsedOk);
223 const std::vector<std::string> edges = attrs.
getOpt<std::vector<std::string> >(
SUMO_ATTR_EDGES,
id.c_str(), parsedOk, {});
230 const std::vector<std::string> vTypes = attrs.
getOpt<std::vector<std::string> >(
SUMO_ATTR_VTYPES,
id.c_str(), parsedOk, {});
#define WRITE_WARNING(msg)
SumoXMLTag
Numbers representing SUMO-XML - element names.
@ SUMO_TAG_MEANDATA_LANE
a lane based mean data detector
@ SUMO_TAG_MEANDATA_EDGE
an edge based mean data detector
@ SUMO_TAG_PARAM
parameter associated to a certain key
@ SUMO_ATTR_TRACK_VEHICLES
@ SUMO_ATTR_BEGIN
weights: time range begin
@ SUMO_ATTR_WITH_INTERNAL
@ SUMO_ATTR_EDGES
the edges of a route
@ SUMO_ATTR_MAX_TRAVELTIME
@ SUMO_ATTR_HALTING_SPEED_THRESHOLD
@ SUMO_ATTR_END
weights: time range end
@ SUMO_ATTR_WRITE_ATTRIBUTES
@ SUMO_ATTR_DETECT_PERSONS
@ SUMO_ATTR_EXCLUDE_EMPTY
SUMOTime getTimeAttribute(const SumoXMLAttr attr) const
get time attribute
void setTag(const SumoXMLTag tag)
set SumoBaseObject tag
void addBoolAttribute(const SumoXMLAttr attr, const bool value)
add bool attribute into current SumoBaseObject node
SumoXMLTag getTag() const
get XML myTag
void addTimeAttribute(const SumoXMLAttr attr, const SUMOTime value)
add time attribute into current SumoBaseObject node
void addStringListAttribute(const SumoXMLAttr attr, const std::vector< std::string > &value)
add string list attribute into current SumoBaseObject node
void addDoubleAttribute(const SumoXMLAttr attr, const double value)
add double attribute into current SumoBaseObject node
bool getBoolAttribute(const SumoXMLAttr attr) const
get bool attribute
void addStringAttribute(const SumoXMLAttr attr, const std::string &value)
add string attribute into current SumoBaseObject node
double getDoubleAttribute(const SumoXMLAttr attr) const
get double attribute
const std::vector< std::string > & getStringListAttribute(const SumoXMLAttr attr) const
get string list attribute
const std::string & getStringAttribute(const SumoXMLAttr attr) const
get string attribute
const std::vector< SumoBaseObject * > & getSumoBaseObjectChildren() const
get SumoBaseObject children
void abortSUMOBaseOBject()
abort SUMOBaseOBject
CommonXMLStructure::SumoBaseObject * getCurrentSumoBaseObject() const
get current editedSumoBaseObject
void openSUMOBaseOBject()
open SUMOBaseOBject
void closeSUMOBaseOBject()
close SUMOBaseOBject
bool beginParseAttributes(SumoXMLTag tag, const SUMOSAXAttributes &attrs)
begin parse attributes
void endParseAttributes()
end parse attributes
virtual void buildEdgeMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edges, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)=0
bool isErrorCreatingElement() const
get flag for check if a element wasn't created
MeanDataHandler()
Constructor.
void writeError(const std::string &error)
write error and enable error creating element
void parseEdgeMeanData(const SUMOSAXAttributes &attrs)
virtual ~MeanDataHandler()
Destructor.
void parseLaneMeanData(const SUMOSAXAttributes &attrs)
parse laneMeanData attributes
CommonXMLStructure myCommonXMLStructure
common XML Structure
void parseSumoBaseObject(CommonXMLStructure::SumoBaseObject *obj)
parse SumoBaseObject (it's called recursivelly)
virtual void buildLaneMeanData(const CommonXMLStructure::SumoBaseObject *sumoBaseObject, const std::string &ID, const std::string &file, SUMOTime period, SUMOTime begin, SUMOTime end, const bool trackVehicles, const std::vector< std::string > &writtenAttributes, const bool aggregate, const std::vector< std::string > &edges, const std::string &edgeFile, std::string excludeEmpty, const bool withInternal, const std::vector< std::string > &detectPersons, const double minSamples, const double maxTravelTime, const std::vector< std::string > &vTypes, const double speedThreshold)=0
Builds laneMeanData.
bool myErrorCreatingElement
flag for check if a element wasn't created
Encapsulated SAX-Attributes.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue=T(), bool report=true) const
Tries to read given attribute assuming it is an int.
SUMOTime getOptSUMOTimeReporting(int attr, const char *objectid, bool &ok, SUMOTime defaultValue, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
T get(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is an int.