SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // Base class for a vehicle's route definition 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 RORouteDef_h 00022 #define RORouteDef_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/Named.h> 00037 #include "ReferencedItem.h" 00038 #include <utils/common/SUMOAbstractRouter.h> 00039 #include <utils/common/RGBColor.h> 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class ROEdge; 00046 class RORoute; 00047 class OptionsCont; 00048 class ROVehicle; 00049 class OutputDevice; 00050 00051 00052 // =========================================================================== 00053 // class definitions 00054 // =========================================================================== 00064 class RORouteDef : public ReferencedItem, public Named { 00065 public: 00071 RORouteDef(const std::string& id, const RGBColor* const color) ; 00072 00073 00075 virtual ~RORouteDef() ; 00076 00077 00080 RORoute* buildCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle> &router, SUMOTime begin, 00081 const ROVehicle& veh) const; 00082 00085 virtual void preComputeCurrentRoute(SUMOAbstractRouter<ROEdge, ROVehicle> &router, SUMOTime begin, 00086 const ROVehicle& veh) const = 0; 00087 00091 virtual void addAlternative(SUMOAbstractRouter<ROEdge, ROVehicle> &router, 00092 const ROVehicle* const, RORoute* current, SUMOTime begin) = 0; 00093 00095 virtual RORouteDef* copy(const std::string& id) const = 0; 00096 00098 const RGBColor* getColor() const { 00099 return myColor; 00100 } 00101 00102 virtual const ROEdge* getDestination() const = 0; 00103 00112 virtual OutputDevice& writeXMLDefinition(SUMOAbstractRouter<ROEdge, ROVehicle> &router, 00113 OutputDevice& dev, const ROVehicle* const veh, 00114 bool asAlternatives, bool withExitTimes) const = 0; 00115 00116 protected: 00117 const RGBColor* copyColorIfGiven() const ; 00118 00119 protected: 00121 const RGBColor* const myColor; 00122 00124 mutable RORoute* myPrecomputed; 00125 00126 private: 00128 RORouteDef(const RORouteDef& src); 00129 00131 RORouteDef& operator=(const RORouteDef& src); 00132 00133 }; 00134 00135 00136 #endif 00137 00138 /****************************************************************************/ 00139