Determine if program1 has better FITNESS than program2 Uses fitness calculation that excludes MAP-Elites feature dimensions to prevent pollution of fitness comparisons. Args: program1: First program program2: Second program Returns:
(self, program1: Program, program2: Program)
| 1099 | return self._llm_judge_novelty(program, self.programs[max_smlty_pid]) |
| 1100 | |
| 1101 | def _is_better(self, program1: Program, program2: Program) -> bool: |
| 1102 | """ |
| 1103 | Determine if program1 has better FITNESS than program2 |
| 1104 | |
| 1105 | Uses fitness calculation that excludes MAP-Elites feature dimensions |
| 1106 | to prevent pollution of fitness comparisons. |
| 1107 | |
| 1108 | Args: |
| 1109 | program1: First program |
| 1110 | program2: Second program |
| 1111 | |
| 1112 | Returns: |
| 1113 | True if program1 is better than program2 |
| 1114 | """ |
| 1115 | # If no metrics, use newest |
| 1116 | if not program1.metrics and not program2.metrics: |
| 1117 | return program1.timestamp > program2.timestamp |
| 1118 | |
| 1119 | # If only one has metrics, it's better |
| 1120 | if program1.metrics and not program2.metrics: |
| 1121 | return True |
| 1122 | if not program1.metrics and program2.metrics: |
| 1123 | return False |
| 1124 | |
| 1125 | # Compare fitness (excluding feature dimensions) |
| 1126 | fitness1 = get_fitness_score(program1.metrics, self.config.feature_dimensions) |
| 1127 | fitness2 = get_fitness_score(program2.metrics, self.config.feature_dimensions) |
| 1128 | |
| 1129 | return fitness1 > fitness2 |
| 1130 | |
| 1131 | def _update_archive(self, program: Program) -> None: |
| 1132 | """ |
no test coverage detected