A dataclass to hold the final result of an evolution run.
| 20 | |
| 21 | @dataclass |
| 22 | class EvolutionResult: |
| 23 | """A dataclass to hold the final result of an evolution run.""" |
| 24 | |
| 25 | best_program: Optional[Program] # The full Program object of the best solution |
| 26 | best_score: float # The primary score of the best solution |
| 27 | best_code: str # The source code of the best solution |
| 28 | metrics: Dict[str, Any] # The full metrics dictionary of the best solution |
| 29 | output_dir: Optional[str] # The directory where results were saved (None if cleaned up) |
| 30 | |
| 31 | def __repr__(self): |
| 32 | """Provide a concise string representation of the result.""" |
| 33 | return f"EvolutionResult(best_score={self.best_score:.4f})" |
| 34 | |
| 35 | |
| 36 | def run_evolution( |
no outgoing calls
no test coverage detected