Darwin Neuroevolution Framework
conquest.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 "board.h"
18 #include "game.h"
19 
20 #include <core/darwin.h>
21 
22 namespace conquest {
23 
24 void init();
25 
64 class Conquest : public darwin::Domain {
65  public:
66  Conquest();
67 
68  size_t inputs() const override { return inputs_; }
69  size_t outputs() const override { return outputs_; }
70 
71  bool evaluatePopulation(darwin::Population* population) const override;
72 
73  unique_ptr<core::PropertySet> calibrateGenotype(
74  const darwin::Genotype* genotype) const override;
75 
76  private:
77  const Board* board_ = nullptr;
78  size_t inputs_ = 0;
79  size_t outputs_ = 0;
80 };
81 
82 class Factory : public darwin::DomainFactory {
83  unique_ptr<darwin::Domain> create(const core::PropertySet& config) override;
84 
85  unique_ptr<core::PropertySet> defaultConfig(darwin::ComplexityHint hint) const override;
86 };
87 
88 } // namespace conquest
size_t outputs() const override
Number of outputs from a Brain.
Definition: conquest.h:69
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
Definition: ann_player.cpp:25
Domain: Conquest, a two-player strategy game.
Definition: conquest.h:64
Interface to the domain factory.
Definition: darwin.h:263
bool evaluatePopulation(darwin::Population *population) const override
Assigns fitness values to every genotype.
Definition: conquest.cpp:44
size_t inputs() const override
Number of inputs to a Brain.
Definition: conquest.h:68
The foundation for data structures supporting runtime reflection.
Definition: properties.h:388
Interface to a domain implementation.
Definition: darwin.h:229
The interface to the population-specific "genetic material", the Genotype
Definition: darwin.h:126