Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.math.genetics
Class FixedGenerationCount

    java.lang.Object
      org.apache.commons.math.genetics.FixedGenerationCount

All Implemented Interfaces:
  StoppingCondition

    public class FixedGenerationCount

extends Object
implements StoppingCondition

Stops after a fixed number of generations. Each time `isSatisfied(Population)` is invoked, a generation counter is incremented. Once the counter reaches the configured `maxGenerations` value, `isSatisfied(Population)` returns true.

Since:
  2.0
Version:
  $Revision: 811685 $ $Date: 2009-09-05 19:36:48 +0200 (sam. 05 sept. 2009) $

Constructor Summary
`FixedGenerationCount(int maxGenerations)` Create a new FixedGenerationCount instance.

Method Summary
`int` | `getNumGenerations()`
`boolean` | `isSatisfied(Population population)` Determine whether or not the given number of generations have passed.

Methods inherited from class java.lang.Object
`clone, equals, finalize, 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2011 The Apache Software Foundation. All Rights Reserved.