🡴 Up to the list of all exercises
Question 1
In the lecture on EAs Part 3 ("Variants and specializations of evolutionary algorithms") we discussed genetic programming (GP, review the lecture pdf now). DEAP can optimize GP (code examples are in the lecture pdf as well). Devise a mapping of the GP space to one selected genetic representation in Framsticks. On the GP side, you will need your own function nodes and terminal nodes, as well as a tree evaluation function which, from that tree, must produce a genotype in the desired Framsticks representation.
We are dealing with a problem in which optimization algorithms (e.g., evolutionary) have difficulty discovering good solutions, never reaching the global optimum. The question is: can the optimization in the GP space developed in this task (transforming each GP genotype to some genotype in the native Framsticks representation) obtain better results than the analogous optimization performed with the native Framsticks representation and its operators? Remember that the GP representation in this approach is not able to produce anything that cannot be produced in the native representation (to which GP is transformed). Provide justification for your answer. You can generalize this question to two representations A and B, one translated to the other, completely abstracting away from Framsticks and GP – the answer to such a generalized question and its justification will be the same.
Optimization with an evolutionary algorithm in the GP space can yield better results, because...
or:
Optimization with an evolutionary algorithm in the GP space cannot yield better results, because...
Question 2
On the GP side, implement your own terminal nodes (tree leaves) returning string fragments of a genotype in a Framsticks representation, and your own function nodes ("primitives") returning an expanded string fragments of a genotype based on arguments (the children of the parent function node). These function and terminal nodes will be used to build a tree, from which the tree evaluation (compilation) function should generate a complete, valid string genotype in the target Framsticks representation. This string genotype is then evaluated exactly as it was during the earlier lab experiments, and its obtained fitness value becomes the fitness of the evaluated GP tree.
Choose one of the two optimization problems we have covered so far:
- "vertpos" without a neural network. Choose one target representation: f0, f1, or f4.
Use the following sequence of files with parameter values:"eval-allcriteria.sim;deterministic.sim;sample-period-2.sim;only-body.sim" - "velocity" with a neural network. Choose one target representations: f0 or f1.
Use the following sequence of files with parameter values:"eval-allcriteria.sim;deterministic.sim;sample-period-longest.sim"
Compare the effectiveness of evolution that searches the genotype space using native Framsticks operators and the one that searches the GP space using existing GP operators in DEAP. You can test a few of your ideas and different variations of transforming one space into another. Describe in detail the ideas you have implemented (you can also include the most important code snippets) and justify your way of solving the problem. As an example, include one very good individual obtained in the GP tree representation (the tree before conversion to the chosen Framsticks representation). Generate the same comparison plots as usual, interpret them and describe your conclusions.
