|
SUMO - Simulation of Urban MObility
|
00001 /****************************************************************************/ 00008 // ------------------- 00009 /****************************************************************************/ 00010 // SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/ 00011 // Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors 00012 /****************************************************************************/ 00013 // 00014 // This file is part of SUMO. 00015 // SUMO is free software: you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation, either version 3 of the License, or 00018 // (at your option) any later version. 00019 // 00020 /****************************************************************************/ 00021 #ifndef NIVissimNodeCluster_h 00022 #define NIVissimNodeCluster_h 00023 00024 00025 // =========================================================================== 00026 // included modules 00027 // =========================================================================== 00028 #ifdef _MSC_VER 00029 #include <windows_config.h> 00030 #else 00031 #include <config.h> 00032 #endif 00033 00034 #include <map> 00035 #include <utils/common/VectorHelper.h> 00036 #include <utils/geom/Position.h> 00037 00038 00039 // =========================================================================== 00040 // class declarations 00041 // =========================================================================== 00042 class NBNode; 00043 class NBNodeCont; 00044 class NBEdgeCont; 00045 class NBDistrictCont; 00046 00047 00048 // =========================================================================== 00049 // class definitions 00050 // =========================================================================== 00054 class NIVissimNodeCluster { 00055 public: 00056 NIVissimNodeCluster(int id, int nodeid, int tlid, 00057 const IntVector& connectors, 00058 const IntVector& disturbances, 00059 bool amEdgeSplitOnly); 00060 ~NIVissimNodeCluster(); 00061 int getID() const { 00062 return myID; 00063 } 00064 void buildNBNode(NBNodeCont& nc); 00065 bool recheckEdgeChanges(); 00066 NBNode* getNBNode() const; 00067 Position getPos() const; 00068 std::string getNodeName() const; 00069 00070 00071 public: 00072 static bool dictionary(int id, NIVissimNodeCluster* o); 00073 static int dictionary(int nodeid, int tlid, const IntVector& connectors, 00074 const IntVector& disturbances, bool amEdgeSplitOnly); 00075 static NIVissimNodeCluster* dictionary(int id); 00076 static size_t contSize(); 00077 static void assignToEdges(); 00078 static void buildNBNodes(NBNodeCont& nc); 00079 static void dict_recheckEdgeChanges(); 00080 static int getFromNode(int edgeid); 00081 static int getToNode(int edgeid); 00082 static void _debugOut(std::ostream& into); 00083 static void dict_addDisturbances(NBDistrictCont& dc, 00084 NBNodeCont& nc, NBEdgeCont& ec); 00085 static void clearDict(); 00086 static void setCurrentVirtID(int id); 00087 00088 00089 private: 00090 00091 int myID; 00092 int myNodeID; 00093 int myTLID; 00094 IntVector myConnectors; 00095 IntVector myDisturbances; 00096 Position myPosition; 00097 typedef std::map<int, NIVissimNodeCluster*> DictType; 00098 static DictType myDict; 00099 static int myCurrentID; 00100 NBNode* myNBNode; 00101 bool myAmEdgeSplit; 00102 00103 }; 00104 00105 00106 #endif 00107 00108 /****************************************************************************/ 00109