-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCellParams.h
86 lines (74 loc) · 2.44 KB
/
CellParams.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef CELLGENPARAMS_H
#define CELLGENPARAMS_H
#include <OgrePrerequisites.h>
struct CellParams
{
unsigned int _type;
int _seed;
Ogre::Real _segmentSize;
Ogre::Real _segmentDeviance;
unsigned int _degree;
Ogre::Real _degreeDeviance;
Ogre::Real _aspect;
Ogre::Real _snapSize;
Ogre::Real _buildingHeight;
Ogre::Real _buildingDeviance;
Ogre::Real _roadWidth;
size_t _roadLimit;
Ogre::Real _connectivity;
Ogre::Real _pavementWidth;
Ogre::Real _pavementHeight;
Ogre::Real _lotWidth;
Ogre::Real _lotDepth;
Ogre::Real _lotDeviance;
bool _debug;
bool _mcbDebug;
CellParams(unsigned int type, int seed, Ogre::Real segmentSize,
Ogre::Real segmentDeviance, unsigned int degree, Ogre::Real degreeDeviance, Ogre::Real aspect,
Ogre::Real snapSize, Ogre::Real buildingHeight,
Ogre::Real buildingDeviance, Ogre::Real roadWidth, size_t roadLimit,
Ogre::Real connectivity, Ogre::Real pavementWidth, Ogre::Real pavementHeight,
Ogre::Real lotWidth, Ogre::Real lotDepth, Ogre::Real lotDeviance, bool debug, bool mcbDebug = false)
{
_type = type;
_seed = seed;
_segmentSize = segmentSize;
_segmentDeviance = segmentDeviance;
_degree = degree;
_degreeDeviance = degreeDeviance;
_aspect = aspect;
_snapSize = snapSize;
_buildingHeight = buildingHeight;
_buildingDeviance = buildingDeviance;
_roadWidth = roadWidth;
_roadLimit = roadLimit;
_connectivity = connectivity;
_pavementWidth = pavementWidth;
_pavementHeight = pavementHeight;
_lotWidth = lotWidth;
_lotDepth = lotDepth;
_lotDeviance = lotDeviance;
_debug = debug;
_mcbDebug = mcbDebug;
}
CellParams()
{
*this = MANHATTAN;
//TODO: this is a short term hack, Manhattan may not be initialised by the time it is used. DANGER
_seed = 1;
}
static const CellParams MANHATTAN;
static const CellParams SUBURBIA;
static const CellParams INDUSTRIAL;
};
// TODO: should have a number of random generators defined and maybe a
// simple parameter to try different distributions
// includes for rand functions
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/variate_generator.hpp>
// typedefs for random number generator.
typedef boost::minstd_rand base_generator_type;
typedef boost::variate_generator<base_generator_type&, boost::uniform_real<> > rando;
#endif