Closed alaurenzi closed 3 years ago
Solved in a77bb6e3ea0ee5290ba07806925de0aab0774eaa
. Can be cherry-picked.
This should also be implemented inside StateVariable.setBounds
I guess
Maybe a centrailized utility would be best @FrancescoRuscelli
I only did for the function indeed. I'll check the StateVariable.setBounds
The def setBounds(self, lb, ub, nodes=None)
method follows slightly different rules infact lb and ub are separated input and not inside a dict. This method calls internally:
self.setLowerBounds(lb, nodes)
self.setUpperBounds(ub, nodes)
We can implement the same behavior adding defaults in the setBounds(lb=None, ub=None)
, what do you think? @FrancescoRuscelli @alaurenzi
I would not change the actual behavior of the state variable. In fact, it makes sense that when a variable is created is considered unbounded (-inf, inf)
while a constraint is initialized to be equal to 0. The state variables already have the set upper and lower bound methods which should be used when only one of the two is set (while setBounds is used for both).
This should also be implemented inside
StateVariable.setBounds
I guess
StateVariables should be initialized with -inf, inf bounds, right? Only constraints should be initialized at 0, 0. I believe this can be closed.
I propose the following in order to simplify the interface as much as possible:
g(x) < u
)g(x) > u
)