easyiec.strategies.Strategy#

class easyiec.strategies.Strategy(pop_size=9, protocol=None, n_select=None, scale=(1.0, 10.0), steer_decay=0.5)[source]#

Bases: object

Base class of interactive strategies.

A strategy proposes candidates with ask() (a Query) and learns from the answer with tell(). Real-coded strategies work in the unit cube of problem.space; strategies that only use variation operators (InteractiveGA, Watchmaker, InteractiveMAPElites, NoveltyIEC, RandomSearch) also accept structured genomes through problem.representation.

Parameters:
pop_sizeint

Candidates per query (the gallery size).

protocolstr, optional

Feedback protocol requested from the evaluator (default: the strategy’s protocol).

n_selectint, optional

Number of candidates to choose in select queries (None: free).

scale(float, float)

Rating scale of rate queries.

steer_decayfloat

Multiplicative decay per generation of a verbal-steering bias.

new(z=None, genome=None, parents=(), origin='init', params=None, generation=None)[source]#

Create an individual from a unit-cube point z or a genome.

resolved(feedback, query)[source]#

{id: individual} for the query items with edits substituted (Lamarckian).

setup(problem, rng=None, ids=None, initial=None)[source]#

Bind to a problem; called by Session.

steer(direction)[source]#

Add a verbal-steering bias (unit-cube displacement) to new offspring.

z(ind)[source]#

Normalized genome of a real-coded individual (cached).