From e6845ee7438ad095ccf099c5a79afa3b32451340 Mon Sep 17 00:00:00 2001 From: Amol Kapoor Date: Wed, 8 Oct 2025 21:40:29 -0700 Subject: [PATCH] Use combined_score for target_score analysis instead of an average of all numeric scores --- openevolve/process_parallel.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/openevolve/process_parallel.py b/openevolve/process_parallel.py index cda266b5..7ff9ddf8 100644 --- a/openevolve/process_parallel.py +++ b/openevolve/process_parallel.py @@ -586,16 +586,12 @@ async def run_evolution( # Check target score if target_score is not None and child_program.metrics: - numeric_metrics = [ - v for v in child_program.metrics.values() if isinstance(v, (int, float)) - ] - if numeric_metrics: - avg_score = sum(numeric_metrics) / len(numeric_metrics) - if avg_score >= target_score: - logger.info( - f"Target score {target_score} reached at iteration {completed_iteration}" - ) - break + if ('combined_score' in child_program.metrics and + child_program.metrics['combined_score'] >= target_score): + logger.info( + f"Target score {target_score} reached at iteration {completed_iteration}" + ) + break # Check early stopping if early_stopping_enabled and child_program.metrics: