Skip to content

Commit e9a70d2

Browse files
authored
Merge pull request #291 from theahura/patch-4
Allow setting programs_per_island from config
2 parents 9df937a + 6dc0036 commit e9a70d2

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

openevolve/config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ class DatabaseConfig:
248248
population_size: int = 1000
249249
archive_size: int = 100
250250
num_islands: int = 5
251+
programs_per_island: Optional[int] = None
251252

252253
# Selection parameters
253254
elite_selection_ratio: float = 0.1

openevolve/process_parallel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ async def run_evolution(
426426
completed_iterations = 0
427427

428428
# Island management
429-
programs_per_island = max(1, max_iterations // (self.config.database.num_islands * 10))
429+
programs_per_island = self.config.database.programs_per_island or max(1, max_iterations // (self.config.database.num_islands * 10))
430430
current_island_counter = 0
431431

432432
# Early stopping tracking

0 commit comments

Comments
 (0)