INET Framework for OMNeT++/OMNEST
CA::Path Class Reference

#include <CriticalnessAnalyzer.h>

List of all members.

Public Member Functions

 Path ()
double getCost ()
void setCost (double n_cost)
std::vector< std::string > & getPath ()
void addNode (std::string &node, double n_cost)
void removeLastNode ()
bool isInPath (std::string &node)

Private Attributes

std::vector< std::string > path
double cost

Detailed Description

Definition at line 85 of file CriticalnessAnalyzer.h.


Constructor & Destructor Documentation

CA::Path::Path ( ) [inline]

Definition at line 93 of file CriticalnessAnalyzer.h.

{path.clear(); cost = 0.0; }

Member Function Documentation

void CA::Path::addNode ( std::string &  node,
double  n_cost 
) [inline]

Definition at line 100 of file CriticalnessAnalyzer.h.

Referenced by CriticalnessAnalyzer::generatePaths(), and CriticalnessAnalyzer::initialize().

{path.push_back(node); cost += n_cost;}
double CA::Path::getCost ( ) [inline]

Definition at line 96 of file CriticalnessAnalyzer.h.

Referenced by CriticalnessAnalyzer::generatePaths(), and CA::operator<<().

{return cost;}
std::vector<std::string>& CA::Path::getPath ( ) [inline]

Definition at line 99 of file CriticalnessAnalyzer.h.

Referenced by CA::operator<<().

{return path;}
bool CA::Path::isInPath ( std::string &  node)

Definition at line 257 of file CriticalnessAnalyzer.cc.

Referenced by CriticalnessAnalyzer::generatePaths().

{
  for (std::vector<std::string>::iterator it = path.begin(); it!=path.end(); ++it)
  {
     if(node == *it)
      return true;
  }
  return false;
}
void CA::Path::removeLastNode ( ) [inline]

Definition at line 101 of file CriticalnessAnalyzer.h.

Referenced by CriticalnessAnalyzer::generatePaths().

{path.pop_back();}
void CA::Path::setCost ( double  n_cost) [inline]

Definition at line 97 of file CriticalnessAnalyzer.h.

Referenced by CriticalnessAnalyzer::generatePaths().

{cost = n_cost;}

Member Data Documentation

double CA::Path::cost [private]

Definition at line 90 of file CriticalnessAnalyzer.h.

Referenced by addNode(), getCost(), Path(), and setCost().

std::vector<std::string> CA::Path::path [private]

Definition at line 88 of file CriticalnessAnalyzer.h.

Referenced by addNode(), getPath(), isInPath(), Path(), and removeLastNode().


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