concurrency::RankerByEccentricity Class Reference

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

Constructor & Destructor Documentation

concurrency::RankerByEccentricity::RankerByEccentricity ( )
inline

Constructor.

Definition at line 147 of file EFGraphVisitors.h.

147  {
148  m_nodesSucceeded = 0;
149  m_slotNum = -1;
150  };
concurrency::RankerByEccentricity::~RankerByEccentricity ( )
inlineoverride

Destructor.

Definition at line 152 of file EFGraphVisitors.h.

152 {}

Member Function Documentation

void concurrency::RankerByEccentricity::reset ( )
inlineoverridevirtual

Implements concurrency::IGraphVisitor.

Definition at line 166 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 156 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 255 of file EFGraphVisitors.cpp.

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

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

Implements concurrency::IGraphVisitor.

Definition at line 161 of file EFGraphVisitors.h.

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

Implements concurrency::IGraphVisitor.

Definition at line 158 of file EFGraphVisitors.h.

158 {return true;}

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