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

## Individuals.FitnessPackage
Class BasicFitness

    java.lang.Object
      Individuals.FitnessPackage.BasicFitness

All Implemented Interfaces:
  Fitness, java.lang.Comparable<Fitness>

    public class BasicFitness

extends java.lang.Object
implements Fitness

BasicFitness. Class holding a basic fitness measurement. Has a fitness value as well as a reference to the individual the fitness refers to.

Author:
  Conor

Field Summary
`static double` | `DEFAULT_FITNESS`

Constructor Summary
`BasicFitness()` Creates a new instance of BasicFitness
`BasicFitness(double f, Individual i)` Creates new instance of BasicFitness
`BasicFitness(Individual i)` Creates new instance of BasicFitness

Method Summary
`int` | `compareTo(Fitness o)` Compare the Fitness ascending
`double` | `getDefaultFitness()`
`double` | `getDistance(DoubleFitness f)`
`double` | `getDouble()`
`Individual` | `getIndividual()` Get the individual that is refered to by the fitness
`int` | `getInt()`
`double` | `getMaxDoubleFitness()`
`int` | `getMaxIntFitness()`
`double` | `getMinDoubleFitness()`
`int` | `getMinIntFitness()`
`void` | `setDefault()` Set the default value of fitness.
`void` | `setDouble(double f)`
`void` | `setIndividual(Individual i)` Set individual to which the fitness belongs
`void` | `setInt(int f)`

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

Field Detail

### DEFAULT_FITNESS

    public static final double DEFAULT_FITNESS

See Also:
  Constant Field Values

Constructor Detail

### BasicFitness

    public BasicFitness()

  Creates a new instance of BasicFitness

### BasicFitness

    public BasicFitness(double f,
                        Individual i)

  Creates new instance of BasicFitness

  Parameters:
    `f` - fitness value
    `i` - reference to an individual

### BasicFitness

    public BasicFitness(Individual i)

  Creates new instance of BasicFitness

  Parameters:
    `i` - reference to an individual

Method Detail

### compareTo

    public int compareTo(Fitness o)

  Compare the Fitness ascending

  Specified by:
    `compareTo` in interface `java.lang.Comparable<Fitness>`
  Parameters:
    `o` - fitness to compare to
  Returns:
    value (-1,0,1) of comparison

### getMaxDoubleFitness

    public double getMaxDoubleFitness()

  Specified by:
    `getMaxDoubleFitness` in interface `Fitness`

### getMinDoubleFitness

    public double getMinDoubleFitness()

  Specified by:
    `getMinDoubleFitness` in interface `Fitness`

### getMaxIntFitness

    public int getMaxIntFitness()

  Specified by:
    `getMaxIntFitness` in interface `Fitness`

### getMinIntFitness

    public int getMinIntFitness()

  Specified by:
    `getMinIntFitness` in interface `Fitness`

### setDefault

    public void setDefault()

  Description copied from interface: `Fitness`
  Set the default value of fitness. This can be given to unevaluated individuals, such as newly created or invalids

  Specified by:
    `setDefault` in interface `Fitness`

### getDefaultFitness

    public double getDefaultFitness()

### getDouble

    public double getDouble()

  Specified by:
    `getDouble` in interface `Fitness`

### getDistance

    public double getDistance(DoubleFitness f)

### getIndividual

    public Individual getIndividual()

  Description copied from interface: `Fitness`
  Get the individual that is refered to by the fitness

  Specified by:
    `getIndividual` in interface `Fitness`
  Returns:
    individual to which the fitness belongs

### setIndividual

    public void setIndividual(Individual i)

  Description copied from interface: `Fitness`
  Set individual to which the fitness belongs

  Specified by:
    `setIndividual` in interface `Fitness`
  Parameters:
    `i` - individual to which the fitness belongs

### setDouble

    public void setDouble(double f)

  Specified by:
    `setDouble` in interface `Fitness`

### getInt

    public int getInt()

  Specified by:
    `getInt` in interface `Fitness`

### setInt

    public void setInt(int f)

  Specified by:
    `setInt` in interface `Fitness`

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