bbsa

class bbsa.bbsa(settings)[source]

This class is the black box search algorithm. It contains the parse tree which is used to evaluate the bbsa.

altMutate()[source]

This is a mutation that selects a random node and randomizes the parameters of that node. Note: not all nodes have parameters that can be altered.

analyze(logs)[source]

This function is used to analyze the logs that are generated in the run function.

count()[source]

This function counts the number of nodes in the bbsa

createRandom(start=None)[source]

This function creates a random tree bounded by 2^(max depth) nodes. Note: since the majority of nodes are unary nodes the actual depth of the trees may exceed the maximum depth.

dominate(other)[source]

This function is/will be used to determin domination for a multi objective algorithm

duplicate()[source]

This function creates a copy of itself and updates the newly created object.

evaluate()[source]

This function evaluates the bbsa by running it a user specified number of times. The average number of evaluations and the average best fitness found are stored for use in calculating the fitness.

load(prog, parent=None, i=0)[source]

This function loads a bbsa into the parse tree structure from a dictionary that can be generated by the toDict() function.

makeProg()[source]

This function generates the code that is used for external verification. It generates code in a post-order fashion. This functions assumes that the structure of the algorithm has already been created

mate(other)[source]

This is the standard sub-tree crossover. This operation does not strictly keep the max depth that is set in the settings file. Meaning the resulting tree(s)’ depth may exceed the maximum depth.

mutate()[source]

This is the a sub-tree mutation where the amount of nodes added is bounded by a user defined value. This operation does not strictly keep the max depth that is set in the settings file. Meaning the resulting tree’s depth may exceed the maximum depth.

randomNode()[source]

This function returns a random node in the parse tree.

run()[source]

This function performs one run of the bbsa.

toDict()[source]

This function creates a dictionary which can be used by the load function to create a copy. This is done so that tree’s can be saved and loaded from disk.

update()[source]

This function updates all of the nodes with the correct pointers to the settings and the persistant and ‘last’ sets.

bbsa.popNodes(node, a)[source]

This function is used to create a list of all nodes in a given bbsa. The list will be in pre order.

Previous topic

Welcome to Evolving BBSAs’s documentation!

Next topic

Nodes

This Page