Trees | Indices | Help |
|
---|
|
object --+ | Alchemist
Class that mutates the element of an atom in a structure
|
|||
|
|||
type(data) |
|
||
|
|||
|
|||
Inherited from |
|
|||
Inherited from |
|
Create an Alchemist object. Alchemists modify an object by changing a target item to new item. For instance, an Alchemist: - Might transmute the element of a particular atom - Might change the item of a list to a new value For enumeration, a series of Alchemists will work together to perform all necessary mutations, each alchemist passing their mutated structures on to another (child) alchemist. The general workflow looks like: receive mutated_object from parent alchemist for target in targets: for new_item in new_items: make a copy_of_mutated_object change item at target in copy_of_mutated_object to new_item pass copy_of_mutated_object to child alchemist @type master: object @param master: The master for this object. Can be a panel or other object that has methods that get called by Alchemist methods. By default, the Alchemist class calls master.transmutationCompleted with each fully transmuted object. @type targets: list @param targets: list of possible positions for this Alchemist to mutate @type new_items: list @param new_items: list of items to change each target to. @type child: L{Alchemist} @param child: The Alchemist to call each time this Alchemist transmutes an atom. If child is None, than this Alchemist is the last in the line.
|
Perform a transmutation on a copy of data at index. It is very important that this happen on a copy of data, not data itself.
|
Perform whatever action is required when all transmutations have been performed on the mydata object
|
Begin transmutations. This Alchemist will determine what targets to transmute based on its set of original targets minus those targets that have been used by previous Alchemists. Each time this Alchemist transmutes an item, it calls its child Alchemist to do its mutations (which calls its child Alchemist each time it transmutes an item, and so on). Thus is the iterative process of transmutating all possible combinations achieved. If this Alchemist does not have any children, than it is the last in the Alchemist line and it should call allTransmutationsCompleted when it is done with a transmutation.
|
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:40 2015 | http://epydoc.sourceforge.net |