Package concert_orchestra :: Module compatibility_tree
[frames] | no frames]

Module compatibility_tree

source code

Classes
  CompatibilityBranch
Forms a relationship between the node and the clients it is related with.
  CompatibilityTree
Functions
 
create_compatibility_tree(implementation_nodes, concert_clients)
Checks off implementation node rules and matches them to potential clients fulfilling the required conditions (platform tuple, app, optionally name)
source code
 
prune_compatibility_tree(compatibility_tree, verbosity=False)
Recursive function that checks rule min/max allotments and prunes the compatibility tree.
source code
 
prune_resolvable_branches(compatibility_tree, verbosity) source code
 
prune_least_valuable_leaf(compatibility_tree, verbosity)
This should be only called on a tree with branches that have redundancy (i.e.
source code
 
print_branches(branches, name='Branches', indent='') source code
 
print_leaves(leaves, name='Leaves', indent='')
Pretty prints a list of clients (names only)
source code
Variables
  __package__ = 'concert_orchestra'
Function Details

create_compatibility_tree(implementation_nodes, concert_clients)

source code 

Checks off implementation node rules and matches them to potential clients fulfilling the required conditions (platform tuple, app, optionally name)

@param implementation node rules @type [node.Node]

Parameters:
  • concert_clients - name indexed dictionary of concert client information @type dic(str, concert_msgs.ConcertClient)

    @return list of tuples, each of which is a node and list of clients that satisfy requirements for that node. @rtype CompatibilityTree

prune_compatibility_tree(compatibility_tree, verbosity=False)

source code 

Recursive function that checks rule min/max allotments and prunes the compatibility tree. It assumes none are currently fixed, so pruning can happen anywhere.

@param branches listing compatible node - clients relationships @type [ CompatibilityBranch ]

prune_least_valuable_leaf(compatibility_tree, verbosity)

source code 

This should be only called on a tree with branches that have redundancy (i.e. more potential clients than required (specified by node.min).

Does this by scanning the subtree looking for the least visible leaf (client) not including those with visibility one.

It also grabs the branches that leaf is on, and there should multiple possible branches, and subsequently chooses to lock it down on the branch with the least redundancy, i.e. pruning it from the rest of the tree.

This makes sure that there are plenty of possible options to cover the branches that match this leaf but are not chosen.

@param subtree @type [CompatibilityBranch]

print_leaves(leaves, name='Leaves', indent='')

source code 

Pretty prints a list of clients (names only)

@param leaves @type [concert_msgs.ConcertClient]