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