C# Класс 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.

Наследование: IChromosome
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
fitness double

Открытые методы

Метод Описание
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.

Описание методов

Clone() публичный абстрактный метод

Clone the chromosome.

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

public abstract Clone ( ) : IChromosome
Результат IChromosome

CompareTo() публичный метод

Compare two chromosomes.
public CompareTo ( object o ) : int
o object Binary chromosome to compare to.
Результат int

CreateNew() публичный абстрактный метод

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
Результат IChromosome

Crossover() публичный абстрактный метод

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.
Результат void

Evaluate() публичный метод

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.
Результат void

Generate() публичный абстрактный метод

Generate random chromosome value.

Regenerates chromosome's value using random number generator.

public abstract Generate ( ) : void
Результат void

Mutate() публичный абстрактный метод

Mutation operator.

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

public abstract Mutate ( ) : void
Результат void

Описание свойств

fitness защищенное свойство

Chromosome's fintess value.
protected double fitness
Результат double