44 : myAttributeName(attributeName), myAmEdgeBased(edgeBased), myDestination(destination) {
56 const std::string& file)
62 const std::string& file)
70 std::vector<ToRetrieveDefinition*>::iterator i;
105 std::vector<ToRetrieveDefinition*>::iterator i;
109 if ((*i)->myAmEdgeBased) {
111 (*i)->myAggValue = attrs.
getFloat((*i)->myAttributeName);
113 (*i)->myHadAttribute =
true;
115 (*i)->myHadAttribute =
false;
118 (*i)->myAggValue = 0;
125 if (!(*i)->myAmEdgeBased) {
127 (*i)->myAggValue += attrs.
getFloat((*i)->myAttributeName);
129 (*i)->myHadAttribute =
true;
144 std::vector<ToRetrieveDefinition*>::iterator i;
146 if ((*i)->myHadAttribute) {
148 (*i)->myAggValue / (
double)(*i)->myNoLanes,
Interface for a class which obtains read weights for named edges.
begin/end of the description of a single lane
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
double myCurrentTimeBeg
the begin of the time period that is currently processed
weights: time range begin
SAX-handler base for SUMO-files.
~SAXWeightsHandler()
Destructor.
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list...
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
std::string myCurrentEdgeID
the edge which is currently being processed
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void tryParse(const SUMOSAXAttributes &attrs, bool isEdge)
Parses the efforts of a lane for the previously read times.
Encapsulated SAX-Attributes.
double myCurrentTimeEnd
the end of the time period that is currently processed
SAXWeightsHandler(const std::vector< ToRetrieveDefinition *> &defs, const std::string &file)
Constructor.
void myEndElement(int elemente)
Called when a closing tag occurs.
std::vector< ToRetrieveDefinition * > myDefinitions
List of definitions what shall be read and whereto stored while parsing the file. ...
begin/end of the description of an edge
Complete definition about what shall be retrieved and where to store it.
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) attribute.
T getOpt(int attr, const char *objectid, bool &ok, T defaultValue, bool report=true) const
Tries to read given attribute assuming it is an int.
ToRetrieveDefinition(const std::string &attributeName, bool edgeBased, EdgeFloatTimeLineRetriever &destination)
Constructor.
an aggreagated-output interval
~ToRetrieveDefinition()
Destructor.