Skip to content
Snippets Groups Projects
  • Bentriou Mahmoud's avatar
    5d886fc4
    The package becomes more meta to reach higher performance. · 5d886fc4
    Bentriou Mahmoud authored
    This commit groups the change operated to the creation of models and
    simulate function of a ContinuousTimeModel.
    The general idea is to create a concrete type and a simulate function
     per model creation by metaprogramming.
    - Now, ContinuousTimeModel is an abstract type. Each creation of a model
    defines a concrete type T <: ContinuousTimeModel by meta programming.
    - f! and isabsorbing ContinuousTimeModel fields are Symbols.
    - simulate(::ContinuousTimeModel) is run by multiple dispatch, according
    to the type of the model.
    
    Can't run the whole tests for now but unit/simulate_available_models.jl
    runs properly (i've updated the list of models in this commit), and I've
    manually checked in the repl that simulations run correctly (distributed
    / plots).
    5d886fc4
    History
    The package becomes more meta to reach higher performance.
    Bentriou Mahmoud authored
    This commit groups the change operated to the creation of models and
    simulate function of a ContinuousTimeModel.
    The general idea is to create a concrete type and a simulate function
     per model creation by metaprogramming.
    - Now, ContinuousTimeModel is an abstract type. Each creation of a model
    defines a concrete type T <: ContinuousTimeModel by meta programming.
    - f! and isabsorbing ContinuousTimeModel fields are Symbols.
    - simulate(::ContinuousTimeModel) is run by multiple dispatch, according
    to the type of the model.
    
    Can't run the whole tests for now but unit/simulate_available_models.jl
    runs properly (i've updated the list of models in this commit), and I've
    manually checked in the repl that simulations run correctly (distributed
    / plots).
intracellular_viral_infection.jl 583 B

intracellular_viral_infection = @network_model begin
    R1: (N + T => G + T, k1 * T * cn)
    R2: (N + G => T, k2 * G * cn)
    R3: (N + A + T => S + T, k3 * T * cn * ca)
    R4: (T => ∅, k4 * T)
    R5: (S => ∅, k5 * S)
    R6: (G + S => V, k6 * G * S)
end "Intracellular viral infection pkg"

set_x0!(intracellular_viral_infection, [:N, :A, :G, :T, :S, :V], [10000, 10000, 0, 1, 0, 0])
set_param!(intracellular_viral_infection, [:cn, :ca, :k1, :k2, :k3, :k4, :k5, :k6], [1.0, 1.0, 1.0, 0.025, 100.0, 0.25, 0.2, 7.5E-6])
set_time_bound!(intracellular_viral_infection, 200.0)