Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DEMOSES-distributed-optimization
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
DEMOSES
DEMOSES-distributed-optimization
Commits
a9f7aa90
Commit
a9f7aa90
authored
8 months ago
by
Christian Doh Dinga
Browse files
Options
Downloads
Patches
Plain Diff
call save results function, return wall time in seconds
parent
67766755
No related branches found
No related tags found
1 merge request
!1
Solve distributed admm problem using centralized optimization
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/demoses_distibuted_optimization/run_admm_simulation.py
+7
-2
7 additions, 2 deletions
src/demoses_distibuted_optimization/run_admm_simulation.py
with
7 additions
and
2 deletions
src/demoses_distibuted_optimization/run_admm_simulation.py
+
7
−
2
View file @
a9f7aa90
...
...
@@ -7,6 +7,7 @@ from define_consumer_parameters import define_consumer_parameters
from
define_generator_parameters
import
define_generator_parameters
from
define_results
import
define_results
from
admm_main
import
admm_main
from
save_results
import
save_results
## 1. Read input data required to run the ADMM simulation
...
...
@@ -86,7 +87,7 @@ start_time = timeit.default_timer()
admm_main
(
primal_var_and_λ_EOM
,
admm_parameters
,
EOM
,
models_dict
,
agents
,
data
)
# calculate equilibrium
end_time
=
timeit
.
default_timer
()
admm_parameters
[
"
walltime
"
]
=
(
end_time
-
start_time
)
/
60
# wall time # Calculate wall time in minutes and store in ADMM
admm_parameters
[
"
walltime
"
]
=
(
end_time
-
start_time
)
# wall time # Calculate wall time in minutes and store in ADMM
print
(
"
Find equilibrium solution: done ...
"
)
print
()
...
...
@@ -94,4 +95,8 @@ print(f"Required iterations: {admm_parameters['n_iter']}")
print
()
print
(
f
"
RP EOM:
{
admm_parameters
[
'
Residuals
'
][
'
Primal
'
][
'
EOM
'
][
-
1
]
}
, -- Tolerance:
{
admm_parameters
[
'
Tolerance
'
][
'
EOM
'
]
}
"
)
print
(
f
"
RD EOM:
{
admm_parameters
[
'
Residuals
'
][
'
Dual
'
][
'
EOM
'
][
-
1
]
}
, -- Tolerance:
{
admm_parameters
[
'
Tolerance
'
][
'
EOM
'
]
}
"
)
print
()
\ No newline at end of file
print
()
print
(
"
############### print processing results: start ###############
"
)
save_results
(
EOM
,
admm_parameters
,
primal_var_and_λ_EOM
,
data
,
agents
)
print
(
"
############### print processing results: done ################
"
)
\ No newline at end of file
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