Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add methods for adding and replacing with a Mimi PseudoDistribution #852

Merged
merged 1 commit into from
Oct 12, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/mcs/defmcs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,12 @@ function add_RV!(sim_def::SimulationDef, rv::RandomVariable)
end

"""
add_RV!(sim_def::SimulationDef, name::Symbol, dist::Distribution)
add_RV!(sim_def::SimulationDef, name::Symbol, dist::Union{Distribution, PseudoDistribution})

Add a random variable with name `name` and distribution `dist` to Simulation definition
`sim_def`. The Simulation's NamedTuple type is updated to include the RV.
"""
add_RV!(sim_def::SimulationDef, name::Symbol, dist::Distribution) = add_RV!(sim_def, RandomVariable(name, dist))
add_RV!(sim_def::SimulationDef, name::Symbol, dist::Union{Distribution, PseudoDistribution}) = add_RV!(sim_def, RandomVariable(name, dist))

"""
replace_RV!(sim_def::SimulationDef, rv::RandomVariable)
Expand All @@ -258,13 +258,13 @@ function replace_RV!(sim_def::SimulationDef, rv::RandomVariable)
end

"""
replace_RV!(sim_def::SimulationDef, name::Symbol, dist::Distribution)
replace_RV!(sim_def::SimulationDef, name::Symbol, dist::Union{Distribution, PseudoDistribution})

Replace the rv with name `name` in the Simulation definition `sim_def` with a new RV
with `name` and distribution `dist`. Update the Simulation's NamedTuple
type accordingly.
"""
replace_RV!(sim_def::SimulationDef, name::Symbol, dist::Distribution) = replace_RV!(sim_def, RandomVariable(name, dist))
replace_RV!(sim_def::SimulationDef, name::Symbol, dist::Union{Distribution, PseudoDistribution}) = replace_RV!(sim_def, RandomVariable(name, dist))

"""
delete_transform!(sim_def::SimulationDef, name::Symbol)
Expand Down