-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix handling of zero loss in LossLink and WTW nodes.
When a constant zero loss is provided to LossLink or WTW nodes then no relationship is created on the internal aggregated node. This left the added Output node unconstrained. This fix ensures that the Output node is separately constrained to zero max_flow when there is zero loss.
- Loading branch information
Showing
6 changed files
with
351 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
time_start,time_end,scenario_index,metric_set,name,attribute,value | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,loss1,Inflow,10.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,loss1,Outflow,10.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,loss1,Loss,0.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,spill1,Inflow,5.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,loss1,Inflow,10.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,loss1,Outflow,10.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,loss1,Loss,0.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,spill1,Inflow,5.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,loss1,Inflow,10.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,loss1,Outflow,10.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,loss1,Loss,0.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,spill1,Inflow,5.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
{ | ||
"metadata": { | ||
"title": "Loss Link Test 1", | ||
"description": "Test LossLink with zero loss", | ||
"minimum_version": "0.1" | ||
}, | ||
"timestepper": { | ||
"start": "2015-01-01", | ||
"end": "2015-01-03", | ||
"timestep": 1 | ||
}, | ||
"network": { | ||
"nodes": [ | ||
{ | ||
"meta": { | ||
"name": "input1" | ||
}, | ||
"type": "Catchment", | ||
"flow": { | ||
"type": "Constant", | ||
"value": 15.0 | ||
} | ||
}, | ||
{ | ||
"meta": { | ||
"name": "loss1" | ||
}, | ||
"type": "LossLink", | ||
"loss_factor": { | ||
"type": "Net", | ||
"factor": { | ||
"type": "Constant", | ||
"value": 0.0 | ||
} | ||
} | ||
}, | ||
{ | ||
"meta": { | ||
"name": "demand1" | ||
}, | ||
"type": "Output", | ||
"max_flow": { | ||
"type": "Constant", | ||
"value": 10.0 | ||
}, | ||
"cost": { | ||
"type": "Constant", | ||
"value": -10 | ||
} | ||
}, | ||
{ | ||
"meta": { | ||
"name": "spill1" | ||
}, | ||
"type": "Output", | ||
"cost": { | ||
"type": "Constant", | ||
"value": 10 | ||
} | ||
} | ||
], | ||
"edges": [ | ||
{ | ||
"from_node": "input1", | ||
"to_node": "loss1" | ||
}, | ||
{ | ||
"from_node": "loss1", | ||
"to_node": "demand1" | ||
}, | ||
{ | ||
"from_node": "input1", | ||
"to_node": "spill1" | ||
} | ||
], | ||
"metric_sets": [ | ||
{ | ||
"name": "nodes", | ||
"metrics": [ | ||
{ | ||
"type": "Node", | ||
"name": "loss1", | ||
"attribute": "Inflow" | ||
}, | ||
{ | ||
"type": "Node", | ||
"name": "loss1", | ||
"attribute": "Outflow" | ||
}, | ||
{ | ||
"type": "Node", | ||
"name": "loss1", | ||
"attribute": "Loss" | ||
}, | ||
{ | ||
"type": "Node", | ||
"name": "spill1", | ||
"attribute": "Inflow" | ||
} | ||
] | ||
} | ||
], | ||
"outputs": [ | ||
{ | ||
"name": "node-outputs", | ||
"type": "CSV", | ||
"format": "long", | ||
"filename": "loss_link2.csv", | ||
"metric_set": [ | ||
"nodes" | ||
], | ||
"decimal_places": 1 | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
time_start,time_end,scenario_index,metric_set,name,attribute,value | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,wtw1,Inflow,10.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,wtw1,Outflow,10.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,wtw1,Loss,0.0 | ||
2015-01-01T00:00:00,2015-01-02T00:00:00,0,nodes,spill1,Inflow,10.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,wtw1,Inflow,10.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,wtw1,Outflow,10.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,wtw1,Loss,0.0 | ||
2015-01-02T00:00:00,2015-01-03T00:00:00,0,nodes,spill1,Inflow,10.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,wtw1,Inflow,10.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,wtw1,Outflow,10.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,wtw1,Loss,0.0 | ||
2015-01-03T00:00:00,2015-01-04T00:00:00,0,nodes,spill1,Inflow,10.0 |
Oops, something went wrong.