Playing around with genetic programming. Program will make a formula which approximates the input sequence.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

21 lines
547 B

#pragma once
#include "genome.hpp"
#include <vector>
using Score = double;
struct Evolver{
// stores the genome with its score
// first element is the best one (after calling next_generation()).
std::vector<std::pair<Genome, Score>> current_generation;
// goal which we are trying to achieve
std::vector<int> goal;
// evaluates current generation, picks the best one, and generate new generation
void next_generation();
};
// reate a random generation to start with
Evolver create_evolver(size_t population_size, size_t genome_size);