easyiec.core.Session#

class easyiec.core.Session(problem, strategy, evaluator=None, *, budget=None, oracle='auto', goal=None, seed=None, steering=None, callbacks=(), initial=None, name=None)[source]#

Bases: object

An interactive evolutionary computation session.

Parameters:
problemProblem
strategyStrategy
evaluatorEvaluator, optional

Needed by step() and run(); front ends may answer instead.

budgetBudget, optional
oraclecallable() or “auto” or None

Ground-truth utility genome → float recorded for every new individual (never shown to the strategy). "auto" uses evaluator.true_utility when the evaluator has one (simulated users do).

goalstr, optional

Goal text; defaults to problem.goal.

seedint, optional
steeringobject, optional

Converts free-text comments into search directions (easyiec.evaluators.steering.VerbalSteering); default: keyword steering with problem.semantic_axes when the problem has any; False disables steering.

callbackssequence of callables

callback(session, record) after every answered query.

initialsequence of genomes, optional

Seed genomes for the first population (presets, a previous session).

ask()[source]#

The next query (the same one until it is answered).

run(generations=None, *, max_queries=None, verbose=False)[source]#

Run until the budget is exhausted or the evaluator stops; returns a Result.

save(path)[source]#

Save the log (JSON); individuals, queries and answers are restorable.

step()[source]#

Ask, let the evaluator answer, tell. Raises NeedsHuman if a person must answer.

tell(feedback)[source]#

Answer the pending query; returns the log record.