pyleecan icon indicating copy to clipboard operation
pyleecan copied to clipboard

Reworking of the Optimization feature: Introducing VarOpti

Open BenjaminGabet opened this issue 3 years ago • 0 comments

Hello all,

We are currently working on a rework of Optimization classes to make it easier to use it as a Simulation and to remove the possible duplication of code. Here are what we have in mind:

OptiConstraint now inherit from DataKeeper:

  • get_variable attribute is renamed as keeper.

OptiDesignVar is an abstract class:

  • Created two new classes OptiDesignVarSet and OptiDesignVarInterval that inherit from OptiDesignVar (to be consistent with ParamExplorer)
  • Type_var from OptiDesignVar has been deleted
  • Mutate from OptiGenAlgNsga2Deap has been modified to adapt on the type of the design variable

We thought about removing OptiObjective (since its only a renaming of DataKeeper) but it should be clearer in scripting to use "Objective objects".

VarOpti will be created:

  • VarParam has been renamed as VarParamSweep
  • VarParam has become an abstract class
  • VarParamSweep and VarOpti inherit from VarParam
  • All VarParam method are moved to VarParamSweep
  • VarOpti has a run and a check
  • VarOpti run will call setup the OptiProblem and OptiSolver and call solve to start the optimization on the reference simulation.

Regarding retrocompatibility, the old VarParam and VarParamSweep has the same behavior so just a renaming is required. When declaring an OptiConstraint, the old get_variable is now named keeper. VarOpti is made only to define the problem with eval function like: simu.run. For optimization without call to pyleecan, the old object can be used.

What do you think of this modification proposal ?

Best regards,

Ben

BenjaminGabet avatar Dec 06 '22 09:12 BenjaminGabet