show_evolution

Replay a saved GA checkpoint with population-evolution plots.

The show_evolution module provides data visualization about GA.

Created on Mon Jun 10 2019 14:30:05.

@author: HugoFara

leggedsnake.show_evolution.draw_any_func(axis: Axes, scores: list[list[float]], func: Callable[[list[float]], float]) None

Draw any kind of function.

leggedsnake.show_evolution.draw_best_score(axis: Axes, scores: list[list[float]]) None

Compute the best score vector form a score matrix and draw it.

leggedsnake.show_evolution.draw_diversity(axis: Axes, dimensions: list[list[list[float]]]) None

Draw the standard deviation in the dimensions.

leggedsnake.show_evolution.draw_median_score(axis: Axes, scores: list[list[float]]) None

Compute a median vector from a score matrix and draw it.

leggedsnake.show_evolution.draw_population(axis: Axes, populations: list[list[Any]]) None

Just draw the number of individuals in the population.

leggedsnake.show_evolution.draw_standard_deviation(axis: Axes, scores: list[list[float]]) None

Draw the standard deviation of scores from a score matrix.

leggedsnake.show_evolution.load_data(json_file: str) list[dict[str, Any]]

Load the population from a JSON file, and return it.

leggedsnake.show_evolution.show_genetic_optimization(data: list[dict[str, Any]] = []) None

Show a graph representing an optimization with a genetic algorithm.

Parameters:

data (Any, default=None) – Use json.load({path to file}) to generate the data.