Skip to content

Commit 56aa7a1

Browse files
committed
fix is_finished_by_max_generations by comparing scale_generation, not current_generation
1 parent 60481b5 commit 56aa7a1

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/strategy/evolve.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ impl<
427427

428428
fn is_finished_by_max_generations(&self) -> bool {
429429
if let Some(max_generations) = self.config.max_generations {
430-
self.state.current_generation >= max_generations
430+
self.state.scale_generation >= max_generations
431431
} else {
432432
false
433433
}

src/strategy/hill_climb.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ impl<G: HillClimbGenotype, F: Fitness<Genotype = G>, SR: StrategyReporter<Genoty
387387

388388
fn is_finished_by_max_generations(&self) -> bool {
389389
if let Some(max_generations) = self.config.max_generations {
390-
self.state.current_generation >= max_generations
390+
self.state.scale_generation >= max_generations
391391
} else {
392392
false
393393
}

0 commit comments

Comments
 (0)