Class StringOrganism


  • public class StringOrganism
    extends Organism<java.lang.String>
    An organism based off of a string The string organism is implemented to show how words can evolve based on a certain target word. A strings fitness is increased for every character that it has in common with the target string.
    • Constructor Detail

      • StringOrganism

        public StringOrganism​(java.lang.String d)
      • StringOrganism

        public StringOrganism​(Generator<java.lang.String> g)
      • StringOrganism

        public StringOrganism​(Organism<java.lang.String> a,
                              Organism<java.lang.String> b)
    • Method Detail

      • calculateFitness

        public <T> double calculateFitness​(T target)
        Description copied from class: Organism
        Calculate how fit (how likely it is for this organism to reproduce) based on a target. organisms closer to a target should have higher fitness values
        Specified by:
        calculateFitness in class Organism<java.lang.String>