Porting Guide
DEAP development’s high velocity and our refusal to be at the mercy of
backward compatibility can sometime induce minor headaches to our users.
This concise guide should help you port your code from the latest version minus
0.1 to the current version.
General
- The algorithms from the algorithms module now return a tuple of 2-elements : the population and a Logbook.
- Replace every call to DTM by calls to SCOOP.
- Statistics and logging of data are accomplished by two distinct objects: Statistics and Logbook. Read the tutorial on logging statistics.
- Replace EvolutionLogger by Logbook.
- Replace usage of tools.mean(), tools.var(), tools.std(), and tools.median() by their Numpy equivalent.
- If the fitness has multiple objectives, add the keyword argument axis=0 when registering statistical function.
Genetic Algorithms (GA)
- Replace every call to the function cxTwoPoints() by a call to cxTwoPoint().
- Remove any import of cTools. If you need a faster implementation of the non-dominated sort, use sortLogNondominated().
- When inheriting from Numpy, you must manually copy the slices and compare individuals with numpy comparators. See the Inheriting from Numpy tutorial.
Genetic Programming (GP)
- Specify a name as the first argument of every call to addEphemeralConstant().
- Replace every call to lambdify() and evaluate() by a call to compile().
- Remove the pset attribute from every create() call when creating a primitive tree class.
- In the toolbox, register the primitive set as the pset argument of the following mutation operator: mutUniform(), mutNodeReplacement() and mutInsert().
- Replace every call to the function genRamped() by a call to genHalfAndHalf().
- Replace every call to stringify() by a call to str() or remove the call completely.
- Replace every call to lambdifyADF() by a call to compileADF().
- Replace the decorators staticDepthLimit() and staticSizeLimit() by staticLimit(). To specify a limit on either depth, size or any other attribute, it is now required to specify a key function. See staticLimit() documentation for more information.
Strongly Typed Genetic Programming (STGP)
- PrimitiveSetTyped method now requires type arguments to be defined as classes instead of string, for example float instead of "float".
Still having problem?
We have overlooked something and your code is still not working?
No problem, contact us on the deap users list at
http://groups.google.com/group/deap-users and we will get you out
of trouble in no time.