Skip to content

Commit a921ed4

Browse files
committed
partial progress
1 parent e77abcf commit a921ed4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/reactionsystem.jl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,11 @@ struct ReactionSystem{V <: NetworkProperties} <:
538538
checks && validate(rs)
539539
rs
540540
end
541+
542+
# Copies a reaction system, but with the option of having some fields replaced
543+
function ReactionSystem(rs::ReactionSystem; eqs = rs.eqs, rxs = rs.rxs, iv = rs.iv, sivs = rs.sivs, states = rs.states, species = rs.species, ps = rs.ps, var_to_name = rs.var_to_name, observed = rs.observed, name = rs.name, systems = rs.systems, defaults = rs.defaults, connection_type = rs.connection_type, networkproperties = rs.networkproperties, combinatoric_ratelaws = rs.combinatoric_ratelaws, continuous_events = rs.continuous_events, discrete_events = rs.discrete_events, complete = rs.complete)
544+
new{typeof(networkproperties)}(eqs, rxs, ModelingToolkit.unwrap(iv), ModelingToolkit.unwrap.(sivs), ModelingToolkit.unwrap.(states), ModelingToolkit.unwrap.(species), ModelingToolkit.unwrap.(ps), var_to_name, observed, name, systems, defaults, connection_type, networkproperties, combinatoric_ratelaws, continuous_events, discrete_events, complete)
545+
end
541546
end
542547

543548
function get_speciestype(iv, states, systems)

0 commit comments

Comments
 (0)