Project-Platypus / Platypus

A Free and Open Source Python Library for Multiobjective Optimization
GNU General Public License v3.0
573 stars 152 forks source link

Replace wrappers with extensions #252

Closed dhadka closed 1 month ago

dhadka commented 1 month ago

Creates an extension mechanism to replace the wrapper classes (PeriodicAction and its subclasses).

To switch from wrappers to extensions, simply change:

algorithm = NSGAII(problem)
wrapped_algorithm = AdaptiveTimeContinuation(algorithm)

with

algorithm = NSGAII(problem)
algorithm.add_extension(AdaptiveTimeContinuationExtension())

The old wrapper classes are still available but are being deprecated.