Package dsc_suite :: Package ds :: Module data_structure :: Class DataStructure
[hide private]
[frames] | no frames]

Class DataStructure

source code

object --+
         |
        DataStructure
Known Subclasses:

class DataStructure() - defines basic data structure interface

Used by Optimization Algorithms to access the implemented data
structure subclasses. The needed module data is obtained using the
Benchmark class. 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.

Instance Methods [hide private]
 
__init__(self, benchmark)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set_benchmark(benchmark)
benchmark ...
source code
abstract_solutions
get_all_representations()
abstract_solutions ...
source code
 
get_part_of_representation(self, part_index, part_number)
get a single element out of a part of the abstract representation, part_number between 0 and part_lengths[part_index]
source code
 
get_representation(self, number)
number ranges between 0 and num_representations-1 global mapping method to get a specific representation out of all the abstract representations.
source code
 
get_part_numbers(self, number) source code
 
convert_part_numbers(self, part_numbers) source code
 
__getitem__(self, key) source code
 
get_random_representation(self) source code
 
generate_solution_space(self)
OBSOLETE!!!
source code
 
create_packing(self, representation)
returns packing in dict format packing = {'name' : [x, y, z, w, h, d], ...
source code
 
packing_to_representation(self, packing)
is not possible with every data structure
source code
 
cost_evaluation(self, representation, criteria=['MPMWE', 'HESA'], return_packing=False)
Calculate and return costs of current representation applied to benchmark.
source code
 
get_operations(self)
returns a dict of possible operations onto a abstract solution {'name' : [function, globality_factor]} globality_factor ...
source code
 
merge_representations(self, representation_a, representation_b)
Merge two representations into all possible children.
source code

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

Static Methods [hide private]
 
__abstract()
static helper method to implement abstract methods
Class Variables [hide private]
  MODULETYPE = 0
  DIMENSIONS = 1
  CONNECTIONS = 2
  ORIGINAL = 0
  ROTATED = 1
  name = 'Data Structure'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, benchmark)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set_benchmark(benchmark)

source code 

benchmark ... sets benchmark which is currently used

Loading benchmark into data structure. So all the important informations (e.g., number of modules, dimensions, ...) can be used.

get_all_representations()

source code 

abstract_solutions ... list of all possible abstract solutions

This method generates all possible abstract solutions. The returned format is strongy dependend on the underlying data structure. When benchmarks with a big number of modules is loaded very long computation and intense memory and processor usage can occur!

Returns: abstract_solutions

get_representation(self, number)

source code 

number ranges between 0 and num_representations-1 global mapping method to get a specific representation out of all the abstract representations. Not optimal, cause its used very often to generate the solution space. So take care!

generate_solution_space(self)

source code 

OBSOLETE!!!

assuming seperate lists, sequences, etc. (e.g., representations = (locii1_permutations, locii2_permutations)) so that a for each element in each part of the datastructrure the combination which each other element combination of the other parts is assumed to be the abstract_solution. This is done due to lower memory usage.

create_packing(self, representation)

source code 

returns packing in dict format packing = {'name' : [x, y, z, w, h, d], ...}

cost_evaluation(self, representation, criteria=['MPMWE', 'HESA'], return_packing=False)

source code 

Calculate and return costs of current representation applied to benchmark.

criteria ... cost evaluation criteria to calculate, list return_packing ... if True also return packing costs ... return a list of costs

This pre-implemented cost_evaluation can be used data structure independent. But for some specific data structures it could be possible to optimize the evaluation by using internal information.

Supported criteria listed in COST_CRITERIA_LIST. Short names are used. Parameter criteria is in list format.

!!Instead of changing calculation of existent criteria, add a new one!!

Weights and cost factors have to be implemented inside optimization.

get_operations(self)

source code 

returns a dict of possible operations onto a abstract solution {'name' : [function, globality_factor]} globality_factor ... the higher, the bigger is the solution change this factor is given by the authors but it also can be determined in test runs evaluation the cost influences caused by applying the according function.

merge_representations(self, representation_a, representation_b)

source code 

Merge two representations into all possible children.

Typically, used for genetic and/or evolutionary algorithms. Returns a list with all possible children.