AlgebraicJulia / AlgebraicJulia/Structured-Epidemic-Modeling

Problem wiring a simple SEIR model

Open
#7 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
16
Forks
5
PR merge metrics
No merged PRs in 30d

Description

For some reason, the following code for an SEIR model wires E to R, rather than I to R. Can anyone spot where I'm going wrong?

```julia
using AlgebraicPetri,AlgebraicPetri.TypedPetri
using Catlab, Catlab.CategoricalAlgebra, Catlab.Programs
using Catlab.WiringDiagrams, Catlab.Graphics
using AlgebraicDynamics.UWDDynam

epi_transitions = LabelledPetriNet(
[:Pop],
:infection=>((:Pop, :Pop)=>(:Pop, :Pop)),
:progression=>(:Pop=>:Pop),
:recovery=>(:Pop=>:Pop)
)

seir_uwd = @relation () where (S::Pop, E::Pop, I::Pop, R::Pop) begin
infection(S, I, E, I)
progression(E, I)
recovery(I, R)
end
seir_acst = oapply_typed(epi_transitions, seir_uwd, [:β, :δ, :γ])
seir_lpn = dom(seir_acst)
Graph(seir_lpn)
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.