Reputation: 27
I checked nested optimization code in RevHack2020 repository. I want to implement nested optimization for a group. In the subproblem codes, I saw that we can implement run_driver() in compute method for an explicit component (here).
Can I implement run_driver() in group classes? (Since compute() method is for components, could not implement it in a group)
Note: I plan to use nested optimization in a pycyle "element" and it inherits from group class. It is the reason for me to implement in "group" class. Otherwise, I can change my model to explicitComponent.
Upvotes: 0
Views: 62
Reputation: 5710
No, you can't implement any custom run methods inside of groups. The only place users are supposed to implement execution is inside components.
In the case you described, you would place the pyCycle models into a problem of their own. Then you embed that problem into a containing component.
I don't follow why you feel the need to implement it in a group.
Upvotes: 1