evomatic¶
Genetic Operators¶
Competition¶
- evomatic.competition.tournaments(alloys, ...) DataFrame[source]
Holds tournaments between members of the population, winners progress to the recombination stage, losers are discarded.
Recombination¶
- evomatic.recombination.recombine(alloys, ...) DataFrame[source]
Applies the recombination operator to the population of alloy candidates, generating child alloys.
Mutation¶
- evomatic.mutation.determine_possible_mutation_types(...) list[str][source]
Determines the mutation types that can be applied to an alloy, given the constraints on the evolutionary algorithm.
- evomatic.mutation.remove_element(alloy: Alloy, constraints) Alloy[source]
Mutate an alloy composition by removing an element, taking constraints into account.
- evomatic.mutation.add_element(alloy: Alloy, constraints) Alloy[source]
Mutate an alloy composition by adding an element, taking constraints into account.
- evomatic.mutation.swap_elements(alloy: Alloy) Alloy[source]
Mutate an alloy composition by adding an element, taking constraints into account.
- evomatic.mutation.adjust_element(alloy: Alloy) Alloy[source]
Mutate an alloy composition by adjusting the percentage of an element.
- evomatic.mutation.mutate(alloys: DataFrame, ...) DataFrame[source]
Applies the mutation operator to the population of alloy candidates, generating child alloys.
Fitness¶
- evomatic.fitness.calculate_comparible_fitnesses(...) DataFrame[source]
Returns data with fitness values calculated as a fraction of the best values observed across the entire evolutionary history, enabling comparison of candidates from different generations. Intended to be used at the end of the evolution.
- evomatic.fitness.calculate_crowding(alloys: DataFrame, targets, ...)[source]
Calculates the crowding distance, enabling comparison of candidates in the same Pareto rank. See Section 2.2 of https://doi.org/10.1145/1068009.1068047.
- evomatic.fitness.calculate_fitnesses(alloys, ...) DataFrame[source]
Assigns Pareto ranks and crowding distances to alloy candidates.
- evomatic.fitness.get_pareto_frontier(alloys, ...) list[bool][source]
Obtains the Pareto frontier of a set of alloys.
- evomatic.fitness.is_pareto_efficient(costs) list[bool][source]
Finds the pareto-efficient points.
- evomatic.fitness.compare_candidates(A: Series, B: Series) Series[source]
Compares two alloy candidates to determine which is fitter, based on Pareto rank and crowding distance.
- evomatic.fitness.compare_candidates_numerical(A: Series, B) float[source]
Compares two alloy candidates to determine which is fitter, based on Pareto rank and crowding distance, returning a numerical value.
Utilities¶
- evomatic.fitness.normalise(data: DataFrame, property_name: str, ...)[source]
Returns data normalised by subtracting the minimum and dividing by the range. The range and minimum are taken from the entire evolutionary history.
- evomatic.fitness.determine_normalisation_factors(alloys, ...)[source]
Determine the normalisation factors for each target, to be used when normalising alloy fitnesses. The maximum and minimum are taken from alloy performance across the entire evolutionary history.
Plots¶
- evomatic.plots.plot_targets(history: dict, targets: dict, ...)[source]
Plot the values of targets, as line graphs across the evolution, and histograms across the population.
- evomatic.plots.plot_alloy_percentages(history: dict, ...)[source]
Plot the average alloy percentages across the evolution.
- evomatic.plots.pareto_front_plot(history: dict, pair, ...)[source]
Plot the Pareto diagram of two targets, highlighting the frontiers.
- evomatic.plots.pareto_plot(history, pair, targets, ...)[source]
Plot the Pareto diagram of two targets.