org.omegahat.Numerics.GeneticAlgorithms
Interface Trait

All Superinterfaces:
Copyable
All Known Implementing Classes:
TraitLevels, TraitNumeric

public interface Trait
extends Copyable

An interface to represent the characteristics of individuals that can vary in the population, and whose values potentially affect the ``fitness'' of the individuals, and therefore their chances to breed and survive.

Traits are analagous to what are called ``chromosomes'' in some treatments of genetic algorithms, and the breed method then is often called ``crossover''. The use of ``trait'' instead is intended to suggest the flexibility and variety of possible characteristics, whereas there is a temptation to see chromosomes as being too closely tied to an array of genes. Plus, which word would you rather have to remember to spell correctly?

In terms of optimization, traits are the parameters or arguments to the objective function to be optimized. Unlike numeric optimization, however, genetic algorithms put essentially no restrictions' on what datatypes can be involved in the traits. At one extreme, there can be one trait containing an array of numeric parameters. At the other, any number of traits can be included, with arbitrary structure and content, according to whatever is natural and, presumably, can be related easily to the fitness that in turn affects breeding and survival of individuals.


Method Summary
 Trait breed(Trait partner)
          Return a new trait corresponding to breeding this trait with the argument.
 java.lang.String getName()
          The name of this trait.
 Trait mutate()
          Return a new trait reflecting a mutation of this object.
 
Methods inherited from interface org.omegahat.Environment.DataStructures.Copyable
copy, copy
 

Method Detail

breed

public Trait breed(Trait partner)
Return a new trait corresponding to breeding this trait with the argument.

mutate

public Trait mutate()
Return a new trait reflecting a mutation of this object.

getName

public java.lang.String getName()
The name of this trait. Normally, the names of the traits are defined by the population and are the same for all individuals (for this reason, the name is typically a read-only property for individual trait objects).