Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
采用了动态的流动意向平均值(使用双曲正切函数拟合)而不是静态的流动意向平均值。其函数图像以感染人数比作为横坐标,流动意向平均值作为纵坐标,函数解析式为
g(t) = tanh(2 * t)
。其横坐标感染人数比使用
f(x) = -2 * x + 1
,其中x表示感染人数的百分比,定义域为[0, 1]
, 值域为[-1,1]
。这一函数目的是将感染人数百分比取值范围转化为[-1, 1]
。g(t)中t就是上面使用了上述
f(x) = -2 * x + 1
函数转化后的感染比,g(t)定义域为[-1, 1]
,值域为[-1, 1]
函数图像如下之所以这么做的原因是因为在现实中,当感染比例不大的时候,人们不以为然,想要移动的意向更大。而在感染比例增大的时候,人们非常害怕,想要移动的概率就会极具减小。这样显然会更符合客观规律,模拟出来的结果也更真实。