Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
topupopt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmag
topupopt
Commits
dc73e36f
Commit
dc73e36f
authored
8 months ago
by
Pedro L. Magalhães
Browse files
Options
Downloads
Patches
Plain Diff
Revised tests using SOS.
parent
08fba1b9
No related branches found
No related tags found
1 merge request
!7
Added support for convex price functions using the delta formulation and...
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
tests/test_esipp.py
+8
-1
8 additions, 1 deletion
tests/test_esipp.py
tests/test_esipp_prices.py
+0
-18
0 additions, 18 deletions
tests/test_esipp_prices.py
tests/test_esipp_problem.py
+112
-116
112 additions, 116 deletions
tests/test_esipp_problem.py
with
120 additions
and
135 deletions
tests/test_esipp.py
+
8
−
1
View file @
dc73e36f
...
...
@@ -23,6 +23,7 @@ def build_solve_ipp(
solver
:
str
=
'
glpk
'
,
solver_options
:
dict
=
None
,
use_sos_arcs
:
bool
=
False
,
use_sos_arc_groups
:
bool
=
False
,
arc_sos_weight_key
:
str
=
InfrastructurePlanningProblem
.
SOS1_ARC_WEIGHTS_NONE
,
arc_use_real_variables_if_possible
:
bool
=
False
,
use_sos_sense
:
bool
=
False
,
...
...
@@ -134,7 +135,7 @@ def build_solve_ipp(
arc_use_real_variables_if_possible
),
sos1_weight_method
=
arc_sos_weight_key
,
)
)
# set up the use of sos for flow sense determination
...
...
@@ -192,6 +193,12 @@ def build_solve_ipp(
if
type
(
arc_groups_dict
)
!=
type
(
None
):
for
key
in
arc_groups_dict
:
ipp
.
create_arc_group
(
arc_groups_dict
[
key
])
# set up the use of sos for arc selection in groups
if
use_sos_arc_groups
:
for
group_key
,
group
in
ipp
.
arc_groups
.
items
():
ipp
.
groups_arc_sos1
[
group_key
]
=
group
# *********************************************************************
...
...
This diff is collapsed.
Click to expand it.
tests/test_esipp_prices.py
+
0
−
18
View file @
dc73e36f
...
...
@@ -90,9 +90,6 @@ class TestESIPPProblem:
)
assert
not
ipp
.
has_peak_total_assessments
()
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of constraints
"
]
==
10
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of variables
"
]
==
11
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of nonzeros
"
]
==
20
# *********************************************************************
# *********************************************************************
...
...
@@ -194,12 +191,6 @@ class TestESIPPProblem:
)
assert
not
ipp
.
has_peak_total_assessments
()
# print(ipp.results["Problem"][0]["Number of constraints"])
# print(ipp.results["Problem"][0]["Number of variables"])
# print(ipp.results["Problem"][0]["Number of nonzeros"])
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of constraints
"
]
==
14
# 10 prior to nonconvex block
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of variables
"
]
==
13
# 11 prior to nonconvex block
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of nonzeros
"
]
==
28
# 20 prior to nonconvex block
# *********************************************************************
# *********************************************************************
...
...
@@ -372,9 +363,6 @@ class TestESIPPProblem:
)
assert
not
ipp
.
has_peak_total_assessments
()
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of constraints
"
]
==
10
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of variables
"
]
==
11
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of nonzeros
"
]
==
20
# *********************************************************************
# *********************************************************************
...
...
@@ -479,9 +467,6 @@ class TestESIPPProblem:
)
assert
not
ipp
.
has_peak_total_assessments
()
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of constraints
"
]
==
14
# 10 before nonconvex block
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of variables
"
]
==
13
# 11 before nonconvex block
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of nonzeros
"
]
==
28
# 20 before nonconvex block
# *********************************************************************
# *********************************************************************
...
...
@@ -688,9 +673,6 @@ class TestESIPPProblem:
)
assert
not
ipp
.
has_peak_total_assessments
()
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of constraints
"
]
==
23
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of variables
"
]
==
26
assert
ipp
.
results
[
"
Problem
"
][
0
][
"
Number of nonzeros
"
]
==
57
# *********************************************************************
# *********************************************************************
...
...
This diff is collapsed.
Click to expand it.
tests/test_esipp_problem.py
+
112
−
116
View file @
dc73e36f
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment