Septimus G
Septimus G

Reputation: 103

Pyomo: Defining a new set as a set operation

Given:

from pyomo.environ import * 
model = AbstractModel() 
model.I = Set()
model.J = Set()

I need to define a new set K = J - I

I tried

model.K = model.J - model.I

But it does not seem to be an option. How can I accomplish this?

Upvotes: 0

Views: 207

Answers (1)

bright612
bright612

Reputation: 55

I think it is better you to write

model.I - model.J

rather than

model.K

If you want to use the expression model.K, I recommend that you enter the appropriate information for model.K in rootdata like model.I and model.J.

Upvotes: 1

Related Questions