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

关于:if t > self.create_num * self.loop_t / self.change_rate #16

Open
Chen8566 opened this issue Sep 23, 2021 · 1 comment
Open

Comments

@Chen8566
Copy link

大佬,在看代码的时候看到
if t > self.create_num * self.loop_t / self.change_rate: break

公式应该是 t > (生成数量×2)/改变率,就结束while循环
但是没有看懂o(╥﹏╥)o为什么需要这个,求指教!!

ps:
self.loop_t 参数是什么意义啊,赋值为2是有什么原因么

@425776024
Copy link
Owner

大佬,在看代码的时候看到
if t > self.create_num * self.loop_t / self.change_rate: break

公式应该是 t > (生成数量×2)/改变率,就结束while循环
但是没有看懂o(╥﹏╥)o为什么需要这个,求指教!!

ps:
self.loop_t 参数是什么意义啊,赋值为2是有什么原因么

防止没有添加到足够多的数据而一直陷入死循环,越大循环次数越多,越慢。不过通常情况下能快速获得指定数量的文本,所以一般不会执行break。存在一定概率很多次还没有获得指定数量的增强文本,则强制退出。

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