Package dsc_suite :: Package ds :: Module t_tree :: Class TTree
[hide private]
[frames] | no frames]

Class TTree

source code

                  object --+    
                           |    
data_structure.DataStructure --+
                               |
                              TTree

class TTree(DataStructure) - T-Tree implementation

t_tree format : [module_permutation, topology, module_rotations]

ternary tree topology is in a list format where each entry
represents a node. The index of the root node is also returned.        
panholzer = ([[LEFT, MIDDLE, RIGHT, PARENT, INTERNAL, DEPTH], ...], root)
topology = TT.transform_panholzer_to_topology(T, root)

rotations only 0 and 90 degrees    

TODO: detailed docstring,
      verification and rectification step needed after applying permutation operations 

Instance Methods [hide private]
 
__init__(self, benchmark)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
__UpdateContour(self, c, x1, x2, height)
insert into horizontal contour c ...
source code
 
__TreeDecomposition(self, n, S, H)
S ...
source code
 
__FindMaxX(self, n, L, H) source code
 
__PlaceModule(self, n, L, H, contour)
n ...
source code
 
__BinaryTreePacking(self, b_root, H, L) source code
 
__TreePacking(self, H)
Tree packing process described in [Yuh2009] H ...
source code
 
__CreateH(self, t_tree, dimensions)
DFS list structure used by t-tree packing algorithm.
source code
 
create_packing(self, representation)
Return packing in dict format.
source code
 
get_random_representation(self) source code
 
packing_to_representation(self, packing)
is not possible with every data structure
source code
 
get_operations(self)
returns a dict of possible operations onto a abstract representation {'name' : [function, globality_factor]} globality_factor ...
source code
 
merge_representations(self, representation_a, representation_b)
Merge two representations into all possible children.
source code
 
rotate_module(self, representation) source code
 
swap_two_modules(self, representation) source code
 
__decrease(self, value, boundary)
Decrease value by 1 if not None.
source code
 
__increase(self, value, boundary)
Increase value by 1 if not None.
source code
 
move_node_in_topology(self, representation) source code

Inherited from data_structure.DataStructure: __getitem__, convert_part_numbers, cost_evaluation, generate_solution_space, get_all_representations, get_part_numbers, get_part_of_representation, get_representation, set_benchmark

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

Class Variables [hide private]
  name = 'T-Tree'
  __H_NAME = 0
  __H_PARENT = 1
  __H_LEFT_CHILD = 2
  __H_MIDDLE_CHILD = 3
  __H_RIGHT_CHILD = 4
  __H_WIDTH = 5
  __H_HEIGHT = 6
  __H_DEPTH = 7
  __H_X = 8
  __H_Y = 9
  __H_Z = 10

Inherited from data_structure.DataStructure: CONNECTIONS, DIMENSIONS, MODULETYPE, ORIGINAL, ROTATED

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)

__UpdateContour(self, c, x1, x2, height)

source code 

insert into horizontal contour c ... contour, initially c = [[0,0]]

__TreeDecomposition(self, n, S, H)

source code 

S ... a stack n ... a node of T-Tree

__PlaceModule(self, n, L, H, contour)

source code 

n ... a node of a binary tree L ... a list to store nodes

__TreePacking(self, H)

source code 

Tree packing process described in [Yuh2009] H ... a T-Tree

__CreateH(self, t_tree, dimensions)

source code 

DFS list structure used by t-tree packing algorithm. H = [[name, parent, left, middle, right, width, height, depth, x, y, z], ...]

create_packing(self, representation)

source code 

Return packing in dict format.

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

Overrides: data_structure.DataStructure.create_packing

get_random_representation(self)

source code 
Overrides: data_structure.DataStructure.get_random_representation

packing_to_representation(self, packing)

source code 

is not possible with every data structure

Overrides: data_structure.DataStructure.packing_to_representation
(inherited documentation)

get_operations(self)

source code 

returns a dict of possible operations onto a abstract representation {'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.

Overrides: data_structure.DataStructure.get_operations

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.

In case of T-Tree all possible combinations of the module permutations, topologies second and rotations are generated. Rotations are currently completely taken from representation a or b, respectively. Thus 2^3 different children are possible.

Overrides: data_structure.DataStructure.merge_representations