Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cz.pcland.ga.fitness
Class PenalizationFitness

    java.lang.Object
      cz.pcland.ga.fitness.PenalizationFitness

All Implemented Interfaces:
  Evaluator

    public class PenalizationFitness

extends java.lang.Object
implements Evaluator

Field Summary
`protected KnapSack` | `ks`

Constructor Summary
`PenalizationFitness()` Creates a new instance of PenalizationFitness

Method Summary
`double` | `getEvaluation(BaseIndividual str)` gets evalutaion.
`void` | `init(BaseIndividual[] population)` Called before every evalutaion
`boolean` | `isEnd(BaseIndividual bi)` returns true if end value has been reached.
`void` | `onStart(BaseIndividual[] population)` Called at the begining of run before first evaluation and after population is fully created
`void` | `postEvaluate(BaseIndividual[] population, double min, double max)` For final fitness correction, eg: To set fitness to value greater than zero
`void` | `setDataObject(java.lang.Object instance)` Called before GA starts to set data for evalutaion
`java.lang.String` | `toString()` Returns public name of fitness object

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### ks

    protected KnapSack ks

Constructor Detail

### PenalizationFitness

    public PenalizationFitness()

  Creates a new instance of PenalizationFitness

Method Detail

### setDataObject

    public void setDataObject(java.lang.Object instance)

  Description copied from interface: `Evaluator`
  Called before GA starts to set data for evalutaion

  Specified by:
    `setDataObject` in interface `Evaluator`

### init

    public void init(BaseIndividual[] population)

  Description copied from interface: `Evaluator`
  Called before every evalutaion

  Specified by:
    `init` in interface `Evaluator`

### onStart

    public void onStart(BaseIndividual[] population)

  Description copied from interface: `Evaluator`
  Called at the begining of run before first evaluation and after population is fully created

  Specified by:
    `onStart` in interface `Evaluator`

### postEvaluate

    public void postEvaluate(BaseIndividual[] population,
                             double min,
                             double max)

  Description copied from interface: `Evaluator`
  For final fitness correction, eg: To set fitness to value greater than zero

  Specified by:
    `postEvaluate` in interface `Evaluator`

### isEnd

    public boolean isEnd(BaseIndividual bi)

  Description copied from interface: `Evaluator`
  returns true if end value has been reached. Algorithm does not react, only checks.

  Specified by:
    `isEnd` in interface `Evaluator`

### toString

    public java.lang.String toString()

  Description copied from interface: `Evaluator`
  Returns public name of fitness object

  Specified by:
    `toString` in interface `Evaluator`
  Overrides:
    `toString` in class `java.lang.Object`

### getEvaluation

    public double getEvaluation(BaseIndividual str)

  Description copied from interface: `Evaluator`
  gets evalutaion.

  Specified by:
    `getEvaluation` in interface `Evaluator`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD