Class EvaluatedCandidate<T>

    • Constructor Detail

      • EvaluatedCandidate

        public EvaluatedCandidate​(T candidate,
                                  double fitness)
        Parameters:
        candidate - The evolved candidate.
        fitness - The candidates fitness score.
    • Method Detail

      • getCandidate

        public T getCandidate()
        Returns:
        The evolved candidate solution.
      • getFitness

        public double getFitness()
        Returns:
        The fitness score for the associated candidate.
      • compareTo

        public int compareTo​(EvaluatedCandidate<T> evaluatedCandidate)
        Compares this candidate's fitness score with that of the specified candidate.
        Specified by:
        compareTo in interface Comparable<T>
        Parameters:
        evaluatedCandidate - The candidate to compare scores with.
        Returns:
        -1, 0 or 1 if this candidate's score is less than, equal to, or greater than that of the specified candidate. The comparison applies to the raw numerical score and does not consider whether that score is a natural fitness score or not.
      • equals

        public boolean equals​(Object o)
        Over-ridden to be consistent with compareTo(EvaluatedCandidate).
        Overrides:
        equals in class Object
        Parameters:
        o - The object to check for equality.
        Returns:
        true If this object is logically equivalent to {code o}.
      • hashCode

        public int hashCode()
        Over-ridden to be consistent with equals(Object).
        Overrides:
        hashCode in class Object
        Returns:
        This object's hash code.