org.vizzini.ai.geneticalgorithm
Interface IChromosome

All Superinterfaces:
Cloneable, Comparable
All Known Subinterfaces:
IChromosomeGP
All Known Implementing Classes:
AbstractChromosome, AbstractChromosomeGP, ChromosomeBoolean, ChromosomeDouble, ChromosomeInt, ChromosomeNeuralNetwork, DefaultChromosomeGP

public interface IChromosome
extends Cloneable, Comparable

Defines methods required by chromosomes for a genetic algorithm.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson

Field Summary
static int UNKNOWN_FITNESS
          Constant which indicates that the fitness is unknown.
 
Method Summary
 void addFitness(int value)
          Add to the fitness.
 Object clone()
          Return a clone of this instance.
 void copy(IChromosome another)
          Copy the given chromosome into this.
 boolean equals(Object another)
          Return true if this equals the given object.
 String getDescription()
          Return the description.
 int getFitness()
          Return the fitness.
 boolean isFitnessUnknown()
          Return true if the fitness is unknown.
 void mix(IChromosome c1, IChromosome c2, boolean[] mask)
          Mix the genes of the given chromosomes into this using the given mask.
 void mix(IChromosome c1, IChromosome c2, double fraction)
          Mix the genes of the given chromosomes into this using the given fraction.
 void mutate(double mutationRate, double mutationMagnitude)
          Mutate this chromosome's genes using the given parameters.
 void randomlyInitialize()
          Initialize the genes with random values.
 void setDescription(String description)
          Set the description.
 void setFitness(int fitness)
          Set the fitness.
 void setFitnessUnknown()
          Set the fitness to unknown.
 int size()
          Return the number of genes.
 void splice(IChromosome c1, IChromosome c2, int cut)
          Splice the given chromosomes into this using the given cut index.
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

UNKNOWN_FITNESS

static final int UNKNOWN_FITNESS
Constant which indicates that the fitness is unknown.

See Also:
Constant Field Values
Method Detail

addFitness

void addFitness(int value)
Add to the fitness.

Since:
v0.1

clone

Object clone()
Return a clone of this instance.

Since:
v0.2

copy

void copy(IChromosome another)
Copy the given chromosome into this.

Since:
v0.1

equals

boolean equals(Object another)
Return true if this equals the given object.

Overrides:
equals in class Object
Since:
v0.1

getDescription

String getDescription()
Return the description.

Since:
v0.1

getFitness

int getFitness()
Return the fitness.

Since:
v0.1

isFitnessUnknown

boolean isFitnessUnknown()
Return true if the fitness is unknown.

Since:
v0.1

mix

void mix(IChromosome c1,
         IChromosome c2,
         boolean[] mask)
Mix the genes of the given chromosomes into this using the given mask.

Since:
v0.1

mix

void mix(IChromosome c1,
         IChromosome c2,
         double fraction)
Mix the genes of the given chromosomes into this using the given fraction.

Since:
v0.3

mutate

void mutate(double mutationRate,
            double mutationMagnitude)
Mutate this chromosome's genes using the given parameters.

Parameters:
mutationRate - Probability of a gene being mutated.
mutationMagnitude - The maximum allowed magnitude of the mutation.
Since:
v0.1

randomlyInitialize

void randomlyInitialize()
Initialize the genes with random values.

Since:
v0.1

setDescription

void setDescription(String description)
Set the description.

Since:
v0.1

setFitness

void setFitness(int fitness)
Set the fitness.

Since:
v0.1

setFitnessUnknown

void setFitnessUnknown()
Set the fitness to unknown.

Since:
v0.1

size

int size()
Return the number of genes.

Since:
v0.1

splice

void splice(IChromosome c1,
            IChromosome c2,
            int cut)
Splice the given chromosomes into this using the given cut index.

Since:
v0.1


Copyright © 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02