SUMO - Simulation of Urban MObility

RORDLoader_SUMOBase.h

Go to the documentation of this file.
00001 /****************************************************************************/
00009 // The base class for SUMO-native route handlers
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_SUMOBase_h
00023 #define RORDLoader_SUMOBase_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 "ROTypedXMLRoutesLoader.h"
00037 #include <utils/xml/SUMOXMLDefinitions.h>
00038 #include <utils/common/RGBColor.h>
00039 #include <utils/common/SUMOVehicleParameter.h>
00040 
00041 
00042 // ===========================================================================
00043 // class declarations
00044 // ===========================================================================
00045 class SUMOVTypeParameter;
00046 class RORouteDef;
00047 class MsgHandler;
00048 class RORouteDef_Alternatives;
00049 class RORouteDef_Complete;
00050 class RORoute;
00051 
00052 
00053 // ===========================================================================
00054 // class definitions
00055 // ===========================================================================
00064 class RORDLoader_SUMOBase :
00065     public ROTypedXMLRoutesLoader {
00066 public:
00068     RORDLoader_SUMOBase(RONet& net,
00069                         SUMOTime begin, SUMOTime end,
00070                         const SUMOReal beta, const SUMOReal gawronA, const SUMOReal logitGamma,
00071                         const int maxRouteNumber, const bool tryRepair, const bool withTaz,
00072                         const bool keepRoutes, const bool skipRouteCalculation,
00073                         const std::string& file = "") ;
00074 
00076     ~RORDLoader_SUMOBase() ;
00077 
00078 
00080 
00081 
00086     SUMOTime getLastReadTimeStep() const {
00087         return myCurrentDepart;
00088     }
00090 
00091 
00092 protected:
00094 
00095 
00103     virtual void myStartElement(int element,
00104                                 const SUMOSAXAttributes& attrs) ;
00105 
00106 
00114     void myCharacters(int element,
00115                       const std::string& chars) ;
00116 
00117 
00124     virtual void myEndElement(int element) ;
00126 
00128     void startAlternative(const SUMOSAXAttributes& attrs);
00129 
00131     void startRoute(const SUMOSAXAttributes& attrs);
00132 
00133     bool closeVehicle() ;
00134 
00135 
00136 
00139 
00145     bool nextRouteRead() {
00146         return myHaveNextRoute;
00147     }
00148 
00149 
00155     void beginNextRoute() ;
00157 
00158 
00159 protected:
00161     SUMOVehicleParameter* myVehicleParameter;
00162 
00164     RGBColor* myColor;
00165 
00167     bool myCurrentIsOk;
00168 
00170     bool myAltIsValid;
00171 
00173     bool myHaveNextRoute;
00174 
00176     RORouteDef_Alternatives* myCurrentAlternatives;
00177 
00179     SUMOReal myCost;
00180 
00182     SUMOReal myProbability;
00183 
00185     const SUMOReal myBeta;
00186 
00188     const SUMOReal myGawronA;
00189 
00191     const SUMOReal myLogitGamma;
00192 
00194     int myMaxRouteNumber;
00195 
00197     bool myTryRepair;
00198 
00200     const bool myWithTaz;
00201 
00203     const bool myKeepRoutes;
00204 
00206     const bool mySkipRouteCalculation;
00207 
00209     RORouteDef_Complete* myCurrentRoute;
00210 
00212     std::string myCurrentRouteName;
00213 
00215     SUMOTime myCurrentDepart;
00216 
00218     SUMOVTypeParameter* myCurrentVType;
00219 
00220     bool myHaveWarnedAboutDeprecatedVType;
00221     bool myHaveWarnedAboutDeprecatedRoute;
00222 
00223 private:
00225     RORDLoader_SUMOBase(const RORDLoader_SUMOBase& src);
00226 
00228     RORDLoader_SUMOBase& operator=(const RORDLoader_SUMOBase& src);
00229 
00230 };
00231 
00232 
00233 #endif
00234 
00235 /****************************************************************************/
00236 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines