OutputMultiOpti (class)

File generated according to Generator/ClassesRef/Output/OutputMultiOpti.csv WARNING! All changes made in this file will be lost!

class OutputMultiOpti(fitness=[], constraint=[], ngen=[], fitness_names=[], output_ref=-1, outputs=[], is_valid=[], design_var=[], design_var_names=[], init_dict=None)[source]

Bases: pyleecan.Classes.OutputMulti.OutputMulti

Optimization results

add_evaluation(output, is_valid, design_var, fitness, ngen)

Add an evaluation to the OutputMultiOpti object

Parameters:
  • self (OutputMultiOpti) – Object containing genetic algorithm resutls
  • output (Output) – Output
  • is_valid (boolean) – Validity of the individual
  • design_var ({OptiDesignVar}) – Design variables
  • fitness (list) – Fitness of the individual
  • ngen (boolean) – Number of the generation
plot_pareto(obj1=0, obj2=1)

Plot the pareto front for 2 objective functions

Parameters:
  • self (OutputMultiOpti) –
  • obj1 (str or int) – label or number of the first objective function
  • obj2 (str ot int) – label or number of the second objective function
plot_generation(obj1=0, obj2=1)

Plot every fitness values according to the two fitness

Parameters:self (OutputMultiOpti) –
get_pareto()

Return the Output from the pareto front

Parameters:self (OutputMultiOpti) –
Returns:pareto – list of dictionnary containing Output, fitness and ngen from the pareto front
Return type:[dict]
plot_pareto_design_space(dvar1=0, dvar2=1)

Plot every individuals from the pareto front in the design space according to the two design variables selected

Parameters:
  • self (OutputMultiOpti) –
  • dvar1 (int or str) – design variable name or position in the dict to represent
  • dvar2 (int or str) – second design variable name or position in the dict to represent
plot_generation_design_space(dvar1=0, dvar2=1)

Plot every individual in the 2D design variable space according to dvar1 and dvar2

Parameters:
  • self (OutputMultiOpti) –
  • dvar1 (int or str) – design variable name or position in the dict to represent
  • dvar2 (int or str) – second design variable name or position in the dict to represent
save(save_path='')

Save the object to the save_path

Parameters:
  • self – A pyleecan object
  • save_path (str) – path to the folder to save the object
get_logger()

Get the object logger or its parent’s one

Parameters:obj – A pyleecan object
Returns:logger – Pyleecan object dedicated logger
Return type:logging.Logger
as_dict()[source]

Convert this objet in a json seriable dict (can be use in __init__)

fitness

List of the corresponding output objective values

constraint

List of the corresponding output constraint values

ngen

Number of generation of the indiv

fitness_names

Names of the objectives functions