 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
44 : myAttributeName(attributeName), myAmEdgeBased(edgeBased), myDestination(destination) {
56 const std::string& file)
62 const std::string& file)
64 myCurrentTimeBeg(-1), myCurrentTimeEnd(-1) {
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,
virtual bool hasAttribute(int id) const =0
Returns the information whether the named (by its enum-value) attribute is within the current list.
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
SAX-handler base for SUMO-files.
~ToRetrieveDefinition()
Destructor.
begin/end of the description of a single lane
virtual double getFloat(int id) const =0
Returns the double-value of the named (by its enum-value) attribute.
SUMOTime getSUMOTimeReporting(int attr, const char *objectid, bool &ok, bool report=true) const
Tries to read given attribute assuming it is a SUMOTime.
~SAXWeightsHandler()
Destructor.
weights: time range begin
std::string myCurrentEdgeID
the edge which is currently being processed
Complete definition about what shall be retrieved and where to store it.
void tryParse(const SUMOSAXAttributes &attrs, bool isEdge)
Parses the efforts of a lane for the previously read times.
double myCurrentTimeEnd
the end of the time period that is currently processed
ToRetrieveDefinition(const std::string &attributeName, bool edgeBased, EdgeFloatTimeLineRetriever &destination)
Constructor.
begin/end of the description of an edge
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.
SAXWeightsHandler(const std::vector< ToRetrieveDefinition * > &defs, const std::string &file)
Constructor.
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
std::vector< ToRetrieveDefinition * > myDefinitions
List of definitions what shall be read and whereto stored while parsing the file.
void myEndElement(int elemente)
Called when a closing tag occurs.
double myCurrentTimeBeg
the begin of the time period that is currently processed
an aggreagated-output interval
Encapsulated SAX-Attributes.
Interface for a class which obtains read weights for named edges.