-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added a modeler test with an int variable (have to used scip bc sirius does not support this) - Added the objective value to the output file - Added test steps to test the objective value - Added test steps to make it more simple to test variable values - Added description to existing tests --------- Signed-off-by: Peter Mitri <[email protected]>
- Loading branch information
Showing
11 changed files
with
158 additions
and
29 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
49 changes: 28 additions & 21 deletions
49
src/tests/cucumber/features/modeler-features/epic2/us2.5.feature
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 |
---|---|---|
@@ -1,36 +1,43 @@ | ||
Feature: 2.5 - Pure modeler simple studies, with no ports and no timeseries | ||
|
||
Scenario: 2.5.1: One model with one load and two generators, one timestamp | ||
Scenario: 2.5.1: One model with one load and two generators, one timestep | ||
Given the study path is "modeler/epic2/us2.5/study_2.5.1" | ||
When I run antares modeler | ||
Then the simulation succeeds | ||
And the objective value is 160 | ||
And the optimal value of variable node1.gen1_p_0 is 80 | ||
And the optimal value of variable node1.gen2_p_0 is 20 | ||
|
||
Scenario: 2.5.2: One model with one load and two generators (minP), three timestamps | ||
Scenario: 2.5.2: One model with one load and two generators (minP), three timesteps | ||
Given the study path is "modeler/epic2/us2.5/study_2.5.2" | ||
When I run antares modeler | ||
Then the simulation succeeds | ||
And the optimal value of variable node1.gen1_up_0 is 1 | ||
And the optimal value of variable node1.gen1_up_1 is 1 | ||
And the optimal value of variable node1.gen1_up_2 is 1 | ||
And the optimal value of variable node1.gen1_p_0 is 60 | ||
And the optimal value of variable node1.gen1_p_1 is 60 | ||
And the optimal value of variable node1.gen1_p_2 is 60 | ||
And the optimal value of variable node1.gen2_up_0 is 1 | ||
And the optimal value of variable node1.gen2_up_1 is 1 | ||
And the optimal value of variable node1.gen2_up_2 is 1 | ||
And the optimal value of variable node1.gen2_p_0 is 40 | ||
And the optimal value of variable node1.gen2_p_1 is 40 | ||
And the optimal value of variable node1.gen2_p_2 is 40 | ||
And the objective value is 810 | ||
And the optimal values of the variables are | ||
| component | variable | timestep | value | | ||
| node1 | gen1_up | 0-2 | 1 | | ||
| node1 | gen1_p | 0-2 | 60 | | ||
| node1 | gen1_up | 0-2 | 1 | | ||
| node1 | gen2_p | 0-2 | 40 | | ||
|
||
Scenario: 2.5.3: Two libs, one timestamp | ||
Scenario: 2.5.3: Two libs, one timestep | ||
Given the study path is "modeler/epic2/us2.5/study_2.5.3" | ||
When I run antares modeler | ||
Then the simulation succeeds | ||
And the optimal value of variable node1.gen1_p_0 is 0 | ||
And the optimal value of variable node1.gen2_p_0 is 100 | ||
And the optimal value of variable node2.gen1_p_0 is 500 | ||
And the optimal value of variable node2.gen1_up_0 is 1 | ||
And the optimal value of variable node2.gen2_p_0 is 500 | ||
And the optimal value of variable node2.gen2_up_0 is 1 | ||
And the objective value is 15600 | ||
And the optimal values of the variables are | ||
| component | variable | timestep | value | | ||
| node1 | gen1_p | 0 | 0 | | ||
| node1 | gen2_p | 0 | 100 | | ||
| node2 | gen1_p | 0 | 500 | | ||
| node2 | gen1_up | 0 | 1 | | ||
| node2 | gen2_p | 0 | 500 | | ||
| node2 | gen2_up | 0 | 1 | | ||
|
||
Scenario: 2.5.4: Test with integer variable | ||
Given the study path is "modeler/epic2/us2.5/study_2.5.4" | ||
When I run antares modeler | ||
Then the simulation succeeds | ||
And the objective value is 540 | ||
And the optimal value of variable node1.gen_total_p_0 is 1000 | ||
And the optimal value of variable node1.gen_n_on_0 is 4 |
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
3 changes: 2 additions & 1 deletion
3
src/tests/resources/modeler/epic2/us2.5/study_2.5.1/input/system.yml
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
4 changes: 3 additions & 1 deletion
4
src/tests/resources/modeler/epic2/us2.5/study_2.5.2/input/system.yml
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
7 changes: 6 additions & 1 deletion
7
src/tests/resources/modeler/epic2/us2.5/study_2.5.3/input/system.yml
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
43 changes: 43 additions & 0 deletions
43
src/tests/resources/modeler/epic2/us2.5/study_2.5.4/input/model-libraries/lib_example3.yml
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,43 @@ | ||
library: | ||
id: lib_example3 | ||
description: test model library | ||
|
||
models: | ||
- id: node_genCluster_oneLoad | ||
description: A simple node with a generator cluster and one load, to test integer variables | ||
parameters: | ||
- id: load | ||
time-dependent: false | ||
scenario-dependent: false | ||
- id: gen_max_p | ||
time-dependent: false | ||
scenario-dependent: false | ||
- id: gen_min_p | ||
time-dependent: false | ||
scenario-dependent: false | ||
- id: gen_cluster_size | ||
time-dependent: false | ||
scenario-dependent: false | ||
- id: gen_prop_cost | ||
time-dependent: false | ||
scenario-dependent: false | ||
- id: gen_fixed_cost | ||
time-dependent: false | ||
scenario-dependent: false | ||
variables: | ||
- id: gen_total_p | ||
lower-bound: 0 | ||
upper-bound: gen_max_p * gen_cluster_size | ||
variable-type: continuous | ||
- id: gen_n_on | ||
lower-bound: 0 | ||
upper-bound: gen_cluster_size | ||
variable-type: integer | ||
constraints: | ||
- id: respect_min_p | ||
expression: gen_total_p >= gen_n_on * gen_min_p | ||
- id: respect_max_p | ||
expression: gen_total_p <= gen_n_on * gen_max_p | ||
- id: balance | ||
expression: gen_total_p = load | ||
objective: gen_total_p * gen_prop_cost + gen_n_on * gen_fixed_cost |
29 changes: 29 additions & 0 deletions
29
src/tests/resources/modeler/epic2/us2.5/study_2.5.4/input/system.yml
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,29 @@ | ||
system: | ||
id: sys_example4 | ||
description: a node with up to 10 similar generators (min_p=150, max_p=300, cost = 0.5 €/MWh + 10€/hour of up time). | ||
Load is of 1000MW; thus 4 generators should be used. Objective = 1000*0.5 + 4*10 = 540. | ||
model-libraries: lib_example3 | ||
|
||
components: | ||
- id: node1 | ||
model: lib_example3.node_genCluster_oneLoad | ||
scenario-group: sg | ||
parameters: | ||
- id: load | ||
type: constant | ||
value: 1000 | ||
- id: gen_min_p | ||
type: constant | ||
value: 150 | ||
- id: gen_max_p | ||
type: constant | ||
value: 300 | ||
- id: gen_cluster_size | ||
type: constant | ||
value: 10 | ||
- id: gen_prop_cost | ||
type: constant | ||
value: 0.5 | ||
- id: gen_fixed_cost | ||
type: constant | ||
value: 10 |
20 changes: 20 additions & 0 deletions
20
src/tests/resources/modeler/epic2/us2.5/study_2.5.4/output/problem.lp
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,20 @@ | ||
\ Generated by MPModelProtoExporter | ||
\ Name : | ||
\ Format : Free | ||
\ Constraints : 3 | ||
\ Variables : 2 | ||
\ Binary : 0 | ||
\ Integer : 1 | ||
\ Continuous : 1 | ||
Minimize | ||
Obj: +10 node1.gen_n_on_0 +0.5 node1.gen_total_p_0 | ||
Subject to | ||
node1.balance_0: +1 node1.gen_total_p_0 = 1000 | ||
node1.respect_max_p_0: -300 node1.gen_n_on_0 +1 node1.gen_total_p_0 <= -0 | ||
node1.respect_min_p_0: -150 node1.gen_n_on_0 +1 node1.gen_total_p_0 >= -0 | ||
Bounds | ||
0 <= node1.gen_n_on_0 <= 10 | ||
0 <= node1.gen_total_p_0 <= 3000 | ||
Generals | ||
node1.gen_n_on_0 | ||
End |
6 changes: 6 additions & 0 deletions
6
src/tests/resources/modeler/epic2/us2.5/study_2.5.4/parameters.yml
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,6 @@ | ||
solver: scip | ||
solver-logs: false | ||
solver-parameters: | ||
no-output: false | ||
first-time-step: 0 | ||
last-time-step: 0 |