Optimizer using Evolutionary Algorithm

GeneticAlgorithmOptimizer

class l2l.optimizers.evolution.optimizer.GeneticAlgorithmOptimizer(traj, optimizee_create_individual, optimizee_fitness_weights, parameters, optimizee_bounding_func=None)[source]

Bases: l2l.optimizers.optimizer.Optimizer

Implements evolutionary algorithm

Parameters
  • traj (Trajectory) – Use this trajectory to store the parameters of the specific runs. The parameters should be initialized based on the values in parameters

  • optimizee_create_individual – Function that creates a new individual

  • optimizee_fitness_weights – Fitness weights. The fitness returned by the Optimizee is multiplied by these values (one for each element of the fitness vector)

  • parameters – Instance of namedtuple() GeneticAlgorithmOptimizer containing the parameters needed by the Optimizer

post_process(traj, fitnesses_results)[source]

See post_process()

end(traj)[source]

See end()

GeneticAlgorithmParameters

class l2l.optimizers.evolution.optimizer.GeneticAlgorithmParameters(seed, popsize, CXPB, MUTPB, NGEN, indpb, tournsize, matepar, mutpar)

Bases: tuple

Parameters
  • seed – Random seed

  • popsize – Size of the population

  • CXPB – Crossover probability

  • MUTPB – Mutation probability

  • NGEN – Number of generations simulation should run for

  • indpb – Probability of mutation of each element in individual

  • tournsize – Size of the tournamaent used for fitness evaluation and selection

  • matepar – Paramter used for blending two values during mating

property CXPB
property MUTPB
property NGEN
property indpb
property matepar
property mutpar
property popsize
property seed
property tournsize