Darwin Neuroevolution Framework
|
The controller for running evolution experiments. More...
#include <evolution.h>
Classes | |
struct | Snapshot |
State snapshot of an evolution run. More... | |
Public Types | |
enum | State { State::Invalid, State::Initializing, State::Running, State::Pausing, State::Paused, State::Canceling, State::Stopped } |
Evolution state. More... | |
enum | EventFlag : uint32_t { StateChanged = 1 << 0, ProgressUpdate = 1 << 1, EndGeneration = 1 << 2, EndEvolution = 1 << 3, NewExperiment = 1 << 4, Reset = 1 << 5, All = EventFlag(-1) } |
Event hints (as bit flags) More... | |
Public Member Functions | |
bool | newExperiment (shared_ptr< Experiment > experiment, const EvolutionConfig &config) |
Sets up a new evolution experiment. More... | |
Snapshot | snapshot () const |
Captures a Snapshot of the current evolution state. | |
const Experiment & | experiment () const |
Accessor to the associted Experiment instance. | |
const EvolutionConfig & | config () const |
Accessor to the associated EvolutionConfig instance. | |
void | run () |
Start/Resume the evolution. More... | |
void | pause () |
Pause the evolution. More... | |
bool | reset () |
Resets the evolution (stops execution and resets the state) More... | |
void | waitForState (State target_state) const |
Blocks until the requested state is reached. More... | |
Public Attributes | |
core::PubSub< uint32_t > | events |
Evolution events notifications. | |
core::PubSub< GenerationSummary > | generation_summary |
Channel for publishing generation summaries. | |
core::PubSub< EvolutionStage > | top_stages |
Channel for publishing the completition of a generation's top stage. | |
Friends | |
Evolution * | evolution () |
Accessor to the Evolution singleton instance. | |
The controller for running evolution experiments.
enum darwin::Evolution::EventFlag : uint32_t |
Event hints (as bit flags)
Enumerator | |
---|---|
StateChanged | The evolution State has changed. |
ProgressUpdate | Progress update notification. |
EndGeneration | Generation end notification. |
EndEvolution | Evolution run completed successfully. |
NewExperiment | New experiment notification. |
Reset | Experiment reset notification. |
All | Combination of all event flags. |
|
strong |
bool darwin::Evolution::newExperiment | ( | shared_ptr< Experiment > | experiment, |
const EvolutionConfig & | config | ||
) |
Sets up a new evolution experiment.
experiment | - the Experiment model/state |
config | - evolution runtime settings |
void darwin::Evolution::pause | ( | ) |
Pause the evolution.
bool darwin::Evolution::reset | ( | ) |
Resets the evolution (stops execution and resets the state)
void darwin::Evolution::run | ( | ) |
Start/Resume the evolution.
void darwin::Evolution::waitForState | ( | Evolution::State | target_state | ) | const |
Blocks until the requested state is reached.