SUMO - Simulation of Urban MObility

RODFDetectorFlow.h

Go to the documentation of this file.
00001 /****************************************************************************/
00007 // missing_desc
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 RODFDetectorFlow_h
00020 #define RODFDetectorFlow_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 <utils/common/SUMOTime.h>
00033 #include <map>
00034 #include <string>
00035 #include <vector>
00036 
00037 
00038 // ===========================================================================
00039 // struct definitions
00040 // ===========================================================================
00045 struct FlowDef {
00046     // Number of passenger vehicles that passed within the described time
00047     SUMOReal qPKW;
00048     // Number of heavy duty vehicles that passed within the described time
00049     SUMOReal qLKW;
00050     // Mean velocity of passenger vehicles within the described time
00051     SUMOReal vPKW;
00052     // Mean velocity of heavy duty vehicles within the described time
00053     SUMOReal vLKW;
00054     // begin time (in s)
00055 //    int time;
00056     // probability for having a heavy duty vehicle(qKFZ!=0 ? (qLKW / qKFZ) : 0;)
00057     SUMOReal fLKW;
00058     // initialise with 0
00059     mutable SUMOReal isLKW;
00060     //
00061     bool firstSet;
00062 };
00063 
00064 
00065 // ===========================================================================
00066 // class definitions
00067 // ===========================================================================
00072 class RODFDetectorFlows {
00073 public:
00074     RODFDetectorFlows(SUMOTime startTime, SUMOTime endTime,
00075                       SUMOTime stepOffset);
00076     ~RODFDetectorFlows();
00077     void addFlow(const std::string& detector_id, SUMOTime timestamp,
00078                  const FlowDef& fd);
00079     void removeFlow(const std::string& detector_id);
00080     void setFlows(const std::string& detector_id, std::vector<FlowDef> &);
00081 
00082     const std::vector<FlowDef> &getFlowDefs(const std::string& id) const;
00083     bool knows(const std::string& det_id) const;
00084     SUMOReal getFlowSumSecure(const std::string& id) const;
00085     SUMOReal getMaxDetectorFlow() const;
00086     void printAbsolute() const;
00087 
00088     void mesoJoin(const std::string& nid, const std::vector<std::string> &oldids);
00089 
00090 protected:
00091     std::map<std::string, std::vector<FlowDef> > myFastAccessFlows;
00092     SUMOTime myBeginTime, myEndTime, myStepOffset;
00093     mutable SUMOReal myMaxDetectorFlow;
00094 
00095 private:
00097     RODFDetectorFlows(const RODFDetectorFlows& src);
00098 
00100     RODFDetectorFlows& operator=(const RODFDetectorFlows& src);
00101 
00102 };
00103 
00104 
00105 #endif
00106 
00107 /****************************************************************************/
00108 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines