File tree Expand file tree Collapse file tree 2 files changed +6
-17
lines changed
Expand file tree Collapse file tree 2 files changed +6
-17
lines changed Original file line number Diff line number Diff line change @@ -288,7 +288,6 @@ class DatabaseConfig:
288288 population_size : int = 1000
289289 archive_size : int = 100
290290 num_islands : int = 5
291- programs_per_island : Optional [int ] = None
292291
293292 # Selection parameters
294293 elite_selection_ratio : float = 0.1
Original file line number Diff line number Diff line change @@ -445,12 +445,6 @@ async def run_evolution(
445445 next_iteration = current_iteration
446446 completed_iterations = 0
447447
448- # Island management
449- programs_per_island = self .config .database .programs_per_island or max (
450- 1 , max_iterations // (self .config .database .num_islands * 10 )
451- )
452- current_island_counter = 0
453-
454448 # Early stopping tracking
455449 early_stopping_enabled = self .config .early_stopping_patience is not None
456450 if early_stopping_enabled :
@@ -543,16 +537,12 @@ async def run_evolution(
543537 )
544538
545539 # Island management
546- if (
547- completed_iteration > start_iteration
548- and current_island_counter >= programs_per_island
549- ):
550- self .database .next_island ()
551- current_island_counter = 0
552- logger .debug (f"Switched to island { self .database .current_island } " )
553-
554- current_island_counter += 1
555- self .database .increment_island_generation ()
540+ # get current program island id
541+ island_id = child_program .metadata .get (
542+ "island" , self .database .current_island
543+ )
544+ #use this to increment island generation
545+ self .database .increment_island_generation (island_idx = island_id )
556546
557547 # Check migration
558548 if self .database .should_migrate ():
You can’t perform that action at this time.
0 commit comments