Skip to content

Commit 3b38adf

Browse files
committed
[UPD] remove deprecated function generate_scenarios
1 parent b61234b commit 3b38adf

File tree

1 file changed

+0
-34
lines changed

1 file changed

+0
-34
lines changed

src/noises.jl

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -129,40 +129,6 @@ function sampling(law::Vector{NoiseLaw}, t::Int64)
129129
end
130130

131131

132-
"""
133-
DEPRECATED
134-
Simulate n scenarios according to a given NoiseLaw
135-
136-
Parameters:
137-
- law::Vector{NoiseLaw}
138-
Vector of discrete independent random variables
139-
- n::Int
140-
number of simulations to compute
141-
142-
Returns :
143-
- scenarios Array(Float64,n,T)
144-
an Array of scenarios, scenarios[i,:] being the ith noise scenario
145-
"""
146-
function generate_scenarios(laws::Vector{NoiseLaw}, n::Int64)
147-
warn("deprecated generate_scenarios use simulate_scenarios")
148-
if n <= 0
149-
error("negative number of simulations")
150-
end
151-
Tf = length(laws)
152-
scenarios = Array{Vector{Float64}}(n,Tf)
153-
for i = 1:n#TODO can be parallelized
154-
scenario = []
155-
for t=1:Tf
156-
new_val = laws[t].support[:, rand(Categorical(laws[t].proba))]
157-
push!(scenario, new_val)
158-
end
159-
scenarios[i,:]=scenario
160-
end
161-
162-
return scenarios
163-
end
164-
165-
166132
"""
167133
Simulate n scenarios and return a 3D array
168134

0 commit comments

Comments
 (0)