Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reworking of the Optimization feature: Introducing VarOpti #574

Merged
merged 11 commits into from
Jan 3, 2023

Conversation

BenjaminGabet
Copy link
Contributor

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

@BonneelP BonneelP merged commit 614ade4 into Eomys:master Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants