Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
resite_ip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
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
smart_grids
public
resite_ip
Commits
3a842460
Commit
3a842460
authored
4 years ago
by
David Radu
Browse files
Options
Downloads
Patches
Plain Diff
removed additional solution methods from config and main
parent
5203ee2c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
config_model.yml
+1
-10
1 addition, 10 deletions
config_model.yml
src/main.py
+15
-50
15 additions, 50 deletions
src/main.py
with
16 additions
and
60 deletions
config_model.yml
+
1
−
10
View file @
3a842460
...
...
@@ -33,13 +33,4 @@ siting_params:
p
:
0.1
no_runs
:
100
no_runs_init
:
100
algorithm
:
'
SGH'
# 'MIR', 'SGH'
SGH
:
set
:
False
p
:
0.1
no_runs
:
100
algorithm
:
'
SGH'
DGH
:
set
:
False
no_runs
:
10
algorithm
:
'
DGH'
\ No newline at end of file
algorithm
:
'
SGH'
# 'MIR', 'SGH'
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/main.py
+
15
−
50
View file @
3a842460
...
...
@@ -83,56 +83,21 @@ if __name__ == '__main__':
from
julia
import
Main
Main
.
include
(
"
jl/SitingHeuristics.jl
"
)
if
siting_parameters
[
'
solution_method
'
][
'
SA
'
][
'
set
'
]:
params
=
siting_parameters
[
'
solution_method
'
][
'
SA
'
]
logger
.
info
(
f
"
{
params
[
'
algorithm
'
]
}
_SA chosen to solve the IP.
"
)
jl_sel
,
jl_obj
,
jl_tra
=
Main
.
main_SA
(
jl_dict
[
'
index_dict
'
],
jl_dict
[
'
deployment_dict
'
],
jl_dict
[
'
legacy_site_list
'
],
criticality_data
.
astype
(
'
float64
'
),
float64
(
c
),
params
[
'
neighborhood
'
],
params
[
'
initial_temp
'
],
params
[
'
p
'
],
params
[
'
no_iterations
'
],
params
[
'
no_epochs
'
],
params
[
'
no_runs
'
],
params
[
'
no_runs_init
'
],
params
[
'
algorithm
'
])
output_folder
=
init_folder
(
model_parameters
,
total_no_locs
,
c
,
suffix
=
f
"
_SA_
{
params
[
'
algorithm
'
]
}
_
{
args
[
'
alpha_method
'
]
}
_
{
args
[
'
alpha_coverage
'
]
}
"
f
"
_
{
args
[
'
alpha_norm
'
]
}
_d
{
args
[
'
delta
'
]
}
"
)
elif
siting_parameters
[
'
solution_method
'
][
'
SGH
'
][
'
set
'
]:
params
=
siting_parameters
[
'
solution_method
'
][
'
SGH
'
]
logger
.
info
(
'
Stochastic greedy heuristic chosen to solve the IP.
'
)
jl_sel
,
jl_obj
=
Main
.
main_SGH
(
jl_dict
[
'
index_dict
'
],
jl_dict
[
'
deployment_dict
'
],
jl_dict
[
'
legacy_site_list
'
],
criticality_data
.
astype
(
'
float64
'
),
float64
(
c
),
params
[
'
p
'
],
params
[
'
no_runs
'
],
params
[
'
algorithm
'
])
output_folder
=
init_folder
(
model_parameters
,
total_no_locs
,
c
,
suffix
=
f
"
_SGH_
{
args
[
'
alpha_method
'
]
}
_
{
args
[
'
alpha_coverage
'
]
}
"
f
"
_
{
args
[
'
alpha_norm
'
]
}
_d
{
args
[
'
delta
'
]
}
"
)
elif
siting_parameters
[
'
solution_method
'
][
'
DGH
'
][
'
set
'
]:
params
=
siting_parameters
[
'
solution_method
'
][
'
DGH
'
]
logger
.
info
(
'
Deterministic greedy heuristic chosen to solve the IP.
'
)
jl_sel
,
jl_obj
=
Main
.
main_DGH
(
jl_dict
[
'
index_dict
'
],
jl_dict
[
'
deployment_dict
'
],
jl_dict
[
'
legacy_site_list
'
],
criticality_data
.
astype
(
'
float64
'
),
float64
(
c
),
params
[
'
no_runs
'
],
params
[
'
algorithm
'
])
output_folder
=
init_folder
(
model_parameters
,
total_no_locs
,
c
,
suffix
=
f
"
_DGH_
{
args
[
'
alpha_method
'
]
}
_
{
args
[
'
alpha_coverage
'
]
}
"
f
"
_
{
args
[
'
alpha_norm
'
]
}
_d
{
args
[
'
delta
'
]
}
"
)
else
:
raise
ValueError
(
'
This solution method is not available.
'
)
params
=
siting_parameters
[
'
solution_method
'
][
'
SA
'
]
logger
.
info
(
f
"
{
params
[
'
algorithm
'
]
}
_SA chosen to solve the IP.
"
)
jl_sel
,
jl_obj
,
jl_tra
=
Main
.
main_SA
(
jl_dict
[
'
index_dict
'
],
jl_dict
[
'
deployment_dict
'
],
jl_dict
[
'
legacy_site_list
'
],
criticality_data
.
astype
(
'
float64
'
),
float64
(
c
),
params
[
'
neighborhood
'
],
params
[
'
initial_temp
'
],
params
[
'
p
'
],
params
[
'
no_iterations
'
],
params
[
'
no_epochs
'
],
params
[
'
no_runs
'
],
params
[
'
no_runs_init
'
],
params
[
'
algorithm
'
])
output_folder
=
init_folder
(
model_parameters
,
total_no_locs
,
c
,
suffix
=
f
"
_SA_
{
params
[
'
algorithm
'
]
}
_
{
args
[
'
alpha_method
'
]
}
_
{
args
[
'
alpha_coverage
'
]
}
"
f
"
_
{
args
[
'
alpha_norm
'
]
}
_d
{
args
[
'
delta
'
]
}
"
)
with
open
(
join
(
output_folder
,
'
config_model.yaml
'
),
'
w
'
)
as
outfile
:
yaml
.
dump
(
model_parameters
,
outfile
,
default_flow_style
=
False
,
sort_keys
=
False
)
...
...
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