|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00007 // ------------------- 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 NIVissimNodeCluster_h 00020 #define NIVissimNodeCluster_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 <map> 00033 #include <utils/common/VectorHelper.h> 00034 #include <utils/geom/Position.h> 00035 00036 00037 // =========================================================================== 00038 // class declarations 00039 // =========================================================================== 00040 class NBNode; 00041 class NBNodeCont; 00042 class NBEdgeCont; 00043 class NBDistrictCont; 00044 00045 00046 // =========================================================================== 00047 // class definitions 00048 // =========================================================================== 00052 class NIVissimNodeCluster { 00053 public: 00054 NIVissimNodeCluster(int id, int nodeid, int tlid, 00055 const IntVector& connectors, 00056 const IntVector& disturbances, 00057 bool amEdgeSplitOnly); 00058 ~NIVissimNodeCluster(); 00059 int getID() const { 00060 return myID; 00061 } 00062 void buildNBNode(NBNodeCont& nc); 00063 bool recheckEdgeChanges(); 00064 NBNode* getNBNode() const; 00065 Position getPos() const; 00066 std::string getNodeName() const; 00067 00068 00069 public: 00070 static bool dictionary(int id, NIVissimNodeCluster* o); 00071 static int dictionary(int nodeid, int tlid, const IntVector& connectors, 00072 const IntVector& disturbances, bool amEdgeSplitOnly); 00073 static NIVissimNodeCluster* dictionary(int id); 00074 static size_t contSize(); 00075 static void assignToEdges(); 00076 static void buildNBNodes(NBNodeCont& nc); 00077 static void dict_recheckEdgeChanges(); 00078 static int getFromNode(int edgeid); 00079 static int getToNode(int edgeid); 00080 static void _debugOut(std::ostream& into); 00081 static void dict_addDisturbances(NBDistrictCont& dc, 00082 NBNodeCont& nc, NBEdgeCont& ec); 00083 static void clearDict(); 00084 static void setCurrentVirtID(int id); 00085 00086 00087 private: 00088 00089 int myID; 00090 int myNodeID; 00091 int myTLID; 00092 IntVector myConnectors; 00093 IntVector myDisturbances; 00094 Position myPosition; 00095 typedef std::map<int, NIVissimNodeCluster*> DictType; 00096 static DictType myDict; 00097 static int myCurrentID; 00098 NBNode* myNBNode; 00099 bool myAmEdgeSplit; 00100 00101 }; 00102 00103 00104 #endif 00105 00106 /****************************************************************************/ 00107