Darwin Neuroevolution Framework
harvester.h
1 // Copyright 2018 The Darwin Neuroevolution Framework Authors.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #pragma once
16 
17 #include "world_map.h"
18 
19 #include <core/darwin.h>
20 
21 namespace harvester {
22 
23 void init();
24 
59 class Harvester : public darwin::Domain {
60  public:
61  Harvester();
62  bool evaluatePopulation(darwin::Population* population) const override;
63  size_t inputs() const override { return inputs_; }
64  size_t outputs() const override { return outputs_; }
65 
66  private:
67  size_t inputs_ = 0;
68  size_t outputs_ = 0;
69 };
70 
71 class Factory : public darwin::DomainFactory {
72  unique_ptr<darwin::Domain> create(const core::PropertySet& config) override;
73 
74  unique_ptr<core::PropertySet> defaultConfig(darwin::ComplexityHint hint) const override;
75 };
76 
77 } // namespace harvester
ComplexityHint
A generic hint for the initial population & domain setup.
Definition: darwin.h:47
A population implementation encapsulates the fixed-size set of genotypes, together with the rules for...
Definition: darwin.h:161
bool evaluatePopulation(darwin::Population *population) const override
Assigns fitness values to every genotype.
Definition: harvester.cpp:44
size_t outputs() const override
Number of outputs from a Brain.
Definition: harvester.h:64
Interface to the domain factory.
Definition: darwin.h:263
The foundation for data structures supporting runtime reflection.
Definition: properties.h:388
Definition: harvester.cpp:32
Interface to a domain implementation.
Definition: darwin.h:229
Domain: A simple 2D map navigation and resource gathering.
Definition: harvester.h:59
size_t inputs() const override
Number of inputs to a Brain.
Definition: harvester.h:63