|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // The basic class for loading trip definitions 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 RORDLoader_TripDefs_h 00023 #define RORDLoader_TripDefs_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 <utils/options/OptionsCont.h> 00037 #include <utils/common/IDSupplier.h> 00038 #include <utils/xml/SUMOXMLDefinitions.h> 00039 #include "ROTypedXMLRoutesLoader.h" 00040 #include "RONet.h" 00041 #include <utils/common/SUMOVehicleParameter.h> 00042 00043 00044 // =========================================================================== 00045 // class definitions 00046 // =========================================================================== 00053 class RORDLoader_TripDefs : public ROTypedXMLRoutesLoader { 00054 public: 00056 RORDLoader_TripDefs(RONet& net, SUMOTime begin, SUMOTime end, 00057 bool emptyDestinationsAllowed, bool withTaz, 00058 const std::string& file = "") ; 00059 00061 ~RORDLoader_TripDefs() ; 00062 00063 00065 00066 00071 SUMOTime getLastReadTimeStep() const { 00072 return myDepartureTime; 00073 } 00075 00076 00077 protected: 00079 00080 00088 void myStartElement(int element, 00089 const SUMOSAXAttributes& attrs) ; 00090 00091 00098 void myEndElement(int element) ; 00100 00101 00102 00105 00111 bool nextRouteRead() { 00112 return myNextRouteRead; 00113 } 00114 00115 00121 void beginNextRoute() ; 00123 00124 00125 protected: 00127 std::string getVehicleID(const SUMOSAXAttributes& attrs); 00128 00130 ROEdge* getEdge(const SUMOSAXAttributes& attrs, const std::string& purpose, 00131 SumoXMLAttr which, const std::string& id, bool emptyAllowed); 00132 00133 protected: 00135 IDSupplier myIdSupplier; 00136 00138 ROEdge* myBeginEdge; 00139 00141 ROEdge* myEndEdge; 00142 00146 const bool myEmptyDestinationsAllowed; 00147 00149 const bool myWithTaz; 00150 00152 bool myNextRouteRead; 00153 00155 SUMOVTypeParameter* myCurrentVehicleType; 00156 00157 SUMOVehicleParameter* myParameter; 00158 SUMOTime myDepartureTime; 00159 00160 bool myHaveWarnedAboutDeprecatedTripDef; 00161 00162 private: 00164 RORDLoader_TripDefs(const RORDLoader_TripDefs& src); 00165 00167 RORDLoader_TripDefs& operator=(const RORDLoader_TripDefs& src); 00168 00169 }; 00170 00171 00172 #endif 00173 00174 /****************************************************************************/ 00175