From 0ff86809d95b4eda08acb4a602f8e19ca78656e5 Mon Sep 17 00:00:00 2001 From: Richard Plevin Date: Fri, 7 Jun 2019 18:48:22 -0700 Subject: [PATCH] Add support for creating an empty Simulation --- src/mcs/defmcs.jl | 2 +- src/mcs/mcs_types.jl | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mcs/defmcs.jl b/src/mcs/defmcs.jl index 3e1313bac..200793b25 100644 --- a/src/mcs/defmcs.jl +++ b/src/mcs/defmcs.jl @@ -165,7 +165,7 @@ macro defsim(expr) # TBD: need to generalize this to support other methods return :(Simulation{$simdatatype}( [$(_rvs...)], - [$(_transforms...)], + TransformSpec[$(_transforms...)], Tuple{Symbol, Symbol}[$(_saves...)], $data)) end diff --git a/src/mcs/mcs_types.jl b/src/mcs/mcs_types.jl index 906536970..b83c0938f 100644 --- a/src/mcs/mcs_types.jl +++ b/src/mcs/mcs_types.jl @@ -161,6 +161,15 @@ mutable struct Simulation{T} end end +""" + Simulation{T}() where T <: AbstractSimulationData + +Allow creation of an "empty" Simulation instance. +""" +function Simulation{T}() where T <: AbstractSimulationData + Simulation{T}([], TransformSpec[], Tuple{Symbol, Symbol}[], T()) +end + """ set_payload!(sim::Simulation, payload)