Darwin Neuroevolution Framework
Public Member Functions | List of all members
conquest::Conquest Class Reference

Domain: Conquest, a two-player strategy game. More...

#include <conquest.h>

Inheritance diagram for conquest::Conquest:
darwin::Domain core::NonCopyable

Public Member Functions

size_t inputs () const override
 Number of inputs to a Brain.
 
size_t outputs () const override
 Number of outputs from a Brain.
 
bool evaluatePopulation (darwin::Population *population) const override
 Assigns fitness values to every genotype. More...
 
- Public Member Functions inherited from darwin::Domain
virtual unique_ptr< core::PropertySetcalibrateGenotype ([[maybe_unused]] const Genotype *genotype) const
 Optional: additional fitness metrics (normally not used in the population evaluation, ie a test set)
 

Detailed Description

Domain: Conquest, a two-player strategy game.

Conquest is an minimalistic real-time strategy game. It’s a two-player game, and the "board" is a graph of connected nodes. A node can be captured by "attacking" with more units than the “defending” units controlling the node. A controlled node automatically generates new units at a fixed rate (up to a specified cap, ex. 10 units). The goal of the game is to capture all the nodes.

conquest_sandbox.png

All the population members participate in a tournament and the outcomes are used to calculate the individual fitness values.

Inputs

Input Value
[N] the number of units in each node
N + 2i deployment[i].position
N + 2i + 1 deployment[i].size

Where:

Outputs

Output Value
[A] preference for initiating an attack on the corresponding arc

The largest output signal, if greater than kOutputThreshold, indicates the intention to initiate an attack on the corresponding arch. The attack order is valid only if the source node is controlled by the player. An attack sends a configurable percentage of the units (g_config.deploy_percent) along the selected arc.

Member Function Documentation

◆ evaluatePopulation()

bool conquest::Conquest::evaluatePopulation ( darwin::Population population) const
overridevirtual

Assigns fitness values to every genotype.

Having a good fitness function is a key part of evolutionary algorithms:

  • Perhaps obvious, the fitness value should accurately estimate the quality of a particular solution
  • A "smooth" distribution is preferable since it provides a gradient which can guide the incremental search in the solutions space. (ex. if most fitness values are 1.0 or 0.0 it's hard to know which genotypes are good candidates for reproduction)
Returns
true if the evolution goal was reached

Implements darwin::Domain.


The documentation for this class was generated from the following files: