SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // Parser and container for routes during their loading 00010 /****************************************************************************/ 00011 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00012 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00013 /****************************************************************************/ 00014 // 00015 // This file is part of SUMO. 00016 // SUMO is free software: you can redistribute it and/or modify 00017 // it under the terms of the GNU General Public License as published by 00018 // the Free Software Foundation, either version 3 of the License, or 00019 // (at your option) any later version. 00020 // 00021 /****************************************************************************/ 00022 #ifndef MSRouteHandler_h 00023 #define MSRouteHandler_h 00024 00025 00026 // =========================================================================== 00027 // included modules 00028 // =========================================================================== 00029 #ifdef _MSC_VER 00030 #include <windows_config.h> 00031 #else 00032 #include <config.h> 00033 #endif 00034 00035 #include <string> 00036 #include "MSPerson.h" 00037 #include "MSVehicle.h" 00038 #include <utils/xml/SUMORouteHandler.h> 00039 #include <utils/common/SUMOTime.h> 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class MSEdge; 00046 class MSVehicleType; 00047 00048 00049 // =========================================================================== 00050 // class definitions 00051 // =========================================================================== 00060 class MSRouteHandler : public SUMORouteHandler { 00061 public: 00063 MSRouteHandler(const std::string& file, 00064 bool addVehiclesDirectly); 00065 00067 virtual ~MSRouteHandler() ; 00068 00069 protected: 00071 00072 00080 virtual void myStartElement(int element, 00081 const SUMOSAXAttributes& attrs) ; 00082 00083 00090 virtual void myEndElement(int element) ; 00092 00093 00095 void openVehicleTypeDistribution(const SUMOSAXAttributes& attrs); 00096 00098 void closeVehicleTypeDistribution(); 00099 00101 void openRoute(const SUMOSAXAttributes& attrs); 00102 00108 void closeRoute() ; 00109 00111 void openRouteDistribution(const SUMOSAXAttributes& attrs); 00112 00114 void closeRouteDistribution(); 00115 00117 void closeVehicle() ; 00118 00120 void closePerson() ; 00121 00123 void closeFlow() ; 00124 00126 void addStop(const SUMOSAXAttributes& attrs) ; 00127 00128 protected: 00130 MSEdgeVector myActiveRoute; 00131 00133 MSPerson::MSPersonPlan* myActivePlan; 00134 00136 bool myAddVehiclesDirectly; 00137 00139 RandomDistributor<MSVehicleType*> *myCurrentVTypeDistribution; 00140 00142 std::string myCurrentVTypeDistributionID; 00143 00145 RandomDistributor<const MSRoute*> *myCurrentRouteDistribution; 00146 00148 std::string myCurrentRouteDistributionID; 00149 00151 SUMOReal myScale; 00152 00153 private: 00155 MSRouteHandler(const MSRouteHandler& s); 00156 00158 MSRouteHandler& operator=(const MSRouteHandler& s); 00159 00160 }; 00161 00162 00163 #endif 00164 00165 /****************************************************************************/ 00166