SUMO - Simulation of Urban MObility
ROMARouteHandler.cpp
Go to the documentation of this file.
1 /****************************************************************************/
10 // Parser and container for routes during their loading
11 /****************************************************************************/
12 // SUMO, Simulation of Urban MObility; see http://sumo.dlr.de/
13 // Copyright (C) 2001-2015 DLR (http://www.dlr.de/) and contributors
14 /****************************************************************************/
15 //
16 // This file is part of SUMO.
17 // SUMO is free software: you can redistribute it and/or modify
18 // it under the terms of the GNU General Public License as published by
19 // the Free Software Foundation, either version 3 of the License, or
20 // (at your option) any later version.
21 //
22 /****************************************************************************/
23 
24 
25 // ===========================================================================
26 // included modules
27 // ===========================================================================
28 #ifdef _MSC_VER
29 #include <windows_config.h>
30 #else
31 #include <config.h>
32 #endif
33 
35 #include <od/ODMatrix.h>
36 #include "ROMARouteHandler.h"
37 
38 #ifdef CHECK_MEMORY_LEAKS
39 #include <foreign/nvwa/debug_new.h>
40 #endif // CHECK_MEMORY_LEAKS
41 
42 
43 // ===========================================================================
44 // method definitions
45 // ===========================================================================
47  SUMOSAXHandler(""),
48  myMatrix(matrix) {
49 }
50 
51 
53 }
54 
55 
56 void
58  const SUMOSAXAttributes& attrs) {
59  if (element == SUMO_TAG_TRIP || element == SUMO_TAG_VEHICLE) {
61  myMatrix.add(parameter->id, parameter->depart, parameter->fromTaz, parameter->toTaz, parameter->vtypeid);
62  }
63 }
64 
65 
66 /****************************************************************************/
ODMatrix & myMatrix
The current route.
ROMARouteHandler(ODMatrix &matrix)
standard constructor
std::string vtypeid
The vehicle&#39;s type id.
static SUMOVehicleParameter * parseVehicleAttributes(const SUMOSAXAttributes &attrs, const bool optionalID=false, const bool skipDepart=false, const bool isPerson=false)
Parses a vehicle&#39;s attributes.
virtual ~ROMARouteHandler()
standard destructor
void add(SUMOReal vehicleNumber, SUMOTime begin, SUMOTime end, const std::string &origin, const std::string &destination, const std::string &vehicleType)
Builds a single cell from the given values, verifying them.
Definition: ODMatrix.cpp:75
SAX-handler base for SUMO-files.
std::string toTaz
The vehicle&#39;s destination zone (district)
void myStartElement(int element, const SUMOSAXAttributes &attrs)
Called on the opening of a tag;.
Encapsulated SAX-Attributes.
An O/D (origin/destination) matrix.
Definition: ODMatrix.h:75
SUMOTime depart
The vehicle&#39;s departure time.
std::string fromTaz
The vehicle&#39;s origin zone (district)
Structure representing possible vehicle parameter.
std::string id
The vehicle&#39;s id.