You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
750 B
32 lines
750 B
6 days ago
|
#!/usr/bin/env python3
|
||
|
"""
|
||
|
测试迭代逻辑的脚本
|
||
|
"""
|
||
|
|
||
|
def test_iteration_logic():
|
||
|
"""测试迭代逻辑"""
|
||
|
max_iter = 3
|
||
|
|
||
|
print(f"测试最大迭代次数: {max_iter}")
|
||
|
print("-" * 40)
|
||
|
|
||
|
for it in range(max_iter):
|
||
|
print(f">> Iteration: {it + 1}")
|
||
|
|
||
|
# 模拟搜索任务
|
||
|
print(" 执行搜索任务...")
|
||
|
|
||
|
# 检查是否达到最大迭代次数
|
||
|
if it + 1 < max_iter:
|
||
|
print(" 反思并生成新的子查询...")
|
||
|
print(" 准备下一次迭代")
|
||
|
else:
|
||
|
print(" 达到最大迭代次数,退出")
|
||
|
break
|
||
|
|
||
|
print("-" * 40)
|
||
|
print("测试完成!")
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
test_iteration_logic()
|