SUMO - Simulation of Urban MObility
SUMOVehicle.h
Go to the documentation of this file.
00001 /****************************************************************************/
00009 // Abstract base class for vehicle representations
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 SUMOVehicle_h
00023 #define SUMOVehicle_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 <vector>
00036 #include <utils/common/SUMOTime.h>
00037 #include <utils/common/SUMOAbstractRouter.h>
00038 #include <utils/common/SUMOVehicleParameter.h>
00039 
00040 
00041 // ===========================================================================
00042 // class declarations
00043 // ===========================================================================
00044 class MSVehicleType;
00045 class MSRoute;
00046 class MSEdge;
00047 class MSLane;
00048 class MSDevice;
00049 class MSPerson;
00050 
00051 typedef std::vector<const MSEdge*> MSEdgeVector;
00052 
00053 
00054 // ===========================================================================
00055 // class definitions
00056 // ===========================================================================
00061 class SUMOVehicle {
00062 public:
00064     virtual ~SUMOVehicle() {}
00065 
00069     virtual const std::string& getID() const = 0;
00070 
00074     virtual SUMOReal getPositionOnLane() const = 0;
00075 
00079     virtual SUMOReal getMaxSpeed() const = 0;
00080 
00084     virtual SUMOReal getSpeed() const = 0;
00085 
00089     virtual const MSVehicleType& getVehicleType() const = 0;
00090 
00092     virtual const MSRoute& getRoute() const = 0;
00093 
00101     virtual const MSEdge* succEdge(unsigned int nSuccs) const = 0;
00102 
00107     virtual SUMOReal adaptMaxSpeed(SUMOReal referenceSpeed) = 0;
00108 
00110     virtual bool replaceRouteEdges(const MSEdgeVector& edges, bool onInit = false) = 0;
00111 
00113     virtual bool replaceRoute(const MSRoute* route, bool onInit = false) = 0;
00114 
00124     virtual void reroute(SUMOTime t, SUMOAbstractRouter<MSEdge, SUMOVehicle> &router, bool withTaz = false) = 0;
00125 
00129     virtual SUMOReal getPreDawdleAcceleration() const = 0;
00130 
00135     virtual const MSEdge* getEdge() const = 0;
00136 
00141     virtual const SUMOVehicleParameter& getParameter() const = 0;
00142 
00148     virtual void onDepart() = 0;
00149 
00153     virtual bool isOnRoad() const = 0;
00154 
00158     virtual SUMOTime getDeparture() const = 0;
00159 
00163     virtual unsigned int getNumberReroutes() const = 0;
00164 
00168     virtual const std::vector<MSDevice*> &getDevices() const = 0;
00169 
00176     virtual void addPerson(MSPerson* person) = 0;
00177 
00184     virtual bool addStop(const SUMOVehicleParameter::Stop& stopPar, SUMOTime untilOffset=0) = 0;
00185 
00189     virtual bool isStopped() const = 0;
00190 
00191 
00192 };
00193 
00194 
00195 #endif
00196 
00197 /****************************************************************************/
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines