NBCapacity2Lanes Class Reference

#include <NBCapacity2Lanes.h>


Detailed Description

A helper class which computes the lane number from given capacity.

A helper class for the computation of the number of lanes an edge has in dependence to this edge's capacity. The computation is done by the (trivial) assumption, the number of lanes increases linear with the number of lanes.

Definition at line 45 of file NBCapacity2Lanes.h.


Public Member Functions

int get (SUMOReal capacity) const throw ()
 Returns the number of lanes computed from the given capacity.
 NBCapacity2Lanes (SUMOReal divider) throw ()
 Donstructor.
 ~NBCapacity2Lanes () throw ()
 Destructor.

Private Attributes

SUMOReal myDivider
 The norming divider.

Constructor & Destructor Documentation

NBCapacity2Lanes::NBCapacity2Lanes ( SUMOReal  divider  )  throw () [inline]

Donstructor.

Parameters:
[in] divider Value for the norming divider

Definition at line 51 of file NBCapacity2Lanes.h.

00051 : myDivider(divider) { }

NBCapacity2Lanes::~NBCapacity2Lanes (  )  throw () [inline]

Destructor.

Definition at line 55 of file NBCapacity2Lanes.h.

00055 { }


Member Function Documentation

int NBCapacity2Lanes::get ( SUMOReal  capacity  )  const throw () [inline]

Returns the number of lanes computed from the given capacity.

Returns the esimtaed number of lanes by returning the given capacity divided by the norming divider given in the constructor.

Parameters:
[in] capacity The capacity to convert
Returns:
The capacity converted to the number of lanes

Definition at line 66 of file NBCapacity2Lanes.h.

References myDivider.

Referenced by NIImporter_VISUM::parse_Edges(), and NIImporter_VISUM::parse_Types().

00066                                              {
00067         capacity /= myDivider;
00068         if (capacity>(int) capacity) {
00069             capacity += 1;
00070         }
00071         // just assure that the number of lanes is not zero
00072         if (capacity==0) {
00073             capacity = 1;
00074         }
00075         return (int) capacity;
00076     }


Field Documentation

SUMOReal NBCapacity2Lanes::myDivider [private]

The norming divider.

Definition at line 80 of file NBCapacity2Lanes.h.

Referenced by get().


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

Generated on Wed May 5 00:06:50 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6