SUMO - Simulation of Urban MObility
ROVehicle.h
Go to the documentation of this file.
00001 /****************************************************************************/
00008 // A vehicle as used by router
00009 /****************************************************************************/
00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
00012 /****************************************************************************/
00013 //
00014 //   This file is part of SUMO.
00015 //   SUMO is free software: you can redistribute it and/or modify
00016 //   it under the terms of the GNU General Public License as published by
00017 //   the Free Software Foundation, either version 3 of the License, or
00018 //   (at your option) any later version.
00019 //
00020 /****************************************************************************/
00021 #ifndef ROVehicle_h
00022 #define ROVehicle_h
00023 
00024 
00025 // ===========================================================================
00026 // included modules
00027 // ===========================================================================
00028 #ifdef _MSC_VER
00029 #include <windows_config.h>
00030 #else
00031 #include <config.h>
00032 #endif
00033 
00034 #include <string>
00035 #include <iostream>
00036 #include <utils/common/SUMOTime.h>
00037 #include <utils/common/RGBColor.h>
00038 #include <utils/common/SUMOVehicleParameter.h>
00039 #include <utils/common/SUMOVTypeParameter.h>
00040 #include <utils/common/UtilExceptions.h>
00041 #include <utils/common/SUMOAbstractRouter.h>
00042 
00043 
00044 // ===========================================================================
00045 // class declarations
00046 // ===========================================================================
00047 class SUMOVTypeParameter;
00048 class RORouteDef;
00049 class OutputDevice;
00050 class ROEdge;
00051 
00052 
00053 // ===========================================================================
00054 // class definitions
00055 // ===========================================================================
00060 class ROVehicle {
00061 public:
00070     ROVehicle(const SUMOVehicleParameter& pars,
00071               RORouteDef* route, SUMOVTypeParameter* type) ;
00072 
00073 
00075     virtual ~ROVehicle() ;
00076 
00077 
00084     RORouteDef* getRouteDefinition() const {
00085         return myRoute;
00086     }
00087 
00088 
00095     const SUMOVTypeParameter* getType() const {
00096         return myType;
00097     }
00098 
00099 
00104     const std::string& getID() const {
00105         return myParameter.id;
00106     }
00107 
00108 
00113     SUMOTime getDepartureTime() const {
00114         return myParameter.depart;
00115     }
00116 
00117 
00119     SUMOReal getMaxSpeed() const;
00120 
00121 
00122     inline SUMOVehicleClass getVClass() const {
00123         return getType() != 0 ? getType()->vehicleClass : DEFAULT_VEH_CLASS;
00124     }
00125 
00126 
00140     void saveAllAsXML(SUMOAbstractRouter<ROEdge, ROVehicle> &router,
00141                       OutputDevice& os, OutputDevice* const altos,
00142                       OutputDevice* const typeos, bool withExitTimes) const;
00143 
00144 
00154     virtual ROVehicle* copy(const std::string& id, unsigned int depTime, RORouteDef* newRoute) ;
00155 
00156 
00157 protected:
00159     SUMOVehicleParameter myParameter;
00160 
00162     SUMOVTypeParameter* myType;
00163 
00165     RORouteDef* myRoute;
00166 
00167 
00168 private:
00170     ROVehicle(const ROVehicle& src);
00171 
00173     ROVehicle& operator=(const ROVehicle& src);
00174 
00175 };
00176 
00177 
00178 #endif
00179 
00180 /****************************************************************************/
00181 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines