Class FixedGenerationCount

    • Constructor Summary

      Constructors 
      Constructor Description
      FixedGenerationCount​(int maxGenerations)
      Create a new FixedGenerationCount instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getNumGenerations()  
      boolean isSatisfied​(Population population)
      Determine whether or not the given number of generations have passed.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • FixedGenerationCount

        public FixedGenerationCount​(int maxGenerations)
        Create a new FixedGenerationCount instance.
        Parameters:
        maxGenerations - number of generations to evolve
    • Method Detail

      • isSatisfied

        public boolean isSatisfied​(Population population)
        Determine whether or not the given number of generations have passed. Increments the number of generations counter if the maximum has not been reached.
        Specified by:
        isSatisfied in interface StoppingCondition
        Parameters:
        population - ignored (no impact on result)
        Returns:
        true IFF the maximum number of generations has been exceeded
      • getNumGenerations

        public int getNumGenerations()
        Returns:
        the number of generations that have passed