SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // ------------------- 00008 /****************************************************************************/ 00009 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00010 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00011 /****************************************************************************/ 00012 // 00013 // This file is part of SUMO. 00014 // SUMO is free software: you can redistribute it and/or modify 00015 // it under the terms of the GNU General Public License as published by 00016 // the Free Software Foundation, either version 3 of the License, or 00017 // (at your option) any later version. 00018 // 00019 /****************************************************************************/ 00020 #ifndef NIVissimDisturbance_h 00021 #define NIVissimDisturbance_h 00022 00023 00024 // =========================================================================== 00025 // included modules 00026 // =========================================================================== 00027 #ifdef _MSC_VER 00028 #include <windows_config.h> 00029 #else 00030 #include <config.h> 00031 #endif 00032 00033 #include <map> 00034 #include <string> 00035 #include <utils/geom/AbstractPoly.h> 00036 #include <netbuild/NBConnection.h> 00037 #include "NIVissimExtendedEdgePoint.h" 00038 #include "NIVissimBoundedClusterObject.h" 00039 #include "NIVissimNodeParticipatingEdgeVector.h" 00040 00041 00042 // =========================================================================== 00043 // class declarations 00044 // =========================================================================== 00045 class NBNode; 00046 class NBEdge; 00047 class NBDistrictCont; 00048 00049 class NIVissimDisturbance 00050 : public NIVissimBoundedClusterObject { 00051 public: 00052 NIVissimDisturbance(int id, const std::string& name, 00053 const NIVissimExtendedEdgePoint& edge, 00054 const NIVissimExtendedEdgePoint& by, 00055 SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); 00056 virtual ~NIVissimDisturbance(); 00057 void computeBounding(); 00058 bool addToNode(NBNode* node, NBDistrictCont& dc, 00059 NBNodeCont& nc, NBEdgeCont& ec); 00060 int getEdgeID() const { 00061 return myEdge.getEdgeID(); 00062 } 00063 int getDisturbanceID() const { 00064 return myDisturbance.getEdgeID(); 00065 } 00066 NBConnection getConnection(NBNode* node, int aedgeid); 00067 00068 public: 00069 static bool dictionary(int id, const std::string& name, 00070 const NIVissimExtendedEdgePoint& edge, 00071 const NIVissimExtendedEdgePoint& by, 00072 SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); 00073 static bool dictionary(int id, NIVissimDisturbance* o); 00074 static NIVissimDisturbance* dictionary(int id); 00075 static std::vector<int> getWithin(const AbstractPoly& poly); 00076 static void clearDict(); 00077 static void dict_SetDisturbances(); 00078 static void reportRefused(); 00079 00080 private: 00081 int myID; 00082 int myNode; 00083 std::string myName; 00084 NIVissimExtendedEdgePoint myEdge; 00085 NIVissimExtendedEdgePoint myDisturbance; 00086 SUMOReal myTimeGap, myWayGap, myVMax; 00087 00088 typedef std::map<int, NIVissimDisturbance*> DictType; 00089 static DictType myDict; 00090 static int myRunningID; 00091 static int refusedProhibits; 00092 }; 00093 00094 00095 #endif 00096 00097 /****************************************************************************/ 00098