C# Class AForge.Genetic.ChromosomeBase

Chromosomes' base class.

The base class provides implementation of some IChromosome methods and properties, which are identical to all types of chromosomes.

Inheritance: IChromosome
ファイルを表示 Open project: holisticware-admin/MonoVersal.AForgeNET

Protected Properties

Property Type Description
fitness double

Public Methods

Method Description
Clone ( ) : IChromosome

Clone the chromosome.

The method clones the chromosome returning the exact copy of it.

CompareTo ( object o ) : int

Compare two chromosomes.

CreateNew ( ) : IChromosome

Create new random chromosome with same parameters (factory method).

The method creates new chromosome of the same type, but randomly initialized. The method is useful as factory method for those classes, which work with chromosome's interface, but not with particular chromosome class.

Crossover ( IChromosome pair ) : void

Crossover operator.

The method performs crossover between two chromosomes – interchanging some parts of chromosomes.

Evaluate ( IFitnessFunction function ) : void

Evaluate chromosome with specified fitness function.

Calculates chromosome's fitness using the specifed fitness function.

Generate ( ) : void

Generate random chromosome value.

Regenerates chromosome's value using random number generator.

Mutate ( ) : void

Mutation operator.

The method performs chromosome's mutation, changing its part randomly.

Method Details

Clone() public abstract method

Clone the chromosome.

The method clones the chromosome returning the exact copy of it.

public abstract Clone ( ) : IChromosome
return IChromosome

CompareTo() public method

Compare two chromosomes.
public CompareTo ( object o ) : int
o object Binary chromosome to compare to.
return int

CreateNew() public abstract method

Create new random chromosome with same parameters (factory method).

The method creates new chromosome of the same type, but randomly initialized. The method is useful as factory method for those classes, which work with chromosome's interface, but not with particular chromosome class.

public abstract CreateNew ( ) : IChromosome
return IChromosome

Crossover() public abstract method

Crossover operator.

The method performs crossover between two chromosomes – interchanging some parts of chromosomes.

public abstract Crossover ( IChromosome pair ) : void
pair IChromosome Pair chromosome to crossover with.
return void

Evaluate() public method

Evaluate chromosome with specified fitness function.

Calculates chromosome's fitness using the specifed fitness function.

public Evaluate ( IFitnessFunction function ) : void
function IFitnessFunction Fitness function to use for evaluation of the chromosome.
return void

Generate() public abstract method

Generate random chromosome value.

Regenerates chromosome's value using random number generator.

public abstract Generate ( ) : void
return void

Mutate() public abstract method

Mutation operator.

The method performs chromosome's mutation, changing its part randomly.

public abstract Mutate ( ) : void
return void

Property Details

fitness protected_oe property

Chromosome's fintess value.
protected double fitness
return double