Revision efed924d custompackages/graph-parser/src/sub_component.h

View differences:

custompackages/graph-parser/src/sub_component.h
11 11
#include <boost/graph/betweenness_centrality.hpp>
12 12
#include <boost/graph/copy.hpp>
13 13
#include "common.h"
14
#include "utility.h"
14 15

  
15 16
class SubComponent {
16
private:
17
    VertexVec art_points;
18
    VertexVec normal_vertices; // vertices that are not articulation points
19
    // std::vector<Vertex*> normal_vertices;
20
    // TODO: should this one be public?
21
    Graph subGraph;
22
    VertexMap weightMap;
23
    VertexMap weightReversedMap;
24

  
25
    StdVertexIndexMap v_index_std_map;
26
    VertexIndexMap v_index_map;
27
    vector<vector<int> > trafficMatrix;
28

  
29
    CentralityVec v_centrality_vec;
30
    CentralityMap v_centrality_map;
17
public:
18
    SubComponent();
19
    SubComponent(const StringSet art_points, const Graph sub_graph);
31 20

  
32
    // Traffic Matrix
21
    // Getter & Setter
22
    StringSet art_points() const;
23
    void set_art_points(StringSet& art_points);
33 24

  
34
    // Betweenness Centrality
25
    // Manipulating subGraph
26
    int num_vertices();
27
    void AddEdge(Router r1, Router r2, Link l);
28
    bool vertex_existed(string s);
29
    const Vertex& get_vertex_from_id(string s);
30
    Graph const& sub_graph() const;
35 31

  
36
public:
37
    SubComponent();
38
    // SubComponent(VertexVec art_points, Graph subGraph);
39
    SubComponent(const VertexVec art_points, const Graph subGraph);
32
    // Output to console
33
    friend std::ostream& operator<<(std::ostream& os, const SubComponent& sc);
40 34

  
41 35
    void init();
42 36

  
43
    // Getter
44
    VertexVec get_art_points();
45
    int num_vertices();
46 37

  
47 38
    // calculate Link Weight
48 39
    void _initialize_weight();
......
63 54
    void _initializeBetweennessCentrality();
64 55
    void findBetweennessCentrality();
65 56
    void printBetweennessCentrality();
57

  
58
private:
59
    StringSet art_points_;
60
    StringVec normal_vertices; // vertices that are not articulation points
61
    // std::vector<Vertex*> normal_vertices;
62
    // TODO: should this one be public?
63
    std::map<std::string, Vertex> name_vertex_map_;
64
    Graph sub_graph_;
65
    VertexMap weightMap;
66
    VertexMap weightReversedMap;
67

  
68
    StdVertexIndexMap v_index_std_map;
69
    VertexIndexMap v_index_map;
70
    vector<vector<int> > trafficMatrix;
71

  
72
    CentralityVec v_centrality_vec;
73
    CentralityMap v_centrality_map;
74

  
75
    // Traffic Matrix
76

  
77
    // Betweenness Centrality
66 78
};
67 79

  
68 80

  

Also available in: Unified diff