Home | Trees | Indices | Help |
---|
|
object --+ | Benchmark
class Benchmark() - encapsulating basic benchmark operations Use this class for benchmark format independent operations. E.g., use this class for random benchmark generation. This class currently handles only rectangluar blocks (i.e., storing only dimension informations of blocks). Benchmark status information is used to distinguish 2D/3D, rectangular/rectilinear, ... The most important variable is data, which stores the benchmark information. It's format is as following: data = {modulename : [moduletype, dimensions, connections] where dimensions is a list and connections is a dictionary.
|
|||
|
|||
data |
|
||
|
|||
status |
|
||
blocks |
|
||
|
|||
|
|||
dimensions |
|
||
connections |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
string |
|
|
|||
MODULETYPE = 0
|
|||
DIMENSIONS = 1
|
|||
CONNECTIONS = 2
|
|
|||
status get_status() -> status |
|||
blocks get_blocks() -> blocks |
|||
dimensions get_dimensions() -> dimensions |
|||
connections get_connections() -> connections |
|||
Inherited from |
|
data ... data from an external source status ... benchmark status dictionary Takes data and creates an own benchmark instance. data needs to be in the right format. No format testing is done! Example status = {'source' : 'YAL', 'name' : filename, 'number of dimensions' : 2, 'shape of modules' : 'rectangluar'}
|
filename ... benchmark file string ... string representation of benchmark file Loading benchmark file and reading content into a single string for further processing. (TODO: Exception handling)
|
text ... string representation of benchmark file data ... dictionary representation of benchmark Abstract method!!! Needs to be implemented in subclass. Parsing string representation of a SPECIFIC benchmark. data format: {modulename: [moduletype, dimensions, connections]}
|
filename ... benchmark file This method shall be executed in every __init__ of a file based benchmark (e.g., YAL). It loads the benchmark file and parses the content into the data variable, which then is accessible through several getter methods (e.g., get_blocks, get_dimensions) or by direct access (e.g., blocks, dimensions). |
status ... dictionary containing status information regarding benchmark status.keys() = ['source', 'name', 'number of dimensions', 'shapes of modules'] Getter method for the status dictionary.
|
blocks ... list of module names Getter method for getting a list of module names.
|
block_list ... list of block name tuples Renames blocks with a occurences in block_list. block_list format: [[a,b], [c,d], ...] Where a's new name would be b and c's new name d. If there was a b or before it will be overwritten without a warning. |
dimensions ... dictionary of module dimensions dimensions format: {'M1' : [X, Y, Z], ...} Getter method to a dictionary of module dimensions. Dimensions are floats. Returns a dictionary with dimensions corresponding to len(data[X][DIMENSIONS]) (i.e., 'number of dimensions').
|
connections ... dictionary of module connections connections format: {'MN' : connection weight factor, ...} Getter method to a dictionary of module connections. Returns a dictionary with connections to other any other module. Maybe it could be optimized removing nonexisting (i.e., weight == 0) connections.
|
benchmark ... benchmark which is added to current data Add new benchmark data to the current benchmark. Identical module names are renamed. Only benchmarks with the same dimensionalty can be merged. The resulting benchmark don't have connections between the modules of the different benchmarks. So, typically further connections should be added (e.g., using the random connection generator of the RandomBench class). |
z ... if integer: new z dimension of all modules Transforms a current 2D benchmark into a 3D benchmark. TODO: More versatile methods needs to be implemented. (e.g., randomized z-dimension, folded 2d, ...) |
|
statusget_status() -> status status ... dictionary containing status information regarding benchmark status.keys() = ['source', 'name', 'number of dimensions', 'shapes of modules'] Getter method for the status dictionary.
|
blocksget_blocks() -> blocks blocks ... list of module names Getter method for getting a list of module names.
|
dimensionsget_dimensions() -> dimensions dimensions ... dictionary of module dimensions dimensions format: {'M1' : [X, Y, Z], ...} Getter method to a dictionary of module dimensions. Dimensions are floats. Returns a dictionary with dimensions corresponding to len(data[X][DIMENSIONS]) (i.e., 'number of dimensions').
|
connectionsget_connections() -> connections connections ... dictionary of module connections connections format: {'MN' : connection weight factor, ...} Getter method to a dictionary of module connections. Returns a dictionary with connections to other any other module. Maybe it could be optimized removing nonexisting (i.e., weight == 0) connections.
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Wed Apr 27 17:47:09 2011 | http://epydoc.sourceforge.net |