SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00009 // missing_desc 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 RODFDetectorFlow_h 00023 #define RODFDetectorFlow_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 <utils/common/SUMOTime.h> 00036 #include <map> 00037 #include <string> 00038 #include <vector> 00039 00040 00041 // =========================================================================== 00042 // struct definitions 00043 // =========================================================================== 00048 struct FlowDef { 00049 // Number of passenger vehicles that passed within the described time 00050 SUMOReal qPKW; 00051 // Number of heavy duty vehicles that passed within the described time 00052 SUMOReal qLKW; 00053 // Mean velocity of passenger vehicles within the described time 00054 SUMOReal vPKW; 00055 // Mean velocity of heavy duty vehicles within the described time 00056 SUMOReal vLKW; 00057 // begin time (in s) 00058 // int time; 00059 // probability for having a heavy duty vehicle(qKFZ!=0 ? (qLKW / qKFZ) : 0;) 00060 SUMOReal fLKW; 00061 // initialise with 0 00062 mutable SUMOReal isLKW; 00063 // 00064 bool firstSet; 00065 }; 00066 00067 00068 // =========================================================================== 00069 // class definitions 00070 // =========================================================================== 00075 class RODFDetectorFlows { 00076 public: 00077 RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime, 00078 SUMOTime stepOffset); 00079 ~RODFDetectorFlows(); 00080 void addFlow(const std::string& detector_id, SUMOTime timestamp, 00081 const FlowDef& fd); 00082 void removeFlow(const std::string& detector_id); 00083 void setFlows(const std::string& detector_id, std::vector<FlowDef> &); 00084 00085 const std::vector<FlowDef> &getFlowDefs(const std::string& id) const; 00086 bool knows(const std::string& det_id) const; 00087 SUMOReal getFlowSumSecure(const std::string& id) const; 00088 SUMOReal getMaxDetectorFlow() const; 00089 void printAbsolute() const; 00090 00091 void mesoJoin(const std::string& nid, const std::vector<std::string> &oldids); 00092 00093 protected: 00094 std::map<std::string, std::vector<FlowDef> > myFastAccessFlows; 00095 SUMOTime myBeginTime, myEndTime, myStepOffset; 00096 mutable SUMOReal myMaxDetectorFlow; 00097 00098 private: 00100 RODFDetectorFlows(const RODFDetectorFlows& src); 00101 00103 RODFDetectorFlows& operator=(const RODFDetectorFlows& src); 00104 00105 }; 00106 00107 00108 #endif 00109 00110 /****************************************************************************/ 00111