SUMO - Simulation of Urban MObility
NBCapacity2Lanes.h
Go to the documentation of this file.
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3
// Copyright (C) 2001-2017 German Aerospace Center (DLR) and others.
4
/****************************************************************************/
5
//
6
// This program and the accompanying materials
7
// are made available under the terms of the Eclipse Public License v2.0
8
// which accompanies this distribution, and is available at
9
// http://www.eclipse.org/legal/epl-v20.html
10
//
11
/****************************************************************************/
18
// A helper class which computes the lane number from given capacity
19
/****************************************************************************/
20
#ifndef NBCapacity2Lanes_h
21
#define NBCapacity2Lanes_h
22
23
24
// ===========================================================================
25
// included modules
26
// ===========================================================================
27
#ifdef _MSC_VER
28
#include <
windows_config.h
>
29
#else
30
#include <
config.h
>
31
#endif
32
33
34
// ===========================================================================
35
// class definitions
36
// ===========================================================================
46
class
NBCapacity2Lanes
{
47
public
:
52
NBCapacity2Lanes
(
double
divider) :
myDivider
(divider) { }
53
54
56
~NBCapacity2Lanes
() { }
57
58
67
int
get
(
double
capacity)
const
{
68
capacity /=
myDivider
;
69
if
(capacity > (
int
) capacity) {
70
capacity += 1;
71
}
72
// just assure that the number of lanes is not zero
73
if
(capacity == 0) {
74
capacity = 1;
75
}
76
return
(
int
) capacity;
77
}
78
79
private
:
81
double
myDivider
;
82
83
};
84
85
86
#endif
87
88
/****************************************************************************/
89
windows_config.h
NBCapacity2Lanes
A helper class which computes the lane number from given capacity.
Definition:
NBCapacity2Lanes.h:46
config.h
NBCapacity2Lanes::~NBCapacity2Lanes
~NBCapacity2Lanes()
Destructor.
Definition:
NBCapacity2Lanes.h:56
NBCapacity2Lanes::myDivider
double myDivider
The norming divider.
Definition:
NBCapacity2Lanes.h:81
NBCapacity2Lanes::NBCapacity2Lanes
NBCapacity2Lanes(double divider)
Donstructor.
Definition:
NBCapacity2Lanes.h:52
src
netbuild
NBCapacity2Lanes.h
Generated on Fri Jun 29 2018 13:14:36 for SUMO - Simulation of Urban MObility by
1.8.13