00001
00031 #ifndef adevs_lp_graph_h
00032 #define adevs_lp_graph_h
00033 #include <vector>
00034 #include <map>
00035
00036 namespace adevs
00037 {
00038
00046 class LpGraph
00047 {
00048 public:
00050 LpGraph():nodes(0){}
00052 void addEdge(int A, int B)
00053 {
00054 if (E.find(A) == E.end()
00055 && I.find(A) == I.end())
00056 nodes++;
00057 if (E.find(B) == E.end()
00058 && I.find(B) == I.end())
00059 nodes++;
00060 E[A].push_back(B);
00061 I[B].push_back(A);
00062 }
00064 int getLPCount() const { return nodes; }
00066 const std::vector<int>& getI(int B) { return I[B]; }
00068 const std::vector<int>& getE(int A) { return E[A]; }
00070 ~LpGraph(){}
00071 private:
00072
00073 int nodes;
00074
00075 std::map<int,std::vector<int> > E;
00076
00077 std::map<int,std::vector<int> > I;
00078 };
00079
00080 }
00081
00082 #endif