|
Darwin Neuroevolution Framework
|
Domain: Double-Cart-Pole. More...
#include <double_cart_pole.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... | |
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: Double-Cart-Pole.
A variation of the cart-pole domain (cart_pole::CartPole), with two independent poles attached to the cart.
The cart starts in the middle (x = 0) and the initial pole angles is a random value in the [-max_initial_angle, +max_initial_angle] range. An episode is successful if both poles remain between -max_angle and +max_angle for at least max_steps. The cart position must also stay between [-max_distance, +max_distance].
The inputs are configurable by individually selecting at least one of:
| Input | Value |
|---|---|
| 0,1 | pole_angle(1,2) |
| 2,3 | angular_velocity(1,2) |
| 4 | cart_distance |
| 5 | cart_velocity |
The single output indicates the horizontal force to be applied to the cart. This can be discrete (fixed +/-discrete_force_magnitude depending on the sign of the output) or can be continuous (the output value maps directly to the force magnitude)
| Output | Value |
|---|---|
| 0 | force |
|
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