diff --git a/openevolve/config.py b/openevolve/config.py index 199961325..b0b50c79e 100644 --- a/openevolve/config.py +++ b/openevolve/config.py @@ -288,7 +288,6 @@ class DatabaseConfig: population_size: int = 1000 archive_size: int = 100 num_islands: int = 5 - programs_per_island: Optional[int] = None # Selection parameters elite_selection_ratio: float = 0.1 diff --git a/openevolve/process_parallel.py b/openevolve/process_parallel.py index 5e5ede932..59a4a6b68 100644 --- a/openevolve/process_parallel.py +++ b/openevolve/process_parallel.py @@ -445,12 +445,6 @@ async def run_evolution( next_iteration = current_iteration completed_iterations = 0 - # Island management - programs_per_island = self.config.database.programs_per_island or max( - 1, max_iterations // (self.config.database.num_islands * 10) - ) - current_island_counter = 0 - # Early stopping tracking early_stopping_enabled = self.config.early_stopping_patience is not None if early_stopping_enabled: @@ -543,16 +537,12 @@ async def run_evolution( ) # Island management - if ( - completed_iteration > start_iteration - and current_island_counter >= programs_per_island - ): - self.database.next_island() - current_island_counter = 0 - logger.debug(f"Switched to island {self.database.current_island}") - - current_island_counter += 1 - self.database.increment_island_generation() + # get current program island id + island_id = child_program.metadata.get( + "island", self.database.current_island + ) + #use this to increment island generation + self.database.increment_island_generation(island_idx=island_id) # Check migration if self.database.should_migrate():