T - The candidate type.public final class EvaluatedCandidate<T> extends Object implements Comparable<EvaluatedCandidate<T>>
| Constructor and Description |
|---|
EvaluatedCandidate(T candidate,
double fitness) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(EvaluatedCandidate<T> evaluatedCandidate)
Compares this candidate's fitness score with that of the specified
candidate.
|
boolean |
equals(Object o)
Over-ridden to be consistent with
compareTo(EvaluatedCandidate). |
T |
getCandidate() |
double |
getFitness() |
int |
hashCode()
Over-ridden to be consistent with
equals(Object). |
public EvaluatedCandidate(T candidate, double fitness)
candidate - The evolved candidate.fitness - The candidates fitness score.public T getCandidate()
public double getFitness()
public int compareTo(EvaluatedCandidate<T> evaluatedCandidate)
compareTo in interface Comparable<EvaluatedCandidate<T>>evaluatedCandidate - The candidate to compare scores with.public boolean equals(Object o)
compareTo(EvaluatedCandidate).public int hashCode()
equals(Object).