Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MarkovProcesses.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bentriou Mahmoud
MarkovProcesses.jl
Commits
9b95dca2
Commit
9b95dca2
authored
3 years ago
by
Bentriou Mahmoud
Browse files
Options
Downloads
Patches
Plain Diff
small fix in sir tau leap simulation
parent
c1d2be9c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/SIR_tauleap.jl
+4
-3
4 additions, 3 deletions
models/SIR_tauleap.jl
with
4 additions
and
3 deletions
models/SIR_tauleap.jl
+
4
−
3
View file @
9b95dca2
@everywhere
import
Distributions
:
Poisson
,
rand
d
=
3
d
=
4
k
=
3
dict_var_SIR_tauleap
=
Dict
(
:
S
=>
1
,
:
I
=>
2
,
:
R
=>
3
)
dict_var_SIR_tauleap
=
Dict
(
:
S
=>
1
,
:
I
=>
2
,
:
R
=>
3
,
:
step
=>
4
)
dict_p_SIR_tauleap
=
Dict
(
:
ki
=>
1
,
:
kr
=>
2
,
:
tau
=>
3
)
l_tr_SIR_tauleap
=
[
:
U
]
p_SIR_tauleap
=
[
0.0012
,
0.05
,
5.0
]
x0_SIR_tauleap
=
[
95
,
5
,
0
]
x0_SIR_tauleap
=
[
95
,
5
,
0
,
0
]
t0_SIR_tauleap
=
0.0
@everywhere
function
SIRTauleap_f!
(
xnplus1
::
Vector
{
Int
},
l_t
::
Vector
{
Float64
},
l_tr
::
Vector
{
Transition
},
xn
::
Vector
{
Int
},
tn
::
Float64
,
p
::
Vector
{
Float64
})
...
...
@@ -28,6 +28,7 @@ t0_SIR_tauleap = 0.0
for
i
=
1
:
3
@inbounds
xnplus1
[
i
]
=
xn
[
i
]
+
nbr_R1
*
nu_1
[
i
]
+
nbr_R2
*
nu_2
[
i
]
end
xnplus1
[
4
]
+=
1
l_t
[
1
]
=
tn
+
tau
l_tr
[
1
]
=
:
U
end
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment