A Network class.
More...
#include <Network.hpp>
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.
| virtual Network::~Network |
( |
| ) |
|
|
inlinevirtual |
| 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_id | the source node's id |
| dist | the 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_id | source node |
| dest_id | destination 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
-
| links | a map of <links id, links> |
| void Network::setMaxX |
( |
float |
maxX | ) |
|
|
inline |
Set maximum x coordinate.
- Parameters
-
| void Network::setMaxY |
( |
float |
maxY | ) |
|
|
inline |
Set maximum x coordinate.
- Parameters
-
| void Network::setMinX |
( |
float |
minX | ) |
|
|
inline |
Set minimum x coordinate.
- Parameters
-
| void Network::setMinY |
( |
float |
minY | ) |
|
|
inline |
Set minimum y coordinate.
- Parameters
-
| void Network::setNodes |
( |
const std::map< long, Node > & |
nodes | ) |
|
|
inline |
Setting the network's nodes.
- Parameters
-
| nodes | a map of <nodes id, nodes> |
| 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)
The documentation for this class was generated from the following files:
- /home/johan/Documents/UNamur/VirtualBelgium/Workspace/VirtualBelgium/include/Network.hpp
- /home/johan/Documents/UNamur/VirtualBelgium/Workspace/VirtualBelgium/src/Network.cpp