SUMO - Simulation of Urban MObility
TNeighbourDistribution Class Reference

#include <NGRandomNetBuilder.h>

Public Member Functions

void add (int numNeighbours, SUMOReal ratio)
 adds a neighbour item to list More...
 
int num ()
 Get random number of neighbours. More...
 

Private Attributes

std::map< int, SUMORealmyNeighbours
 A map from neighbor number to their probabilities. More...
 

Detailed Description

Todo:
Check whether this can be replaced by RandomDistributor

Definition at line 46 of file NGRandomNetBuilder.h.

Member Function Documentation

void TNeighbourDistribution::add ( int  numNeighbours,
SUMOReal  ratio 
)

adds a neighbour item to list

If NumNeighbours is already existing, the old ratio is overwritten

Parameters
[in]numNeighboursThe number of neighbors this item shall describe
[in]ratioThe probability of this number of neighbors

Definition at line 52 of file NGRandomNetBuilder.cpp.

References myNeighbours.

Referenced by buildNetwork().

int TNeighbourDistribution::num ( )

Get random number of neighbours.

Returns
A random number of neighbors

Definition at line 58 of file NGRandomNetBuilder.cpp.

References myNeighbours, RandHelper::rand(), and SUMOReal.

Referenced by NGRandomNetBuilder::createNewNode().

Field Documentation

std::map<int, SUMOReal> TNeighbourDistribution::myNeighbours
private

A map from neighbor number to their probabilities.

Definition at line 69 of file NGRandomNetBuilder.h.

Referenced by add(), and num().


The documentation for this class was generated from the following files: