![]() |
Virtual Belgium
2.0
A micro-simulation platform for the Belgian population
|
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... | |
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).
|
inline |
Default Constructor.
| Node::Node | ( | long | id, |
| float | x, | ||
| float | y, | ||
| int | ins | ||
| ) |
Constructor.
| id | a node id |
| x | x coordinate |
| y | y coordinate |
| ins | ins code of node's municipality |
|
inlinevirtual |
Destructor.
| void Node::addIndicator | ( | std::string | aIndicator, |
| long | aIndicatorValue | ||
| ) |
Add an indicator and its value to the set of node's indicator.
| aIndicator | an indicator id |
| aIndicatorValue | the value associated with the indicator |
|
inline |
Add an link to the set of outgoing links.
| linkId | a link id |
|
inline |
Return the id of the node.
|
inline |
Get the index value (used by Dijkstra algorithm).
|
inline |
Return the indicators of the node.
|
inline |
Return the INS code of the node (corresponding to the municipality to which the node belongs).
|
inline |
Get the key value (used by Dijkstra algorithm).
|
inline |
Return the set of outgoing links of the node.
|
inline |
Return the x coordinate.
|
inline |
Return the y coordinate.
|
inline |
Overloading '<' operator.
Operator '<' compare nodes' key attribute.
/param aNode1 the first node /param aNode2 the second node
|
inline |
Overloading '>' operator.
Operator '>' compare nodes' key attribute.
/param aNode1 the first node /param aNode2 the second node
|
inline |
Set the id of the node.
| id | a new node id |
|
inline |
Set the index value (used by Dijkstra algorithm).
| index | a new index value |
|
inline |
Set the indicators of the node.
| indicators | a new map of services indicators |
|
inline |
Set the INS code of the node (corresponding to the municipality to which the node belongs).
| ins | a new ins code |
|
inline |
Setting the key value (used by Dijkstra algorithm).
| key | a new key value |
|
inline |
Setter for the set of outgoing links of the node.
| linksOutId | a new set of outgoing links id |
|
inline |
Set the x coordinate.
| x | a new node's x coordinate |
|
inline |
Set the y coordinate.
| y | a new node's y coordinate |
Overloading '<' operator.
Operator '<' compare nodes' key attribute.
/param aNode1 the first node /param aNode2 the second node
Overloading '>' operator.
Operator '>' compare nodes' key attribute.
/param aNode1 the first node /param aNode2 the second node
|
private |
id of the node.
|
private |
given the value of key, correspond to the index of a node inside a D-Heap
|
private |
a map of indicators related to the municipality to which the node belongs.
|
private |
ins code of the node, corresponding to the municipality to which the node belongs.
|
private |
key value of a node, corresponding to the distance between the node and a source one
|
private |
set of outgoing links.
|
private |
x coordinate.
|
private |
y coordinate.