Open brocksam opened 3 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)
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
isTrue
then Pycollo could ensure that the objective is nonnegative to avoid confusion to the user. The maximise objective setting should also be paired withproblem.settings.minimise_objective
such that they are always opposite. By defaultproblem.settings.minimise_objective
should beTrue
andproblem.settings.maximise_objective
should beFalse
.