Skip to content

Expose attribute `problem` in System setup

Etienne Lac requested to merge expose-problem-in-setup into master

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'])
Edited by Etienne Lac

Merge request reports