Package dsc_suite :: Package tools :: Module benchmarks :: Class RandomBench
[hide private]
[frames] | no frames]

Class RandomBench

source code

object --+    
         |    
 Benchmark --+
             |
            RandomBench

class RandomBench(Benchmark) - generates random benchmark

Use this subclass to the basic Benchmark class to generate random benchmarks. Various approaches can be used (i.e., different distributions for both, area and aspect ratio of generated modules). Generation of a 2D benchmark.

Instance Methods [hide private]
 
__init__(n, method=10, aspect_ratio='uniform', area=(1, 2))
n ...
source code

Inherited from Benchmark: add_connections, get_blocks, get_connections, get_dimensions, get_status, join, load_benchmark, parse_benchmark_string, remove_blocks, remove_connections, rename_blocks, set_connections, to_3d

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
dimensions
generate_dimensions(n, method, aspect_ratio, area)
n ...
source code

Inherited from Benchmark: load_benchmark_file

Class Variables [hide private]

Inherited from Benchmark: CONNECTIONS, DIMENSIONS, MODULETYPE

Properties [hide private]

Inherited from Benchmark: blocks, connections, dimensions, status

Inherited from object: __class__

Method Details [hide private]

__init__(n, method=10, aspect_ratio='uniform', area=(1, 2))
(Constructor)

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

Generates random benchmark 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) is as follows:
a ... the lower/left limit
b ... the upper/right limit

Overrides: object.__init__

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