generate_dimensions(n,
method,
aspect_ratio,
area)
Static Method
| source code
|
n ... number of generated modules
method ... random generation method
aspect_ratio ... tuple (a, b), parameterizing aspect ratio
area ... tuple (a, b), parameterizing area
ndigits ... number of digits used for rounding
dimensions ... dictionary with n random generated dimensions
Generates random dimensions with n modules. For generation of random
benchmarks a variety of approaches can be used (determined by given
method). Area and aspect ratio of modules are limited by a tuple
(e.g., (1.3, 2.5)).
Following methods are possible:
'uniform' ... uniform distribution
'gauss' ... gauss distribution
'half-gauss' ... folded gauss distribution
'exponential' ... exponetial distribution
Combination of different methods possible to use a different
distribution for aspect ratio and area, respectively.
(e.g., 'uniform/gauss' -> uniform distribution for aspect ratio,
gauss distribution for area)
The meaning of the tuple (a, b, c) is as follows:
a ... the lower/left limit
b ... the upper/right limit
TODO: Depending on method, various parameters can be given for the
distribution. Currently predetermined parameters are used.
'uniform' ... lower limit, upper limit
'gauss/half-gauss' ... mu - mean value, sigma - standard deviation
'exponential' ... lambda
FUTURE IDEA: Implementing a flag random, which determines, if the
returned distributions are randomized or calculated (e.g., uniform
can mean: uniform random distribution or real uniform distribution,
such as range(1,10))
2nd FUTURE IDEA: Generating dimensions by randomizing not aspect ratio
and area, but width and height directly!!!
- Returns: dimensions
|