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