Virtual Belgium  2.0
A micro-simulation platform for the Belgian population
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Pages
Node Class Reference

A node class. More...

#include <Network.hpp>

Public Member Functions

 Node ()
 Default Constructor. More...
 
 Node (long id, float x, float y, int ins)
 Constructor. More...
 
virtual ~Node ()
 Destructor. More...
 
long getId () const
 Return the id of the node. More...
 
void setId (long id)
 Set the id of the node. More...
 
int getIns () const
 Return the INS code of the node (corresponding to the municipality to which the node belongs). More...
 
void setIns (int ins)
 Set the INS code of the node (corresponding to the municipality to which the node belongs). More...
 
const std::vector< long > & getLinksOutId () const
 Return the set of outgoing links of the node. More...
 
void setLinksOutId (const std::vector< long > &linksOutId)
 Setter for the set of outgoing links of the node. More...
 
void addLinkOutId (long linkId)
 Add an link to the set of outgoing links. More...
 
float getKey () const
 Get the key value (used by Dijkstra algorithm). More...
 
void setKey (float key)
 Setting the key value (used by Dijkstra algorithm). More...
 
float getX () const
 Return the x coordinate. More...
 
void setX (float x)
 Set the x coordinate. More...
 
float getY () const
 Return the y coordinate. More...
 
void setY (float y)
 Set the y coordinate. More...
 
int getIndex () const
 Get the index value (used by Dijkstra algorithm). More...
 
void setIndex (int index)
 Set the index value (used by Dijkstra algorithm). More...
 
const std::map< std::string,
long > & 
getIndicators () const
 Return the indicators of the node. More...
 
void setIndicators (const std::map< std::string, long > &indicators)
 Set the indicators of the node. More...
 
void addIndicator (std::string aIndicator, long aIndicatorValue)
 Add an indicator and its value to the set of node's indicator. More...
 
bool operator< (Node &aNode)
 Overloading '<' operator. More...
 
bool operator> (Node &aNode)
 Overloading '>' operator. More...
 

Private Attributes

long _id
 id of the node. More...
 
float _x
 x coordinate. More...
 
float _y
 y coordinate. More...
 
int _ins
 ins code of the node, corresponding to the municipality to which the node belongs. More...
 
std::vector< long > _links_out_id
 set of outgoing links. More...
 
float _key
 key value of a node, corresponding to the distance between the node and a source one More...
 
int _index
 given the value of key, correspond to the index of a node inside a D-Heap More...
 
std::map< std::string, long > _indicators
 a map of indicators related to the municipality to which the node belongs. More...
 

Friends

bool operator< (const Node &aNode1, const Node &aNode2)
 Overloading '<' operator. More...
 
bool operator> (const Node &aNode1, const Node &aNode2)
 Overloading '>' operator. More...
 

Detailed Description

A node class.

This class intends to represents the nodes of a road network. Additionaly to the basic attributes (id, coordinates, outgoing links), some members of the node are related to the municipality to which it belongs (ins, indicators) and (key, index) and Dijkstra shortest path algorithm (key, index).

Constructor & Destructor Documentation

Node::Node ( )
inline

Default Constructor.

Node::Node ( long  id,
float  x,
float  y,
int  ins 
)

Constructor.

Parameters
ida node id
xx coordinate
yy coordinate
insins code of node's municipality
virtual Node::~Node ( )
inlinevirtual

Destructor.

Member Function Documentation

void Node::addIndicator ( std::string  aIndicator,
long  aIndicatorValue 
)

Add an indicator and its value to the set of node's indicator.

Parameters
aIndicatoran indicator id
aIndicatorValuethe value associated with the indicator
void Node::addLinkOutId ( long  linkId)
inline

Add an link to the set of outgoing links.

Parameters
linkIda link id
long Node::getId ( ) const
inline

Return the id of the node.

Returns
the node id
int Node::getIndex ( ) const
inline

Get the index value (used by Dijkstra algorithm).

Returns
node's index value
const std::map<std::string, long>& Node::getIndicators ( ) const
inline

Return the indicators of the node.

Returns
the map of node's service indicators used to geo-localize activities
int Node::getIns ( ) const
inline

Return the INS code of the node (corresponding to the municipality to which the node belongs).

Returns
a municipality ins code
float Node::getKey ( ) const
inline

Get the key value (used by Dijkstra algorithm).

Returns
node's key value
const std::vector<long>& Node::getLinksOutId ( ) const
inline

Return the set of outgoing links of the node.

Returns
a vector of link id
float Node::getX ( ) const
inline

Return the x coordinate.

Returns
x coordinate
float Node::getY ( ) const
inline

Return the y coordinate.

Returns
y coordinate
bool Node::operator< ( Node aNode)
inline

Overloading '<' operator.

Operator '<' compare nodes' key attribute.

/param aNode1 the first node /param aNode2 the second node

bool Node::operator> ( Node aNode)
inline

Overloading '>' operator.

Operator '>' compare nodes' key attribute.

/param aNode1 the first node /param aNode2 the second node

void Node::setId ( long  id)
inline

Set the id of the node.

Parameters
ida new node id
void Node::setIndex ( int  index)
inline

Set the index value (used by Dijkstra algorithm).

Parameters
indexa new index value
void Node::setIndicators ( const std::map< std::string, long > &  indicators)
inline

Set the indicators of the node.

Parameters
indicatorsa new map of services indicators
void Node::setIns ( int  ins)
inline

Set the INS code of the node (corresponding to the municipality to which the node belongs).

Parameters
insa new ins code
void Node::setKey ( float  key)
inline

Setting the key value (used by Dijkstra algorithm).

Parameters
keya new key value
void Node::setLinksOutId ( const std::vector< long > &  linksOutId)
inline

Setter for the set of outgoing links of the node.

Parameters
linksOutIda new set of outgoing links id
void Node::setX ( float  x)
inline

Set the x coordinate.

Parameters
xa new node's x coordinate
void Node::setY ( float  y)
inline

Set the y coordinate.

Parameters
ya new node's y coordinate

Friends And Related Function Documentation

bool operator< ( const Node aNode1,
const Node aNode2 
)
friend

Overloading '<' operator.

Operator '<' compare nodes' key attribute.

/param aNode1 the first node /param aNode2 the second node

bool operator> ( const Node aNode1,
const Node aNode2 
)
friend

Overloading '>' operator.

Operator '>' compare nodes' key attribute.

/param aNode1 the first node /param aNode2 the second node

Member Data Documentation

long Node::_id
private

id of the node.

int Node::_index
private

given the value of key, correspond to the index of a node inside a D-Heap

std::map<std::string,long> Node::_indicators
private

a map of indicators related to the municipality to which the node belongs.

int Node::_ins
private

ins code of the node, corresponding to the municipality to which the node belongs.

float Node::_key
private

key value of a node, corresponding to the distance between the node and a source one

std::vector<long> Node::_links_out_id
private

set of outgoing links.

float Node::_x
private

x coordinate.

float Node::_y
private

y coordinate.


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