How to create a rolling horizon approach?

Hi guys, I failed my first attempt for my bachelor thesis :frowning: , luckily I got a chance to correct my failings, and I have to give a Julia model (link below) a ‘rolling horizon approach’, where an agents optimizes for one year at the time instead of optimizing for the whole period of the model. I’m just stuck on how to do it, is there somebody who can help me out? Please send me a message! Much appreciated! KU Leuven Energy Systems Integration and Modeling group / ETS - NC · GitLab

Hi there,
I don’t think you will someone here that will do the work for you - if that is what you intended to ask. It would also miss the point of doing a Bachelor’s and probably break rules.

However if you have specific questions about code or how to approach an implementation and can show that you tried some things and you will find a lot of helpful persons in this place :slight_smile: But you need to put in effort yourself!

So what are you stuck on? What have you tried? What is your current understanding? Post some code you don’t understand and try to be as specific as possible as to what you don’t understand.

Thanks for your answer,

It was not my intention to have someone else do the work; I apologize if it was interpreted that way. I’ll try to be more precise.

What I have tried so far is replacing the solving function SOLVE_repr_agent!(mod) with a preliminary loop (for year in 1:data[“nyears”]
optimize_single_year(year, mod, data, scenario_overview_row, ETS)
Update the data and parameters for the next year,(?)
update_parameters_and_constraints
println(“Optimizing year $(year)…”)
end)

I have one auxiliary function for the optimization of one year:
function optimize_single_year(year, mod, data, scenario_overview_row, ETS)
set_time_horizon(mod, year)
update_parameters_and_constraints!(mod, data, scenario_overview_row, ETS, year)
optimize!(mod)
return
end

I’m not sure where to update the parameters and how to set the time_horizon, but I understand that it needs to be more concrete before I can get help.