Expose attribute `problem` in System setup
Description
Attribute System.problem
is a getter to the (private) off-design problem, of type MathematicalProblem
.
Up to now, it was only accessible within method System.transition
, through a safe-guard, to allow the redefinition of the inner mathematical problem after the occurrence of discrete events.
This revision also exposes attribute problem
inside method setup
.
One use case is to allow the activation of a design method of a child system, as off-design constraints at parent level.
For example:
class MySystem(System):
def setup(self):
self.add_child(Foo('foo'))
# Use child design method as off-design constraint
self.problem.extend(self.foo.design_methods['xyz'])