Generational Adversarial MAP-Elites =================================== In a game, the same strategy can have different fitness and behaviour against different opponents. :func:`qdpy.algorithms.game_search` keeps a separate archive for each opponent and alternates which side can propose new strategies. The example coevolves probability distributions over rock, paper, and scissors. Run from the repository root with the :ref:`base package `. .. code-block:: sh python examples/game_rock_paper_scissors.py .. literalinclude:: ../examples/game_rock_paper_scissors.py :language: python Implement ``play(red, blue)`` to receive two immutable real-valued genomes in Red and Blue order. Return a :class:`qdpy.algorithms.MatchResult` with both fitness values and both descriptor vectors in that order. Both players maximise their scores. Here the expected payoffs sum to zero and each behaviour vector contains probabilities of winning and drawing. Keep each side's descriptor length fixed across matches, including when it is the opponent. GAME starts with Red against sampled Blue strategies. It uses Euclidean distance to maintain distinct behaviours per opponent. At each round boundary, it clusters the elites and selects the next opponents. Each old and new representative pair plays once to collect measurements for the archive in the next round. Read ``result.rounds`` to inspect either side. Within each round, ``opponents[i]`` and ``elites_by_opponent[i]`` refer to the same opponent. Use a common panel to compare repertoires. The example tests the uniform mixture of selected strategies against the three pure strategies and reports the worst expected payoff. The example spends 48 search matches and nine bootstrap matches. The runner reports these budgets separately and counts failures as attempts. With four opponents on each side, a tournament adds 16 matches. The growing archive and tournament follow `Anne et al. `__. QDpy takes descriptors directly from the evaluator. See :doc:`constrained_coevolution_benchmarks` for the random-proposal control.