Skip to content

v2.62.0 genetic algorithm

APN-Pucky edited this page Sep 14, 2020 · 1 revision

This algorithm optimizes the deck based on a pool of seed decks ('pool'). The general procedure is:

  • mixing the cards of two decks ('crossover')

and/or

  • and changing a single card randomly ('mutation') (sort of like anneal)
example usage:

./tuo gauntlet1 gauntlet2 genetic 100 surge

Algorithm:

A simplified description of the algorithm:

Say we have 100 decks.

  1. Simulate the score for each deck and sort the decks by their scores.
    • Then for each generation the best 33 decks will survive ('nochange'),
    • 33 decks be replaced with a crossover deck (mixing of a random and one of the top 33 decks)
    • and the worst 34 decks be replaced by a mutation (replace a random card with a random card in one of the top 33 decks).
  2. Repeat from step 1 until (generation) limit is reached

Read Further: https://en.wikipedia.org/wiki/Genetic_algorithm

Preliminary comparison to climb/anneal:
  • genetic is faster than climb/anneal in the early optimization steps, but this depends on the pool.
  • climb gives better scores in finalizing a deck, since genetic still tries to improve the deck(s) by both crossovers and mutations.
Advanced parameters:
  • 'genetic-pool integer' sets the size of the pool
  • 'genetic-gen integer' sets the number of generations
  • 'genetic-opts double double double' sets the weight of different change operations nochange, crossover, mutate (since it is a weight '0.1 0.1 0.2' is the same as '10 10 20')
Caution:
  • Default parameters are not perfect yet, playing around with the parameters might increase/decrease performance drastically (any feedback or ideas on changes are as always much appreciated).
  • The algorithm should work with most tuo flags/modes, but not all are tested.
  • Better check if the results seem reasonable
Other Notes:
  • Climb and Anneal will now accept a list of decks or a gauntlet as your deck. Both algorithms will use the best deck of the passed ones for the normal algorithm.
  • If no 'genetic-pool'-size is set genetic uses a pool size equal to the number of passed decks, except if less than 20 decks are passed (then the pool will be filled to 20 decks by mutations and crossovers).
  • If a weight is set to 0 (or effective 0, like '1000 1 1000') genetic probably will not work.