Optimizee Base Module

class l2l.optimizees.optimizee.Optimizee(traj)[source]

This is the base class for the Optimizees, i.e. the inner loop algorithms. Often, these are the implementations that interact with the environment. Given a set of parameters, it runs the simulation and returns the fitness achieved with those parameters.


Create one individual i.e. one instance of parameters. This instance must be a dictionary with dot-separated parameter names as keys and parameter values as values. This is used by the optimizers via the function create_individual() to initialize the individual/parameters. After that, the change in parameters is model specific e.g. In simulated annealing, it is perturbed on specific criteria

Return dict:A dictionary containing the names of the parameters and their values

This is the primary function that does the simulation for the given parameter given (within traj)

Parameters:traj (Trajectory) – The trajectory that contains the parameters and the individual that we want to simulate. The individual is accessible using traj.individual and parameter e.g. param1 is accessible using traj.param1
Returns:a tuple containing the fitness values of the current run. The tuple allows a multi-dimensional fitness function.