|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // Abstract base class for vehicle representations 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 SUMOVehicle_h 00020 #define SUMOVehicle_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 <vector> 00033 #include <utils/common/SUMOTime.h> 00034 #include <utils/common/SUMOAbstractRouter.h> 00035 00036 00037 // =========================================================================== 00038 // class declarations 00039 // =========================================================================== 00040 class MSVehicleType; 00041 class MSRoute; 00042 class MSEdge; 00043 class MSLane; 00044 class MSDevice; 00045 class SUMOVehicleParameter; 00046 class MSPerson; 00047 00048 typedef std::vector<const MSEdge*> MSEdgeVector; 00049 00050 00051 // =========================================================================== 00052 // class definitions 00053 // =========================================================================== 00058 class SUMOVehicle { 00059 public: 00061 virtual ~SUMOVehicle() throw() {} 00062 00066 virtual const std::string& getID() const throw() = 0; 00067 00071 virtual SUMOReal getPositionOnLane() const throw() = 0; 00072 00076 virtual SUMOReal getMaxSpeed() const = 0; 00077 00081 virtual SUMOReal getSpeed() const throw() = 0; 00082 00086 virtual const MSVehicleType& getVehicleType() const = 0; 00087 00089 virtual const MSRoute& getRoute() const = 0; 00090 00098 virtual const MSEdge* succEdge(unsigned int nSuccs) const throw() = 0; 00099 00104 virtual SUMOReal adaptMaxSpeed(SUMOReal referenceSpeed) = 0; 00105 00107 virtual bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit=false) = 0; 00108 00110 virtual bool replaceRoute(const MSRoute* route, bool onInit=false) = 0; 00111 00121 virtual void reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle> &router, bool withTaz=false) throw() = 0; 00122 00126 virtual SUMOReal getPreDawdleAcceleration() const throw() = 0; 00127 00132 virtual const MSEdge* getEdge() const = 0; 00133 00138 virtual const SUMOVehicleParameter& getParameter() const throw() = 0; 00139 00145 virtual void onDepart() throw() = 0; 00146 00150 virtual bool isOnRoad() const throw() = 0; 00151 00155 virtual SUMOTime getDeparture() const throw() = 0; 00156 00160 virtual unsigned int getNumberReroutes() const throw() = 0; 00161 00165 virtual const std::vector<MSDevice*> &getDevices() const = 0; 00166 00173 virtual void addPerson(MSPerson* person) throw() = 0; 00174 00178 virtual bool isStopped() const = 0; 00179 00180 00181 }; 00182 00183 00184 #endif 00185 00186 /****************************************************************************/