DiaDes  0.1
DIAgnosis of Discrete-Event System
GraphSearch.hh
Go to the documentation of this file.
1 #ifndef __DIADES__GRAPH__GRAPHSEARCH_HH_
2 #define __DIADES__GRAPH__GRAPHSEARCH_HH_
3 
4 
5 
6 namespace Diades
7 {
8  namespace Graph
9  {
10 
11 
12 
44  template<typename TIncidentEdges,
45  typename TOpposite,
46  typename TContainer,
47  typename TAccumulator,
48  typename TMark,
49  typename TSolution,
50  typename TPathCut>
52  {
53  public:
54 
55  typedef TContainer Container;
56  typedef TAccumulator Accumulator;
57  typedef TMark Mark;
58  typedef TIncidentEdges IncidentEdges;
59  typedef TOpposite Opposite;
60  typedef TSolution Solution;
61  typedef TPathCut PathCut;
62  typedef typename IncidentEdges::Graph Graph;
63  typedef typename IncidentEdges::Node Node;
64 
76  GraphSearch(Graph & graph, const Container & nodes,
77  const Opposite & opposite, Solution & s,
78  PathCut & cut, Accumulator & results):_updated(false),
79  _m(graph),
80  _graph(graph),
81  _nodes(nodes),
82  _opposite(opposite),
83  _s(s),
84  _cut(cut),
85  _results(results){}
86 
90  virtual ~GraphSearch(){}
91 
92 
100  const Accumulator & currentResults()
101  {
102  _updated = false;
103  return _results;
104  }
105 
106 \
111  virtual void initialize()
112  {
113  _results.clear();
114  _updated = false;
115  }
116 
123  bool updated() const {return _updated; }
124 
125 
126  protected:
127  bool _updated;
128  Mark _m;
129  Graph & _graph;
130  const Container & _nodes;
131  const Opposite & _opposite;
132  Solution & _s;
133  PathCut & _cut;
134  Accumulator & _results;
135  };
136  };
137 };
138 
139 #endif
140 
IncidentEdges::Node Node
Definition: GraphSearch.hh:63
const Container & _nodes
Definition: GraphSearch.hh:130
TIncidentEdges IncidentEdges
Definition: GraphSearch.hh:58
const Opposite & _opposite
Definition: GraphSearch.hh:131
IncidentEdges::Graph Graph
Definition: GraphSearch.hh:62
GraphSearch(Graph &graph, const Container &nodes, const Opposite &opposite, Solution &s, PathCut &cut, Accumulator &results)
Definition: GraphSearch.hh:76
const Accumulator & currentResults()
Definition: GraphSearch.hh:100
Namespace of the Diades project.
boost::adjacency_list Graph
Definition: ScaleFree.cc:9