17 #include "console_buffer.h" 19 #include <core/darwin.h> 20 #include <core/evolution.h> 21 #include <core/logging.h> 30 class PubSubRelay :
public QObject {
35 qRegisterMetaType<uint32_t>(
"uint32_t");
36 qRegisterMetaType<std::string>(
"std::string");
37 qRegisterMetaType<darwin::GenerationSummary>(
"darwin::GenerationSummary");
38 qRegisterMetaType<darwin::EvolutionStage>(
"darwin::EvolutionStage");
41 [
this](uint32_t hints) { emit sigEvents(hints); });
43 ConsoleBuffer::instance()->console_output.subscribe(
44 [
this](
const std::string& message) {
45 emit sigConsoleOutput(QString::fromStdString(message));
50 emit sigGenerationSummary(summary);
58 static PubSubRelay* instance() {
59 static PubSubRelay* instance =
new PubSubRelay;
64 void sigEvents(uint32_t hints);
65 void sigConsoleOutput(
const QString& output);
Summary of a generation (fitness samples, best genotype, ...)
Definition: evolution.h:37
core::PubSub< EvolutionStage > top_stages
Channel for publishing the completition of a generation's top stage.
Definition: evolution.h:319
int subscribe(const Subscriber &subscriber)
Add a subscriber callback.
Definition: pubsub.h:36
Evolution * evolution()
Accessor to the Evolution singleton instance.
Definition: evolution.h:436
core::PubSub< GenerationSummary > generation_summary
Channel for publishing generation summaries.
Definition: evolution.h:316
core::PubSub< uint32_t > events
Evolution events notifications.
Definition: evolution.h:313
Tracks the execution of an execution (sub)stage.
Definition: evolution.h:134