SUMO - Simulation of Urban MObility
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
NGRandomNetBuilder.h
Go to the documentation of this file.
1
/****************************************************************************/
9
// Additional structures for building random nets
10
/****************************************************************************/
11
// SUMO, Simulation of Urban MObility; see http://sumo.sourceforge.net/
12
// Copyright (C) 2001-2012 DLR (http://www.dlr.de/) and contributors
13
/****************************************************************************/
14
//
15
// This file is part of SUMO.
16
// SUMO is free software: you can redistribute it and/or modify
17
// it under the terms of the GNU General Public License as published by
18
// the Free Software Foundation, either version 3 of the License, or
19
// (at your option) any later version.
20
//
21
/****************************************************************************/
22
#ifndef NGRandomNetBuilder_h
23
#define NGRandomNetBuilder_h
24
25
26
// ===========================================================================
27
// included modules
28
// ===========================================================================
29
#ifdef _MSC_VER
30
#include <
windows_config.h
>
31
#else
32
#include <
config.h
>
33
#endif
34
35
#include "
NGNet.h
"
36
#include <map>
37
38
39
// ===========================================================================
40
// class definitions
41
// ===========================================================================
46
class
TNeighbourDistribution
{
47
public
:
56
void
add
(
int
numNeighbours,
SUMOReal
ratio) ;
57
58
64
int
num
() ;
65
66
67
private
:
69
std::map<int, SUMOReal>
myNeighbours
;
70
71
};
72
73
80
class
NGRandomNetBuilder
{
81
public
:
92
NGRandomNetBuilder
(
NGNet
& net,
SUMOReal
minAngle,
SUMOReal
minDistance,
SUMOReal
maxDistance,
SUMOReal
connectivity,
93
int
numTries,
const
TNeighbourDistribution
& neighborDist) ;
94
95
96
102
void
createNet
(
int
numNodes) ;
103
104
105
private
:
110
void
removeOuterNode
(
NGNode
* node) ;
111
112
120
bool
checkAngles
(
NGNode
* node) ;
121
122
132
bool
canConnect
(
NGNode
* baseNode,
NGNode
* newNode) ;
133
134
142
bool
createNewNode
(
NGNode
* baseNode) ;
143
144
150
void
findPossibleOuterNodes
(
NGNode
* node) ;
151
152
153
private
:
155
NGNet
&
myNet
;
156
158
NGNodeList
myOuterNodes
;
159
161
NGEdgeList
myOuterLinks
;
162
163
// list of possible new connections
164
NGNodeList
myConNodes
;
165
166
168
169
171
SUMOReal
myMinLinkAngle
;
172
174
SUMOReal
myMinDistance
;
175
177
SUMOReal
myMaxDistance
;
178
180
SUMOReal
myConnectivity
;
182
183
185
int
myNumTries
;
186
188
int
myNumNodes
;
189
191
TNeighbourDistribution
myNeighbourDistribution
;
192
193
private
:
195
NGRandomNetBuilder
(
const
NGRandomNetBuilder
&);
196
198
NGRandomNetBuilder
&
operator=
(
const
NGRandomNetBuilder
&);
199
200
};
201
202
203
#endif
204
205
/****************************************************************************/
206
tmp
buildd
sumo-0.15.0~dfsg
src
netgen
NGRandomNetBuilder.h
Generated on Sun May 27 2012 14:52:08 for SUMO - Simulation of Urban MObility by
1.8.1