SUMO - Simulation of Urban MObility
NGRandomNetBuilder Class Reference

A class that builds random network using an algorithm by Markus Hartinger. More...

#include <NGRandomNetBuilder.h>

Public Member Functions

void createNet (int numNodes)
 Builds a NGNet using the set values.
 NGRandomNetBuilder (NGNet &net, SUMOReal minAngle, SUMOReal minDistance, SUMOReal maxDistance, SUMOReal connectivity, int numTries, const TNeighbourDistribution &neighborDist)
 Constructor.

Private Member Functions

bool canConnect (NGNode *baseNode, NGNode *newNode)
 Checks whether connecting the given two nodes complies with the set restrictions.
bool checkAngles (NGNode *node)
 Checks whether the angle of this node's connections are valid.
bool createNewNode (NGNode *baseNode)
 Creates new random node.
void findPossibleOuterNodes (NGNode *node)
 finds possible connections between Node and OuterNodes complying with restrictions
 NGRandomNetBuilder (const NGRandomNetBuilder &)
 Invalidated copy constructor.
NGRandomNetBuilderoperator= (const NGRandomNetBuilder &)
 Invalidated assignment operator.
void removeOuterNode (NGNode *node)
 Removes the given node from the list of outer nodes.

Private Attributes

NGNodeList myConNodes
TNeighbourDistribution myNeighbourDistribution
 The distrubtion of number of neighbours.
NGNetmyNet
 The network to fill.
int myNumNodes
 Number of nodes to be created.
int myNumTries
 Number of tries to create a new node.
NGEdgeList myOuterLinks
 The list of outer links.
NGNodeList myOuterNodes
 The list of outer nodes.
restrictions
SUMOReal myMinLinkAngle
 Minimum angle allowed between two links.
SUMOReal myMinDistance
 Minimum distance allowed between two nodes.
SUMOReal myMaxDistance
 Maximum distance allowed between two nodes.
SUMOReal myConnectivity
 Probability of connecting to a existing node if possible.

Detailed Description

A class that builds random network using an algorithm by Markus Hartinger.

Todo:
Describe the algorithm

Definition at line 80 of file NGRandomNetBuilder.h.


Constructor & Destructor Documentation

NGRandomNetBuilder::NGRandomNetBuilder ( NGNet net,
SUMOReal  minAngle,
SUMOReal  minDistance,
SUMOReal  maxDistance,
SUMOReal  connectivity,
int  numTries,
const TNeighbourDistribution neighborDist 
)

Constructor.

Parameters:
[in]netThe network to fill with generated structures
[in]minAngleThe minimum allowed angle between two streets
[in]minDistanceThe minimum allowed distance between two nodes
[in]maxDistanceThe maximum allowed distance between two nodes
[in]connectivityThe connectivity factor
[in]numTries?
Todo:
check meanings of connectivity/numTries

Definition at line 81 of file NGRandomNetBuilder.cpp.

Invalidated copy constructor.


Member Function Documentation

bool NGRandomNetBuilder::canConnect ( NGNode baseNode,
NGNode newNode 
) [private]

Checks whether connecting the given two nodes complies with the set restrictions.

Checks whether the distance, the angle, and the connectivity is within the defined range when both nodes would be connected

Parameters:
[in]baseNodeThe first node of the combination to check
[in]newNodeThe second node of the combination to check
Returns:
Whether the settings allow to connect both nodes

Definition at line 144 of file NGRandomNetBuilder.cpp.

References checkAngles(), GeomHelper::distancePointLine(), NGNode::getPosition(), GeomHelper::intersects(), myMaxDistance, myMinDistance, myOuterLinks, and SUMOReal.

Referenced by createNet(), createNewNode(), and findPossibleOuterNodes().

Checks whether the angle of this node's connections are valid.

Checks whether the connections of the nodes are in common with the value of myMinLinkAngle.

Parameters:
[in]nodeThe node to check connections of
Returns:
Whether the settings allow to connect both nodes

Definition at line 102 of file NGRandomNetBuilder.cpp.

References GeomHelper::Angle2D(), NGNode::getPosition(), NGNode::LinkList, myMinLinkAngle, SUMOReal, Position::x(), and Position::y().

Referenced by canConnect().

finds possible connections between Node and OuterNodes complying with restrictions

Parameters:
[in]node?
Todo:
Describe better

Definition at line 194 of file NGRandomNetBuilder.cpp.

References canConnect(), NGNode::connected(), NGNode::getMaxNeighbours(), NGNode::LinkList, myConNodes, and myOuterNodes.

Referenced by createNet().

NGRandomNetBuilder& NGRandomNetBuilder::operator= ( const NGRandomNetBuilder ) [private]

Invalidated assignment operator.

void NGRandomNetBuilder::removeOuterNode ( NGNode node) [private]

Removes the given node from the list of outer nodes.

Parameters:
[in]nodeThe node to remove

Definition at line 91 of file NGRandomNetBuilder.cpp.

References myOuterNodes.

Referenced by createNet(), and createNewNode().


Field Documentation

Probability of connecting to a existing node if possible.

Definition at line 180 of file NGRandomNetBuilder.h.

Referenced by createNet().

Maximum distance allowed between two nodes.

Definition at line 177 of file NGRandomNetBuilder.h.

Referenced by canConnect(), and createNewNode().

Minimum distance allowed between two nodes.

Definition at line 174 of file NGRandomNetBuilder.h.

Referenced by canConnect(), and createNewNode().

Minimum angle allowed between two links.

Definition at line 171 of file NGRandomNetBuilder.h.

Referenced by checkAngles().

The distrubtion of number of neighbours.

Definition at line 191 of file NGRandomNetBuilder.h.

Referenced by createNewNode().

The network to fill.

Definition at line 155 of file NGRandomNetBuilder.h.

Referenced by createNet(), and createNewNode().

Number of nodes to be created.

Definition at line 188 of file NGRandomNetBuilder.h.

Referenced by createNet().

Number of tries to create a new node.

Definition at line 185 of file NGRandomNetBuilder.h.

Referenced by createNet().

The list of outer links.

Definition at line 161 of file NGRandomNetBuilder.h.

Referenced by canConnect(), createNet(), and createNewNode().

The list of outer nodes.

Definition at line 158 of file NGRandomNetBuilder.h.

Referenced by createNet(), createNewNode(), findPossibleOuterNodes(), and removeOuterNode().


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