|
Darwin Neuroevolution Framework
|
Domain: A simple 2D map navigation and resource gathering. More...
#include <harvester.h>
Public Member Functions | |
| bool | evaluatePopulation (darwin::Population *population) const override |
| Assigns fitness values to every genotype. More... | |
| size_t | inputs () const override |
| Number of inputs to a Brain. | |
| size_t | outputs () const override |
| Number of outputs from a Brain. | |
Public Member Functions inherited from darwin::Domain | |
| virtual unique_ptr< core::PropertySet > | calibrateGenotype ([[maybe_unused]] const Genotype *genotype) const |
| Optional: additional fitness metrics (normally not used in the population evaluation, ie a test set) | |
Domain: A simple 2D map navigation and resource gathering.
The robot navigates a randomly generated 2D map, represented as a grid where a cell can be one of the following:
The robot starts with an initial health value, then at each step it can perform an action. Each action has a health "cost", and once the health drops to zero the experiment is terminated.
The robot's vision is constructed from a number of rays (Config::vision_resolution) fanned within a field of view (Config::vision_fov). For each ray, two input values are calculated (distance and color)
| Input | Value |
|---|---|
| 2i | distance |
| 2i+1 | color |
| Output | Value |
|---|---|
| 0 | move (magnitude determines the movement distance) |
| 1 | rotate (magnitude determines the rotation angle) |
|
overridevirtual |
Assigns fitness values to every genotype.
Having a good fitness function is a key part of evolutionary algorithms:
true if the evolution goal was reached Implements darwin::Domain.
1.8.14