Reputation: 31
I am working on a mathematical model in pyomo. There are parameters that are based on a normal distribution. The input for these distributions is not a simple numerical number, but it's another parameter that is defined in pyomo. I imported the Statistics package to use normal distribution but I get this error: Cannot convert non-constant Pyomo expression (0 < s) to bool. This error is usually caused by using a Var, unit, or mutable Param in a Boolean context such as an "if" statement, or when checking container membership or equality.
Upvotes: 0
Views: 82
Reputation: 31
I found the answer. I share it here for others if they had the same question. I think the easiest approach is working with python (Numpy ), generating whatever you want, then assigning it to pyomo objects. I tried this and it worked very well.
Upvotes: 0