concurrency::RankerByCummulativeOutDegree Class Reference

#include <src/PRGraphVisitors.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 117 of file PRGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByCummulativeOutDegree::RankerByCummulativeOutDegree ( )
inline

Constructor.

Definition at line 120 of file PRGraphVisitors.h.

120  {
121  m_nodesSucceeded = 0;
122  m_slotNum = -1;
123  };
concurrency::RankerByCummulativeOutDegree::~RankerByCummulativeOutDegree ( )
inlineoverride

Destructor.

Definition at line 125 of file PRGraphVisitors.h.

125 {}

Member Function Documentation

void concurrency::RankerByCummulativeOutDegree::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 139 of file PRGraphVisitors.h.

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

Definition at line 291 of file PRGraphVisitors.cpp.

292  {
293  typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVB;
294  typename boost::graph_traits<boost::ExecPlan>::adjacency_iterator itVE;
295 
296  for (boost::tie(itVB, itVE) = adjacent_vertices(vertex, graph); itVB != itVE; ++itVB) {
297  m_nodesSucceeded += 1;
298  runThroughAdjacents(*itVB, graph);
299  }
300 
301  }
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 129 of file PRGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 256 of file PRGraphVisitors.cpp.

256  {
257 
258  std::ifstream myfile;
259  myfile.open("InputExecutionPlan.graphml", std::ios::in);
260 
261  boost::ExecPlan execPlan;
262 
263  boost::dynamic_properties dp;
264  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
265  dp.property("index", boost::get(&boost::AlgoNodeStruct::m_index, execPlan));
266  dp.property("dataRank", boost::get(&boost::AlgoNodeStruct::m_rank, execPlan));
267  dp.property("runtime", boost::get(&boost::AlgoNodeStruct::m_runtime, execPlan));
268 
269  boost::read_graphml(myfile, execPlan, dp);
270 
271  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
273  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
274 
275  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
276  AlgoVertex v = *vp.first;
277  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
278  if (index[v] == node.getNodeName()) {
279  runThroughAdjacents(v,execPlan);
280  float rank = m_nodesSucceeded;
281  node.setRank(rank);
282  reset();
283  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
284  }
285  }
286 
287  return true;
288  }
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 127 of file PRGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 134 of file PRGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 131 of file PRGraphVisitors.h.

131 {return true;}

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