QDpy
Loading...
Searching...
No Matches
adhoc_cooperation.py File Reference

Self-play illumination and cross-play response tables for ad hoc cooperation. More...

Go to the source code of this file.

Classes

class  qdpy.algorithms.adhoc_cooperation.CooperativeQDResult
 Self-play repertoire and separate policy and match counts. More...
class  qdpy.algorithms.adhoc_cooperation.PartnerResponseTable
 Snapshot of ordered cross-play and the response to each partner niche. More...

Namespaces

namespace  qdpy

Functions

 qdpy.algorithms.adhoc_cooperation.cooperative_map_elites (archive, play, *, sample, mutate, budget, repeats=1, initial_samples=16, seed=0)
 Collect diverse cooperative policies using self-play.
 qdpy.algorithms.adhoc_cooperation.build_partner_responses (archive, play, *, budget, repeats=1, seed=0)
 Calibrate the best generalist and one response per partner niche.

Detailed Description

Self-play illumination and cross-play response tables for ad hoc cooperation.

See also
https://doi.org/10.1109/TG.2022.3169168

Definition in file adhoc_cooperation.py.

Function Documentation

◆ build_partner_responses()

qdpy.algorithms.adhoc_cooperation.build_partner_responses ( archive,
play,
* ,
budget,
repeats = 1,
seed = 0 )

Calibrate the best generalist and one response per partner niche.

Parameters
archiveNonempty self-play repertoire.
playCallable (first_genome, second_genome, seed) returning (team_score, first_descriptor).
budgetHard cap. Every ordered pair and repeat must fit before starting.
repeatsNumber of common seeded matches per ordered pair.
seedCross-play seed, independent of self-play.
Returns
PartnerResponseTable with separate measurement counts.
Score all ordered pairings and choose responses with maximum cooperative return.

Definition at line 108 of file adhoc_cooperation.py.

◆ cooperative_map_elites()

qdpy.algorithms.adhoc_cooperation.cooperative_map_elites ( archive,
play,
* ,
sample,
mutate,
budget,
repeats = 1,
initial_samples = 16,
seed = 0 )

Collect diverse cooperative policies using self-play.

Parameters
archiveEmpty parentless, best-only Grid or CVTGrid with one objective.
playCallable (first_genome, second_genome, seed) returning (team_score, first_descriptor).
sampleCallable (rng) returning an initial policy genome.
mutateCallable (genome, rng) returning an offspring.
budgetNumber of evaluated policy genomes.
repeatsNumber of common seeded matches per candidate.
initial_samplesNumber of unconditional sample calls.
seedRoot variation and matchup seed.
Returns
CooperativeQDResult with native archive and match budget.
Measure each candidate against itself and admit by its measured behavior.

Definition at line 72 of file adhoc_cooperation.py.