make sure we have enough samples before checking termination inactivity threshold

main
xenofem 2022-02-24 00:38:04 -05:00
parent 710fc9fe81
commit 595c8026bf
1 changed files with 6 additions and 1 deletions

View File

@ -132,6 +132,11 @@ while True:
), end='')
sys.stdout.flush()
if final and current >= args.termination_value_threshold*final and all(d == 0 for d in deltas[-args.termination_inactivity_threshold:]):
if (
final
and current >= args.termination_value_threshold*final
and len(deltas) >= args.termination_inactivity_threshold
and all(d == 0 for d in deltas[-args.termination_inactivity_threshold:])
):
print()
break