Closed fqiang closed 8 years ago
function StochasticModel(nscen::Int)
m = JuMP.Model(solver=JuMP.UnsetSolver())
m.ext[:Stochastic] = StochasticData(JuMP.Model[],nothing,nscen)
return m
end
adding explicit constructor works.
You need to specify this with a keyword argument:
firststage = StochasticModel(num_scenarios=2)
julia> firststage = StochasticModel(2) ERROR: MethodError:
StochasticModel
has no method matching StochasticModel(::Int64) Closest candidates are: StochasticModel(::Any, ::Any) StochasticModel(::Any, ::Any, ::Any)Or how about to auto increment the number for each adding of the children stochastic block?