This is a helper function to tranform GillesieSSA-style paramters to GillespieSSA2.
Arguments
- x0
The
x0parameter ofGillespieSSA::ssa().- a
The
aparameter ofGillespieSSA::ssa().- nu
The
nuparameter ofGillespieSSA::ssa().
Value
A set of reaction()s to be used by ssa().
Examples
x0 <- c(Y1 = 1000, Y2 = 1000)
a <- c("c1*Y1","c2*Y1*Y2","c3*Y2")
nu <- matrix(c(+1,-1,0,0,+1,-1),nrow=2,byrow=TRUE)
port_reactions(x0, a, nu)
#> [[1]]
#> Reaction:
#> - Propensity: c1*Y1
#> - Effects: Y1: +1
#>
#> [[2]]
#> Reaction:
#> - Propensity: c2*Y1*Y2
#> - Effects: Y1: -1, Y2: +1
#>
#> [[3]]
#> Reaction:
#> - Propensity: c3*Y2
#> - Effects: Y2: -1
#>