Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于人员被感染,代码问题 #28

Open
decent-cat opened this issue Feb 6, 2020 · 2 comments
Open

关于人员被感染,代码问题 #28

decent-cat opened this issue Feb 6, 2020 · 2 comments

Comments

@decent-cat
Copy link

 float random = new Random().nextFloat();
 if (random < Constants.BROAD_RATE && distance(person) < SAFE_DIST) {
        this.beInfected();
        break;
 }

这个地方 random不应该是大于 Constants.BROAD_RATE 感染率吗?可能是我理解错了吧

@chenbo1989
Copy link

< BROAD_RATE 表示概率,没问题的。只是应该仅在潜伏期和确诊两个状态才能感染人。还可以考虑已治愈的免疫期

@decent-cat
Copy link
Author

< BROAD_RATE 表示概率,没问题的。只是应该仅在潜伏期和确诊两个状态才能感染人。还可以考虑已治愈的免疫期
明白了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants