The Gaudi Framework  v28r3 (cc1cf868)
concurrency::RankerByEccentricity Class Reference

#include <src/PRGraphVisitors.h>

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

Public Member Functions

 RankerByEccentricity ()
 Constructor. More...
 
bool visit (AlgorithmNode &node) override
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()=default
 
virtual bool visitEnter (DecisionNode &) const
 
virtual bool visit (DecisionNode &)
 
virtual bool visitEnter (AlgorithmNode &) const
 
virtual bool visitEnter (DataNode &) const
 
virtual bool visit (DataNode &)
 
virtual void reset ()
 

Additional Inherited Members

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

Detailed Description

Definition at line 102 of file PRGraphVisitors.h.

Constructor & Destructor Documentation

concurrency::RankerByEccentricity::RankerByEccentricity ( )
inline

Constructor.

Definition at line 105 of file PRGraphVisitors.h.

105  {
106  m_nodesSucceeded = 0;
107  m_slot = nullptr;
108  };

Member Function Documentation

bool concurrency::RankerByEccentricity::visit ( AlgorithmNode node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 278 of file PRGraphVisitors.cpp.

278  {
279 
280  std::ifstream myfile;
281  myfile.open("Eccentricity.graphml", std::ios::in);
282 
283  boost::ExecPlan execPlan;
284 
285  boost::dynamic_properties dp;
286  dp.property("name", boost::get(&boost::AlgoNodeStruct::m_name, execPlan));
287  dp.property("Eccentricity", boost::get(&boost::AlgoNodeStruct::m_eccentricity, execPlan));
288 
289  boost::read_graphml(myfile, execPlan, dp);
290 
291  typedef boost::graph_traits<boost::ExecPlan>::vertex_iterator itV;
293  typedef boost::graph_traits<boost::ExecPlan>::vertex_descriptor AlgoVertex;
294 
295  for (vp = boost::vertices(execPlan); vp.first != vp.second; ++vp.first) {
296  AlgoVertex v = *vp.first;
297  auto index = boost::get(&boost::AlgoNodeStruct::m_name, execPlan);
298  if (index[v] == node.getNodeName()) {
299  auto index_eccentricity = boost::get(&boost::AlgoNodeStruct::m_eccentricity, execPlan);
300  float rank = index_eccentricity[v];
301  node.setRank(rank);
302  //std::cout << "Rank of " << index[v] << " is " << rank << std::endl;
303  }
304  }
305  return true;
306  }
T open(T...args)
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
graph_traits< ExecPlan >::vertex_descriptor AlgoVertex
STL class.

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