SUMO - Simulation of Urban MObility
|
A netgen-representation of a node. More...
#include <NGNode.h>
Public Member Functions | |
void | addLink (NGEdge *link) |
Adds the given link to the internal list. More... | |
NBNode * | buildNBNode (NBNetBuilder &nb) const |
Builds and returns this node's netbuild-representation. More... | |
bool | connected (NGNode *node) const |
Returns whether the other node is connected. More... | |
const std::string & | getID () const |
Returns this node's id. More... | |
SUMOReal | getMaxNeighbours () |
Returns this node's maximum neighbour number. More... | |
const Position & | getPosition () const |
Returns this node's position. More... | |
NGNode () | |
Constructor. More... | |
NGNode (const std::string &id) | |
Constructor. More... | |
NGNode (const std::string &id, int xPos, int yPos) | |
Constructor. More... | |
NGNode (const std::string &id, int xID, int yID, bool amCenter) | |
Constructor. More... | |
void | removeLink (NGEdge *link) |
Removes the given link. More... | |
bool | samePos (int xPos, int yPos) const |
Returns whether the node has the given position. More... | |
void | setMaxNeighbours (SUMOReal value) |
Sets this node's maximum neighbour number. More... | |
void | setX (SUMOReal x) |
Sets a new value for x-position. More... | |
void | setY (SUMOReal y) |
Sets a new value for y-position. More... | |
~NGNode () | |
Destructor. More... | |
Private Attributes | |
NGEdgeList | LinkList |
List of connected links. More... | |
bool | myAmCenter |
Information whether this is the center of a cpider-net. More... | |
std::string | myID |
The id of the node. More... | |
SUMOReal | myMaxNeighbours |
The maximum number of neighbours. More... | |
Position | myPosition |
The position of the node. More... | |
int | xID |
Integer x-position (x-id) More... | |
int | yID |
Integer y-position (y-id) More... | |
Friends | |
class | NGRandomNetBuilder |
NGNode::NGNode | ( | ) |
Constructor.
Definition at line 57 of file NGNode.cpp.
NGNode::NGNode | ( | const std::string & | id | ) |
Constructor.
[in] | id | The id of the node |
[in] | xPos | The x-position of the node |
[in] | yPos | The y-position of the node |
Definition at line 65 of file NGNode.cpp.
Constructor.
[in] | id | The id of the node |
[in] | xPos | The x-position of the node |
[in] | yPos | The y-position of the node |
[in] | amCenter | Information whether this is the center-node of a spider-net |
Definition at line 69 of file NGNode.cpp.
NGNode::~NGNode | ( | ) |
void NGNode::addLink | ( | NGEdge * | link | ) |
Adds the given link to the internal list.
[in] | link | The link to add |
Definition at line 117 of file NGNode.cpp.
References LinkList.
Referenced by NGEdge::NGEdge().
NBNode * NGNode::buildNBNode | ( | NBNetBuilder & | nb | ) | const |
Builds and returns this node's netbuild-representation.
The position of the node is transformed to cartesian using GeoConvHelper::x2cartesian, first. If this node is the center node of a spider net, a node of the type NBNode::NODETYPE_NOJUNCTION is returned. Otherwise, a plain node is built and it is checked whether the options indicate building one of the tls node-types. In this case, a logic is built and stored. A ProcessError is thrown if this fails (should never happen, in fact).
[in] | nb | The netbuilder to retrieve the tls-container from |
ProcessError | If the built tls logic could not be added (should never happen) |
There is no interaction with explicit node setting options? Where is this done?
Check whether throwing an exception is really necessary, here
Definition at line 83 of file NGNode.cpp.
References StringBijection< T >::get(), OptionsCont::getOptions(), GeoConvHelper::getProcessing(), OptionsCont::getString(), NBNetBuilder::getTLLogicCont(), NBTrafficLightLogicCont::insert(), OptionsCont::isSet(), myAmCenter, myID, myPosition, NODETYPE_NOJUNCTION, NODETYPE_PRIORITY_JUNCTION, NODETYPE_TRAFFIC_LIGHT, SUMOXMLDefinitions::NodeTypes, and GeoConvHelper::x2cartesian().
Returns whether the other node is connected.
[in] | node | The link to check whether it is connected |
Definition at line 129 of file NGNode.cpp.
References LinkList.
Referenced by NGRandomNetBuilder::findPossibleOuterNodes().
|
inline |
Returns this node's id.
Definition at line 97 of file NGNode.h.
References myID.
Referenced by NGEdge::buildNBEdge(), and NGNet::connect().
|
inline |
Returns this node's maximum neighbour number.
Definition at line 115 of file NGNode.h.
References myMaxNeighbours.
Referenced by NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGRandomNetBuilder::findPossibleOuterNodes().
|
inline |
Returns this node's position.
Definition at line 106 of file NGNode.h.
References myPosition.
Referenced by NGRandomNetBuilder::canConnect(), NGRandomNetBuilder::checkAngles(), and NGRandomNetBuilder::createNewNode().
void NGNode::removeLink | ( | NGEdge * | link | ) |
Removes the given link.
The given pointer is compared to those in the list. A matching pointer is removed, not other same connections.
[in] | link | The link to remove |
Definition at line 123 of file NGNode.cpp.
References LinkList.
Referenced by NGEdge::~NGEdge().
|
inline |
Sets this node's maximum neighbour number.
[in] | value | The new maximum neighbour number of the node |
Definition at line 124 of file NGNode.h.
References myMaxNeighbours.
Referenced by NGRandomNetBuilder::createNet(), and NGRandomNetBuilder::createNewNode().
|
inline |
Sets a new value for x-position.
[in] | value | The new x-position of this node |
Definition at line 133 of file NGNode.h.
References myPosition, Position::set(), and Position::y().
Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().
|
inline |
Sets a new value for y-position.
[in] | value | The new y-position of this node |
Definition at line 142 of file NGNode.h.
References myPosition, Position::set(), and Position::x().
Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().
|
friend |
|
private |
List of connected links.
Definition at line 210 of file NGNode.h.
Referenced by addLink(), NGRandomNetBuilder::checkAngles(), connected(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), NGRandomNetBuilder::findPossibleOuterNodes(), removeLink(), and ~NGNode().
|
private |
Information whether this is the center of a cpider-net.
Definition at line 222 of file NGNode.h.
Referenced by buildNBNode().
|
private |
The id of the node.
Definition at line 213 of file NGNode.h.
Referenced by buildNBNode(), and getID().
|
private |
The maximum number of neighbours.
Definition at line 219 of file NGNode.h.
Referenced by getMaxNeighbours(), and setMaxNeighbours().
|
private |
The position of the node.
Definition at line 216 of file NGNode.h.
Referenced by buildNBNode(), getPosition(), setX(), and setY().