added CHECKPOINT_OPTIMIZATION_ROUNDS config parameter
This commit is contained in:
parent
2bca2b1b65
commit
d337ddd503
2 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,7 @@ WIDTH: int = 640
|
|||
HEIGHT: int = 480
|
||||
|
||||
POPULATION_SIZE: int = 1000
|
||||
CHECKPOINT_OPTIMIZATION_ROUNDS: int = 20
|
||||
|
||||
LEVEL: Level = [
|
||||
Level(
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import random
|
||||
from typing import List
|
||||
|
||||
from config import CHECKPOINT_OPTIMIZATION_ROUNDS
|
||||
from dot import Dot
|
||||
from game import Game
|
||||
|
||||
|
@ -72,7 +73,7 @@ class Population:
|
|||
self.game.current_target += 1
|
||||
self.game.target_countdown = None
|
||||
elif not self.best_dot.reached_final_goal and self.best_dot.reached_goal:
|
||||
self.game.target_countdown: int = 20
|
||||
self.game.target_countdown: int = CHECKPOINT_OPTIMIZATION_ROUNDS
|
||||
|
||||
if self.game.target_countdown:
|
||||
print(f" Optimizing this checkpoint for {self.game.target_countdown} more generations")
|
||||
|
|
Reference in a new issue