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

A Network class. More...

#include <Network.hpp>

Public Member Functions

 Network ()
 Constructor. More...
 
virtual ~Network ()
 Destructor. More...
 
const std::map< long, Link > & getLinks () const
 Returns the network's links. More...
 
void setLinks (const std::map< long, Link > &links)
 Setting the network's links. More...
 
const std::map< long, Node > & getNodes () const
 Return the network's nodes. More...
 
void setNodes (const std::map< long, Node > &nodes)
 Setting the network's nodes. More...
 
void addLinkOutToNode (long nodeId, long linkId)
 Add a link to the set of outgoing link of a node. More...
 
void addNode (Node aNode)
 Add a node to the network. More...
 
void addLink (Link aLink)
 Add a link to the network. More...
 
long getDestFromSource (long source_id, float dist)
 Compute the set of destination nodes at a given distance from a source node. More...
 
float getDistanceNodes (long source_id, long dest_id)
 Compute the distance between two nodes in the network. More...
 
float getMaxX () const
 Return the maximum x coordinate. More...
 
void setMaxX (float maxX)
 Set maximum x coordinate. More...
 
float getMaxY () const
 Return the maximum y coordinate. More...
 
void setMaxY (float maxY)
 Set maximum x coordinate. More...
 
float getMinX () const
 Return the minimum x coordinate. More...
 
void setMinX (float minX)
 Set minimum x coordinate. More...
 
float getMinY () const
 Return the minimum y coordinate. More...
 
void setMinY (float minY)
 Set minimum y coordinate. More...
 

Private Attributes

std::map< long, Node_Nodes
 Nodes of the network (see Node class) More...
 
std::map< long, Link_Links
 Links of the network (see Link class) More...
 
float min_x
 Minimum x coordinate. More...
 
float max_x
 Maximum x coordinate. More...
 
float min_y
 Minimum y coordinate. More...
 
float max_y
 Maximum y coordinate. More...
 

Detailed Description

A Network class.

This class implements a network consisting of a set of nodes and links. Refers to the Node and Link class for more informations.

Constructor & Destructor Documentation

Network::Network ( )
inline

Constructor.

virtual Network::~Network ( )
inlinevirtual

Destructor.

Member Function Documentation

void Network::addLink ( Link  aLink)

Add a link to the network.

/param aLink the node to add

void Network::addLinkOutToNode ( long  nodeId,
long  linkId 
)
inline

Add a link to the set of outgoing link of a node.

void Network::addNode ( Node  aNode)

Add a node to the network.

/param aNode the node to add

long Network::getDestFromSource ( long  source_id,
float  dist 
)

Compute the set of destination nodes at a given distance from a source node.

The computation of the node at a given distance +/- epsilon from a source node is done using a Dijkstra shortest path algorithm relying on a D-ary heap data structure.

The error term 'epsilon' can be increased since we can end up in an sparse area of the network (in term of node density) and it could then be impossible to find feasible nodes.

Parameters
source_idthe source node's id
distthe distance (in meters) desired between the source and the feasible destinations
Returns
a set of node at distance dist (in meters) from the source node
float Network::getDistanceNodes ( long  source_id,
long  dest_id 
)

Compute the distance between two nodes in the network.

Parameters
source_idsource node
dest_iddestination node
Returns
a distance between the source and destination nodes
const std::map<long, Link>& Network::getLinks ( ) const
inline

Returns the network's links.

Returns
the network's map <links id, links>
float Network::getMaxX ( ) const
inline

Return the maximum x coordinate.

Returns
maximum x coordinate
float Network::getMaxY ( ) const
inline

Return the maximum y coordinate.

Returns
maximum y coordinate
float Network::getMinX ( ) const
inline

Return the minimum x coordinate.

Returns
minimum x coordinate
float Network::getMinY ( ) const
inline

Return the minimum y coordinate.

Returns
minimum y coordinate
const std::map<long, Node>& Network::getNodes ( ) const
inline

Return the network's nodes.

Returns
the networks's map <nodes id, nodes>
void Network::setLinks ( const std::map< long, Link > &  links)
inline

Setting the network's links.

Parameters
linksa map of <links id, links>
void Network::setMaxX ( float  maxX)
inline

Set maximum x coordinate.

Parameters
maxXmaximum x coordinate
void Network::setMaxY ( float  maxY)
inline

Set maximum x coordinate.

Parameters
maxYmaximum y coordinate
void Network::setMinX ( float  minX)
inline

Set minimum x coordinate.

Parameters
minXminimum x coordinate
void Network::setMinY ( float  minY)
inline

Set minimum y coordinate.

Parameters
minYminimum y coordinate
void Network::setNodes ( const std::map< long, Node > &  nodes)
inline

Setting the network's nodes.

Parameters
nodesa map of <nodes id, nodes>

Member Data Documentation

std::map<long, Link> Network::_Links
private

Links of the network (see Link class)

std::map<long, Node> Network::_Nodes
private

Nodes of the network (see Node class)

float Network::max_x
private

Maximum x coordinate.

float Network::max_y
private

Maximum y coordinate.

float Network::min_x
private

Minimum x coordinate.

float Network::min_y
private

Minimum y coordinate.


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