首页 > 编程语言 > 详细

Zombie apocalypse in R or Python

时间:2019-07-13 21:43:37      阅读:80      评论:0      收藏:0      [点我收藏+]


Zombie apocalypse in R or Python

We have seen that Monte Carlo simulations can be very useful for modelling complex situations, often in the real world. Examples of this include the predator/prey model that is designed to simulation populations of wildlife. Recently the BBC ran a program modelling the effect of a flu pandemic in the UK which used a Monte Carlo simulation:

https://www.bbc.co.uk/programmes/p059y0p1 Contagion! The BBC Four Pandemic

However, as we have been hearing about zombie outbreaks during the intensive week, for this assignment you are asked to model an outbreak of zombies. I’ve included a paper on the maths of modelling such an outbreak that shows the factors for the model and how it can be solved mathematically. This web page : http://scipy-

代写Zombie apocalypse作业、代做R/Python编程语言作业、代写R,Python课程设计作业cookbook.readthedocs.io/items/Zombie_Apocalypse_ODEINT.html gives the equation as:

dS/dt = P - BSZ - dS dZ/dt = BSZ + GR - ASZ dR/dt = dS + ASZ - GR

with the following factors:
S: the number of susceptible victims
Z: the number of zombies
R: the number of people "killed"
P: the population birth rate
d: the chance of a natural death
B: the chance the "zombie disease" is transmitted (an alive person becomes a zombie)
G: the chance a dead person is resurrected into a zombie
A: the chance a zombie is totally destroyed

This page shows how to use Python to solve this equation as an ordinary differential equation. However, while this solves the equation over time, it does not give us an idea of how fast the zombies will travel. So we need to add a new factor:

V: Speed of a zombie.
And possibly
v: Speed of a non-infected person.

Now we have added that factor the equation can not be solved as easily. This can be modelled by a random walk simulation, with the first set of factors controlling the population and the chance of a victim. You might like to set up the model with geographically separated non infected populations and investigate how the infection spreads.

For this assignment write a model in R or Python (or both if you think it help) to model a Zombie outbreak with geographically separated populations. Show how the factors above effect the speed of the outbreak.

Write a report on the code you have produced and any results you have generated. Include your code in the appendix (and a zip file of the code). Your report should be less than 10 pages not including code. If you have a large number of illustrations include them in the appendix.

因为专业,所以值得信赖。如有需要,请加QQ:99515681 或邮箱:99515681@qq.com

微信:codehelp

Zombie apocalypse in R or Python

原文:https://www.cnblogs.com/pythonhea/p/11182154.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!