SUMO - Simulation of Urban MObility

RORDLoader_SUMOBase.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // The base class for SUMO-native route handlers
00008 /****************************************************************************/
00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00010 // Copyright (C) 2001-2011 DLR (http://www.dlr.de/) and contributors
00011 /****************************************************************************/
00012 //
00013 //   This program is free software; you can redistribute it and/or modify
00014 //   it under the terms of the GNU General Public License as published by
00015 //   the Free Software Foundation; either version 2 of the License, or
00016 //   (at your option) any later version.
00017 //
00018 /****************************************************************************/
00019 #ifndef RORDLoader_SUMOBase_h
00020 #define RORDLoader_SUMOBase_h
00021 
00022 
00023 // ===========================================================================
00024 // included modules
00025 // ===========================================================================
00026 #ifdef _MSC_VER
00027 #include <windows_config.h>
00028 #else
00029 #include <config.h>
00030 #endif
00031 
00032 #include <string>
00033 #include "ROTypedXMLRoutesLoader.h"
00034 #include <utils/xml/SUMOXMLDefinitions.h>
00035 #include <utils/common/RGBColor.h>
00036 #include <utils/common/SUMOVehicleParameter.h>
00037 
00038 
00039 // ===========================================================================
00040 // class declarations
00041 // ===========================================================================
00042 class SUMOVTypeParameter;
00043 class RORouteDef;
00044 class MsgHandler;
00045 class RORouteDef_Alternatives;
00046 class RORouteDef_Complete;
00047 class RORoute;
00048 
00049 
00050 // ===========================================================================
00051 // class definitions
00052 // ===========================================================================
00061 class RORDLoader_SUMOBase :
00062     public ROTypedXMLRoutesLoader {
00063 public:
00065     RORDLoader_SUMOBase(RONet& net,
00066                         SUMOTime begin, SUMOTime end,
00067                         const SUMOReal beta, const SUMOReal gawronA, const SUMOReal logitGamma,
00068                         const int maxRouteNumber, const bool tryRepair, const bool withTaz,
00069                         const bool keepRoutes, const bool skipRouteCalculation,
00070                         const std::string& file="") throw(ProcessError);
00071 
00073     ~RORDLoader_SUMOBase() throw();
00074 
00075 
00077 
00078 
00083     SUMOTime getLastReadTimeStep() const throw() {
00084         return myCurrentDepart;
00085     }
00087 
00088 
00089 protected:
00091 
00092 
00100     virtual void myStartElement(int element,
00101                                 const SUMOSAXAttributes& attrs) throw(ProcessError);
00102 
00103 
00111     void myCharacters(int element,
00112                       const std::string& chars) throw(ProcessError);
00113 
00114 
00121     virtual void myEndElement(int element) throw(ProcessError);
00123 
00125     void startAlternative(const SUMOSAXAttributes& attrs);
00126 
00128     void startRoute(const SUMOSAXAttributes& attrs);
00129 
00130     bool closeVehicle() throw();
00131 
00132 
00133 
00136 
00142     bool nextRouteRead() throw() {
00143         return myHaveNextRoute;
00144     }
00145 
00146 
00152     void beginNextRoute() throw();
00154 
00155 
00156 protected:
00158     SUMOVehicleParameter* myVehicleParameter;
00159 
00161     RGBColor* myColor;
00162 
00164     bool myCurrentIsOk;
00165 
00167     bool myAltIsValid;
00168 
00170     bool myHaveNextRoute;
00171 
00173     RORouteDef_Alternatives* myCurrentAlternatives;
00174 
00176     SUMOReal myCost;
00177 
00179     SUMOReal myProbability;
00180 
00182     const SUMOReal myBeta;
00183 
00185     const SUMOReal myGawronA;
00186 
00188     const SUMOReal myLogitGamma;
00189 
00191     int myMaxRouteNumber;
00192 
00194     bool myTryRepair;
00195 
00197     const bool myWithTaz;
00198 
00200     const bool myKeepRoutes;
00201 
00203     const bool mySkipRouteCalculation;
00204 
00206     RORouteDef_Complete* myCurrentRoute;
00207 
00209     std::string myCurrentRouteName;
00210 
00212     SUMOTime myCurrentDepart;
00213 
00215     SUMOVTypeParameter* myCurrentVType;
00216 
00217     bool myHaveWarnedAboutDeprecatedVType;
00218     bool myHaveWarnedAboutDeprecatedRoute;
00219 
00220 private:
00222     RORDLoader_SUMOBase(const RORDLoader_SUMOBase& src);
00223 
00225     RORDLoader_SUMOBase& operator=(const RORDLoader_SUMOBase& src);
00226 
00227 };
00228 
00229 
00230 #endif
00231 
00232 /****************************************************************************/
00233 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines