Skip to content

Commit

Permalink
Merge pull request #401 from fc51111/AttemptToOptimizeIsBetterThanCur…
Browse files Browse the repository at this point in the history
…rentMethod

Avoid comparing equal chromosomes
  • Loading branch information
jose authored May 9, 2023
2 parents 1fac6db + 6ceded5 commit f79820d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions client/src/main/java/org/evosuite/ga/archive/Archive.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ public void updateArchive(TestFitnessFunction target,
*/
public boolean isBetterThanCurrent(TestChromosome currentSolution, TestChromosome candidateSolution) {

if (currentSolution.equals(candidateSolution)) {
return false;
}

ExecutionResult currentSolutionExecution = currentSolution.getLastExecutionResult();
ExecutionResult candidateSolutionExecution = candidateSolution.getLastExecutionResult();
if (currentSolutionExecution != null
Expand Down

0 comments on commit f79820d

Please sign in to comment.