Skip to content

Commit

Permalink
Update ReferenceModel to remove implicit ranged inequality statements
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola committed May 20, 2021
1 parent 4af050e commit 1deea04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/networkx_scenariotree/ReferenceModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def pysp_instance_creation_callback(scenario_name, node_names):
model.SecondStageCost.expr = (model.xu0 - 1)**2

model.y0 = aml.Var()
model.c.add(expr= -10 <= model.y0 <= 10)
model.c.add(expr= aml.inequality(-10, model.y0, 10))
if scenario_name == "u00":
model.yu00 = aml.Var()
model.c.add(model.yu00 == model.y0)
Expand All @@ -50,7 +50,7 @@ def pysp_instance_creation_callback(scenario_name, node_names):
model.SecondStageCost.expr = (model.xu1 + 1)**2

model.y1 = aml.Var()
model.c.add(expr= -10 <= model.y1 <= 10)
model.c.add(expr= aml.inequality(-10, model.y1, 10))
if scenario_name == "u10":
model.yu10 = aml.Var()
model.c.add(model.yu10 == model.y1)
Expand All @@ -68,7 +68,7 @@ def pysp_instance_creation_callback(scenario_name, node_names):
model.SecondStageCost.expr = (model.xu2 - 0.5)**2

model.y2 = aml.Var()
model.c.add(expr= -10 <= model.y2 <= 10)
model.c.add(expr= aml.inequality(-10, model.y2, 10))
if scenario_name == "u20":
model.yu20 = aml.Var()
model.c.add(model.yu20 == model.y2)
Expand Down

0 comments on commit 1deea04

Please # to comment.