brocksam / pycollo

General-purpose optimal control, trajectory optimisation and parameter optimisation using direct collocation
https://brocksam.github.io/pycollo/
MIT License
8 stars 3 forks source link

Add setting for maximising the objective function #26

Open brocksam opened 3 years ago

brocksam commented 3 years ago

Pycollo should provide a setting for maximising the objective function. By providing a negative objective function to IPOPT it will effectively maximise the objective function. If problem.settings.maximise_objective is True then Pycollo could ensure that the objective is nonnegative to avoid confusion to the user. The maximise objective setting should also be paired with problem.settings.minimise_objective such that they are always opposite. By default problem.settings.minimise_objective should be True and problem.settings.maximise_objective should be False.

brocksam commented 2 years ago

The pycollo.Settings class should be refactored to use the composite design pattern.

Example composition classes could be:

settings = pycollo.Settings()
assert isinstance(settings.backend, pycollo.settings.BackendSettings)
assert isinstance(settings.nlp_solver, pycollo.settings.NlpSolverSettings)
assert isinstance(settings.collocation, pycollo.settings.CollocationSettings)
assert isinstance(settings.mesh_refinement, pycollo.settings.MeshRefinementSettings)
assert isinstance(settings.scaling, pycollo.settings.ScalingSettings)
assert isinstance(settings.bounds, pycollo.settings.BoundsSettings)
assert isinstance(settings.logging, pycollo.settings.LoggingSettings)
assert isinstance(settings.debugging, pycollo.settings.DebuggingSettings)