Skip to content

Commit 404ebbb

Browse files
committed
[WIP] Rolling horizon
1 parent 0b99795 commit 404ebbb

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

src/model-preparation.jl

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,20 @@ function prepare_profiles_structure(connection)
644644
)
645645

646646
over_clustered_year = Dict(
647-
(row.profile_name, row.year) => [
648-
row.value for row in DuckDB.query(
649-
connection,
650-
"SELECT profile.value
651-
FROM profiles_timeframe AS profile
652-
WHERE
653-
profile.profile_name = '$(row.profile_name)'
654-
AND profile.year = $(row.year)
655-
",
656-
)
657-
] for row in DuckDB.query(
647+
(row.profile_name, row.year) => ProfileWithRollingHorizon(
648+
[
649+
row.value for row in DuckDB.query(
650+
connection,
651+
"SELECT profile.value
652+
FROM profiles_timeframe AS profile
653+
WHERE
654+
profile.profile_name = '$(row.profile_name)'
655+
AND profile.year = $(row.year)
656+
",
657+
)
658+
],
659+
JuMP.VariableRef[],
660+
) for row in DuckDB.query(
658661
connection,
659662
"SELECT DISTINCT
660663
profiles.profile_name,

src/structures.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ mutable struct ProfileLookup
245245
rep_period::Dict{Tuple{String,Int32,Int32},ProfileWithRollingHorizon}
246246

247247
# over_clustered_year[(asset, year)]
248-
over_clustered_year::Dict{Tuple{String,Int32},Vector{Float64}}
248+
over_clustered_year::Dict{Tuple{String,Int32},ProfileWithRollingHorizon}
249249
end
250250

251251
"""

0 commit comments

Comments
 (0)