|
SUMO - Simulation of Urban MObility
|
A netgen-representation of a node. More...
#include <NGNode.h>
Public Member Functions | |
| void | addLink (NGEdge *link) throw () |
| Adds the given link to the internal list. | |
| NBNode * | buildNBNode (NBNetBuilder &nb) const throw (ProcessError) |
| Builds and returns this node's netbuild-representation. | |
| bool | connected (NGNode *node) const throw () |
| Returns whether the other node is connected. | |
| const std::string & | getID () const throw () |
| Returns this node's id. | |
| SUMOReal | getMaxNeighbours () throw () |
| Returns this node's maximum neighbour number. | |
| const Position & | getPosition () const throw () |
| Returns this node's position. | |
| NGNode (const std::string &id) throw () | |
| Constructor. | |
| NGNode (const std::string &id, int xID, int yID, bool amCenter) throw () | |
| Constructor. | |
| NGNode (const std::string &id, int xPos, int yPos) throw () | |
| Constructor. | |
| NGNode () throw () | |
| Constructor. | |
| void | removeLink (NGEdge *link) throw () |
| Removes the given link. | |
| bool | samePos (int xPos, int yPos) const throw () |
| Returns whether the node has the given position. | |
| void | setMaxNeighbours (SUMOReal value) throw () |
| Sets this node's maximum neighbour number. | |
| void | setX (SUMOReal x) throw () |
| Sets a new value for x-position. | |
| void | setY (SUMOReal y) throw () |
| Sets a new value for y-position. | |
| ~NGNode () throw () | |
| Destructor. | |
Private Attributes | |
| NGEdgeList | LinkList |
| List of connected links. | |
| bool | myAmCenter |
| Information whether this is the center of a cpider-net. | |
| std::string | myID |
| The id of the node. | |
| SUMOReal | myMaxNeighbours |
| The maximum number of neighbours. | |
| Position | myPosition |
| The position of the node. | |
| int | xID |
| Integer x-position (x-id) | |
| int | yID |
| Integer y-position (y-id) | |
Friends | |
| class | NGRandomNetBuilder |
| NGNode::NGNode | ( | ) | throw () |
Constructor.
Definition at line 53 of file NGNode.cpp.
| NGNode::NGNode | ( | const std::string & | id | ) | throw () |
| NGNode::NGNode | ( | const std::string & | id, |
| int | xPos, | ||
| int | yPos | ||
| ) | throw () |
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 61 of file NGNode.cpp.
| NGNode::NGNode | ( | const std::string & | id, |
| int | xID, | ||
| int | yID, | ||
| bool | amCenter | ||
| ) | throw () |
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 65 of file NGNode.cpp.
| NGNode::~NGNode | ( | ) | throw () |
| void NGNode::addLink | ( | NGEdge * | link | ) | throw () |
Adds the given link to the internal list.
| [in] | link | The link to add |
Definition at line 113 of file NGNode.cpp.
| NBNode * NGNode::buildNBNode | ( | NBNetBuilder & | nb | ) | const throw (ProcessError) |
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 79 of file NGNode.cpp.
References StringBijection< T >::get(), GeoConvHelper::getDefaultInstance(), OptionsCont::getOptions(), OptionsCont::getString(), OptionsCont::isSet(), 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 125 of file NGNode.cpp.
| const std::string& NGNode::getID | ( | ) | const throw () [inline] |
| SUMOReal NGNode::getMaxNeighbours | ( | ) | throw () [inline] |
Returns this node's maximum neighbour number.
Definition at line 112 of file NGNode.h.
References myMaxNeighbours.
Referenced by NGRandomNetBuilder::createNet().
| const Position& NGNode::getPosition | ( | ) | const throw () [inline] |
Returns this node's position.
Definition at line 103 of file NGNode.h.
References myPosition.
Referenced by NGRandomNetBuilder::checkAngles().
| void NGNode::removeLink | ( | NGEdge * | link | ) | throw () |
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 119 of file NGNode.cpp.
Referenced by NGEdge::~NGEdge().
| bool NGNode::samePos | ( | int | xPos, |
| int | yPos | ||
| ) | const throw () [inline] |
| void NGNode::setMaxNeighbours | ( | SUMOReal | value | ) | throw () [inline] |
Sets this node's maximum neighbour number.
| [in] | value | The new maximum neighbour number of the node |
Definition at line 121 of file NGNode.h.
References myMaxNeighbours.
Referenced by NGRandomNetBuilder::createNet(), and NGRandomNetBuilder::createNewNode().
| void NGNode::setX | ( | SUMOReal | x | ) | throw () [inline] |
Sets a new value for x-position.
| [in] | value | The new x-position of this node |
Definition at line 130 of file NGNode.h.
References myPosition, Position::set(), and Position::y().
Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().
| void NGNode::setY | ( | SUMOReal | y | ) | throw () [inline] |
Sets a new value for y-position.
| [in] | value | The new y-position of this node |
Definition at line 139 of file NGNode.h.
References myPosition, Position::set(), and Position::x().
Referenced by NGNet::createChequerBoard(), NGRandomNetBuilder::createNet(), NGRandomNetBuilder::createNewNode(), and NGNet::createSpiderWeb().
friend class NGRandomNetBuilder [friend] |
NGEdgeList NGNode::LinkList [private] |
List of connected links.
Definition at line 207 of file NGNode.h.
Referenced by NGRandomNetBuilder::createNet(), and ~NGNode().
bool NGNode::myAmCenter [private] |
std::string NGNode::myID [private] |
SUMOReal NGNode::myMaxNeighbours [private] |
The maximum number of neighbours.
Definition at line 216 of file NGNode.h.
Referenced by getMaxNeighbours(), and setMaxNeighbours().
Position NGNode::myPosition [private] |
The position of the node.
Definition at line 213 of file NGNode.h.
Referenced by getPosition(), setX(), and setY().
int NGNode::xID [private] |
int NGNode::yID [private] |