concurrency::RankerByCummulativeOutDegree Class Reference

#include <src/EFGraphVisitors.h>

Inheritance diagram for concurrency::RankerByCummulativeOutDegree:
Collaboration diagram for concurrency::RankerByCummulativeOutDegree:

Public Member Functions

 RankerByCummulativeOutDegree ()
 Constructor. More...
 
 ~RankerByCummulativeOutDegree () override
 Destructor. More...
 
bool visitEnter (DecisionNode &) const override
 
bool visit (DecisionNode &) override
 
bool visitLeave (DecisionNode &) const override
 
bool visitEnter (AlgorithmNode &) const override
 
bool visit (AlgorithmNode &node) override
 
void reset () override
 
void runThroughAdjacents (boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()
 

Additional Inherited Members

- Public Attributes inherited from concurrency::IGraphVisitor
int m_nodesSucceeded
 
int m_slotNum
 

Detailed Description

Definition at line 90 of file EFGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByCummulativeOutDegree::RankerByCummulativeOutDegree ( )
inline

Constructor.

Definition at line 93 of file EFGraphVisitors.h.

93  {
94  m_nodesSucceeded = 0;
95  m_slotNum = -1;
96  };
concurrency::RankerByCummulativeOutDegree::~RankerByCummulativeOutDegree ( )
inlineoverride

Destructor.

Definition at line 98 of file EFGraphVisitors.h.

98 {}

Member Function Documentation

void concurrency::RankerByCummulativeOutDegree::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 112 of file EFGraphVisitors.h.

void concurrency::RankerByCummulativeOutDegree::runThroughAdjacents ( boost::graph_traits< boost::ExecPlan >::vertex_descriptor  vertex,
boost::ExecPlan  graph 
)

Definition at line 209 of file EFGraphVisitors.cpp.

210  {
211  typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVB;
212  typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVE;
213 
214  for (boost::tie(itVB, itVE) = adjacent_vertices(vertex, graph); itVB != itVE; ++itVB) {
215  m_nodesSucceeded += 1;
216  runThroughAdjacents(*itVB, graph);
217  }
218 
219  }
void runThroughAdjacents(boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
bool concurrency::RankerByCummulativeOutDegree::visit ( DecisionNode )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 102 of file EFGraphVisitors.h.

102 {return true;}
bool concurrency::RankerByCummulativeOutDegree::visit ( AlgorithmNode node)
overridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 174 of file EFGraphVisitors.cpp.

174  {
175 
176  std::ifstream myfile;
177  myfile.open("InputExecutionPlan.graphml", std::ios::in);
178 
179  boost::ExecPlan execPlan;
180 
181  boost::dynamic_properties dp;
182  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
183  dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
184  dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
185  dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
186 
187  boost::read_graphml(myfile, execPlan, dp);
188 
189  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
191  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
192 
193  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
194  AlgoVertex v = *vp.first;
195  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
196  if (index[v] == node.getNodeName()) {
197  runThroughAdjacents(v,execPlan);
198  float rank = m_nodesSucceeded;
199  node.setRank(rank);
200  reset();
201  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
202  }
203  }
204 
205  return true;
206  }
T open(T...args)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
void runThroughAdjacents(boost::graph_traits< boost::ExecPlan >::vertex_descriptor vertex, boost::ExecPlan graph)
STL class.
bool concurrency::RankerByCummulativeOutDegree::visitEnter ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 100 of file EFGraphVisitors.h.

100 {return true;}
bool concurrency::RankerByCummulativeOutDegree::visitEnter ( AlgorithmNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 107 of file EFGraphVisitors.h.

107 {return true;}
bool concurrency::RankerByCummulativeOutDegree::visitLeave ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 104 of file EFGraphVisitors.h.

104 {return true;}

The documentation for this class was generated from the following files: