Scenarios defining

Hello,

I have near the same stochastic project as @elalaouifaris had in the Here . I tried the second way to create the scenarios, but I faced to this error:
LoadError: UndefVarError: @container_scenario not defined

I imported these packages:
using StochasticPrograms, Cbc

I would be grateful if anybody have a solution.

Here is my code:

# AllScenario_all_sources is a dict of this form:
#   (scenario_id => ((source, time_slot)=> source_scenario_value[scenario_id][source][time_slot]))
# --------------------------------
container_scen = Array{Any}
for scen_num in 1:scenario_num
    s_i = AllScenario_all_sources[scen_num]
    prob_i = 1/scenario_num
    container_scen[i] = @container_scenario([s = sources, t = 1:time_slots], s_i[s,t], probability = prob_i)
end


sp = instantiate(simple_model, container_scen, optimizer = Ipopt.Optimizer)
print(sp)
set_optimizer(sp,  Ipopt.Optimizer)
optimize!(sp)

Thanks!

Looks to me like you are stuck on (the documentation of?) an older version. Here I don’t find a reference of @container_scenario.

1 Like