|
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/common/VectorHelper.h> 00036 #include <utils/geom/AbstractPoly.h> 00037 #include <netbuild/NBConnection.h> 00038 #include "NIVissimExtendedEdgePoint.h" 00039 #include "NIVissimBoundedClusterObject.h" 00040 #include "NIVissimNodeParticipatingEdgeVector.h" 00041 00042 00043 // =========================================================================== 00044 // class declarations 00045 // =========================================================================== 00046 class NBNode; 00047 class NBEdge; 00048 class NBDistrictCont; 00049 00050 class NIVissimDisturbance 00051 : public NIVissimBoundedClusterObject { 00052 public: 00053 NIVissimDisturbance(int id, const std::string& name, 00054 const NIVissimExtendedEdgePoint& edge, 00055 const NIVissimExtendedEdgePoint& by, 00056 SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); 00057 virtual ~NIVissimDisturbance(); 00058 void computeBounding(); 00059 bool addToNode(NBNode* node, NBDistrictCont& dc, 00060 NBNodeCont& nc, NBEdgeCont& ec); 00061 int getEdgeID() const { 00062 return myEdge.getEdgeID(); 00063 } 00064 int getDisturbanceID() const { 00065 return myDisturbance.getEdgeID(); 00066 } 00067 NBConnection getConnection(NBNode* node, int aedgeid); 00068 00069 public: 00070 static bool dictionary(int id, const std::string& name, 00071 const NIVissimExtendedEdgePoint& edge, 00072 const NIVissimExtendedEdgePoint& by, 00073 SUMOReal timegap, SUMOReal waygap, SUMOReal vmax); 00074 static bool dictionary(int id, NIVissimDisturbance* o); 00075 static NIVissimDisturbance* dictionary(int id); 00076 static IntVector getWithin(const AbstractPoly& poly); 00077 static void clearDict(); 00078 static void dict_SetDisturbances(); 00079 static void reportRefused(); 00080 00081 private: 00082 int myID; 00083 int myNode; 00084 std::string myName; 00085 NIVissimExtendedEdgePoint myEdge; 00086 NIVissimExtendedEdgePoint myDisturbance; 00087 SUMOReal myTimeGap, myWayGap, myVMax; 00088 00089 typedef std::map<int, NIVissimDisturbance*> DictType; 00090 static DictType myDict; 00091 static int myRunningID; 00092 static int refusedProhibits; 00093 }; 00094 00095 00096 #endif 00097 00098 /****************************************************************************/ 00099