SUMO - Simulation of Urban MObility

NGNode Class Reference

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

Detailed Description

A netgen-representation of a node.

Definition at line 54 of file NGNode.h.


Constructor & Destructor Documentation

NGNode::NGNode ( ) throw ()

Constructor.

Definition at line 53 of file NGNode.cpp.

NGNode::NGNode ( const std::string &  id) throw ()

Constructor.

Parameters:
[in]idThe id of the node

Definition at line 57 of file NGNode.cpp.

NGNode::NGNode ( const std::string &  id,
int  xPos,
int  yPos 
) throw ()

Constructor.

Parameters:
[in]idThe id of the node
[in]xPosThe x-position of the node
[in]yPosThe 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.

Parameters:
[in]idThe id of the node
[in]xPosThe x-position of the node
[in]yPosThe y-position of the node
[in]amCenterInformation whether this is the center-node of a spider-net

Definition at line 65 of file NGNode.cpp.

NGNode::~NGNode ( ) throw ()

Destructor.

Definition at line 69 of file NGNode.cpp.

References LinkList.


Member Function Documentation

void NGNode::addLink ( NGEdge *  link) throw ()

Adds the given link to the internal list.

Parameters:
[in]linkThe 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).

Parameters:
[in]nbThe netbuilder to retrieve the tls-container from
Returns:
The built node
Exceptions:
ProcessErrorIf the built tls logic could not be added (should never happen)
Todo:

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().

bool NGNode::connected ( NGNode *  node) const throw ()

Returns whether the other node is connected.

Parameters:
[in]nodeThe link to check whether it is connected
Returns:
Whether the given node is connected

Definition at line 125 of file NGNode.cpp.

const std::string& NGNode::getID ( ) const throw () [inline]

Returns this node's id.

Returns:
The id of the node

Definition at line 94 of file NGNode.h.

References myID.

SUMOReal NGNode::getMaxNeighbours ( ) throw () [inline]

Returns this node's maximum neighbour number.

Returns:
The maximum neighbour number of the node

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.

Returns:
The position of the node

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.

Parameters:
[in]linkThe 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]

Returns whether the node has the given position.

Parameters:
[in]nodeThe link to check whether it is connected
Returns:
Whether the given node is connected

Definition at line 192 of file NGNode.h.

void NGNode::setMaxNeighbours ( SUMOReal  value) throw () [inline]

Sets this node's maximum neighbour number.

Parameters:
[in]valueThe 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.

Parameters:
[in]valueThe 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.

Parameters:
[in]valueThe 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().


Friends And Related Function Documentation

friend class NGRandomNetBuilder [friend]

Definition at line 197 of file NGNode.h.


Field Documentation

List of connected links.

Definition at line 207 of file NGNode.h.

Referenced by NGRandomNetBuilder::createNet(), and ~NGNode().

Information whether this is the center of a cpider-net.

Definition at line 219 of file NGNode.h.

std::string NGNode::myID [private]

The id of the node.

Definition at line 210 of file NGNode.h.

Referenced by getID().

SUMOReal NGNode::myMaxNeighbours [private]

The maximum number of neighbours.

Definition at line 216 of file NGNode.h.

Referenced by getMaxNeighbours(), and setMaxNeighbours().

The position of the node.

Definition at line 213 of file NGNode.h.

Referenced by getPosition(), setX(), and setY().

int NGNode::xID [private]

Integer x-position (x-id)

Definition at line 201 of file NGNode.h.

int NGNode::yID [private]

Integer y-position (y-id)

Definition at line 204 of file NGNode.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines