concurrency::RankerByEccentricity Class Reference

#include <src/PRGraphVisitors.h>

Inheritance diagram for concurrency::RankerByEccentricity:
Collaboration diagram for concurrency::RankerByEccentricity:

Public Member Functions

 RankerByEccentricity ()
 Constructor. More...
 
 ~RankerByEccentricity () 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
 
- 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 171 of file PRGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByEccentricity::RankerByEccentricity ( )
inline

Constructor.

Definition at line 174 of file PRGraphVisitors.h.

174  {
175  m_nodesSucceeded = 0;
176  m_slotNum = -1;
177  };
concurrency::RankerByEccentricity::~RankerByEccentricity ( )
inlineoverride

Destructor.

Definition at line 179 of file PRGraphVisitors.h.

179 {}

Member Function Documentation

void concurrency::RankerByEccentricity::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 193 of file PRGraphVisitors.h.

bool concurrency::RankerByEccentricity::visit ( DecisionNode )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 183 of file PRGraphVisitors.h.

183 {return true;}
bool concurrency::RankerByEccentricity::visit ( AlgorithmNode node)
overridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 337 of file PRGraphVisitors.cpp.

337  {
338 
339  std::ifstream myfile;
340  myfile.open("Eccentricity.graphml", std::ios::in);
341 
342  boost::ExecPlan execPlan;
343 
344  boost::dynamic_properties dp;
345  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
346  dp.property("Eccentricity", boost::get(&boost::AlgoNodeStruct::m_eccentricity, execPlan));
347 
348  boost::read_graphml(myfile, execPlan, dp);
349 
350  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
352  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
353 
354  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
355  AlgoVertex v = *vp.first;
356  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
357  if (index[v] == node.getNodeName()) {
358  auto index_eccentricity = boost::get(&boost::AlgoNodeStruct::m_eccentricity, execPlan);
359  float rank = index_eccentricity[v];
360  node.setRank(rank);
361  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
362  }
363  }
364  return true;
365  }
T open(T...args)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
STL class.
bool concurrency::RankerByEccentricity::visitEnter ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 181 of file PRGraphVisitors.h.

181 {return true;}
bool concurrency::RankerByEccentricity::visitEnter ( AlgorithmNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 188 of file PRGraphVisitors.h.

188 {return true;}
bool concurrency::RankerByEccentricity::visitLeave ( DecisionNode ) const
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 185 of file PRGraphVisitors.h.

185 {return true;}

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