Darwin Neuroevolution Framework
|
Domain: Ballistics. More...
#include <ballistics.h>
Public Member Functions | |
size_t | inputs () const override |
Number of inputs to a Brain. | |
size_t | outputs () const override |
Number of outputs from a Brain. | |
bool | evaluatePopulation (darwin::Population *population) const override |
Assigns fitness values to every genotype. More... | |
![]() | |
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: Ballistics.
A basic ballistics problem: output the angle required to hit a target at (x, y) coordinates. The magnitude of the initial velocity is fixed.
While seemingly simple, the analytical solution is not exactly trivial and it seems a good benchmark for Neuroevolution. The fitness function is:
1 - closest_distance / target_distance
An optional fitness bonus is added if the target is hit.
The inputs are simply the (x, y) target coordinates.
Input | Value |
---|---|
0 | target x coordinate |
1 | target y coordinate |
The single output indicates the aim angle
Output | Value |
---|---|
0 | aim angle (radians) |
|
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.