# Scenarios defining

**URL:** <https://discourse.julialang.org/t/scenarios-defining/79401>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [April 12, 2022, 7:30pm UTC](https://discourse.julialang.org/t/scenarios-defining/79401 "2022-04-12T19:30:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![HosseinF](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/hosseinf/32/35059_2.png) [@HosseinF](https://discourse.julialang.org/u/HosseinF)\
**Post date:** [April 12, 2022, 7:30pm UTC](https://discourse.julialang.org/t/scenarios-defining/79401/1 "2022-04-12T19:30:14Z")

</div>

Hello,

I have near the same stochastic project as @elalaouifaris had in the [Here](https://discourse.julialang.org/t/stochasticprograms-jl-difficulties-with-vector-uncertain-inputs/45957/10) . 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:

```julia
# 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!

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [April 12, 2022, 8:15pm UTC](https://discourse.julialang.org/t/scenarios-defining/79401/2 "2022-04-12T20:15:27Z")

</div>

Looks to me like you are stuck on (the documentation of?) an older version. [Here](https://docs.juliahub.com/StochasticPrograms/ohftP/0.6.3/) I don’t find a reference of `@container_scenario`.
