我试图执行SIR epidemic model。基本上,我理解模型的方式是,在每个时间步,它告诉我们有多少节点被感染,有多少节点被恢复。我现在试图将其转换为离散事件模拟,并且在一点上感到困惑。将数学问题转换为离散事件模拟
该模型通常使用欧拉方法求解。现在,当我将它转换成离散事件仿真,我做这样的事情(数字是用于清晰度):
Initialize 100 members
At every time step t,
//Determine how many get infected
for i = 1 to 100
let i pass a message to its neighbors
When the neighbor receives the message from an infected member, it generates a random number and if it is less than beta*(infected/total), where beta is the infection rate, then the member gets infected
Update the count for infected, recovered, susceptible
//Determine how many are recovered
for i = 1 to 100
Generate a random number from a uniform distribution and check if it is less than gamma*infected. If it is, then this member is recovered.
Update the count for infected, recovered, susceptible
我基本上想,如果上面的方法是正确的。有什么建议么?
我知道这已经很晚了,但是有没有不使用Gillespie算法的原因?你正在使用的不是离散事件相当于ODE公式(至少我认为)。 http://en.wikipedia.org/wiki/Gillespie_algorithm – MHH 2014-05-15 20:40:40