C# 클래스 Accord.Genetic.ShortArrayChromosome

Short array chromosome.

Short array chromosome represents array of unsigned short values. Array length is in the range of [2, 65536].

상속: ChromosomeBase
파일 보기 프로젝트 열기: accord-net/framework 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
length int
maxValue int
val ushort[]

공개 메소드들

메소드 설명
Clone ( ) : IChromosome

Clone the chromosome.

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

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 type.

Crossover ( IChromosome pair ) : void

Crossover operator.

The method performs crossover between two chromosomes – interchanging range of genes (array elements) between these chromosomes.

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 randomly one of its genes (array elements).

ShortArrayChromosome ( int length ) : System

Initializes a new instance of the ShortArrayChromosome class.

This constructor initializes chromosome setting genes' maximum value to maximum posible value of type.

ShortArrayChromosome ( int length, int maxValue ) : System

Initializes a new instance of the ShortArrayChromosome class.

ToString ( ) : string

Get string representation of the chromosome.

보호된 메소드들

메소드 설명
ShortArrayChromosome ( ShortArrayChromosome source ) : System

Initializes a new instance of the ShortArrayChromosome class.

This is a copy constructor, which creates the exact copy of specified chromosome.

메소드 상세

Clone() 공개 메소드

Clone the chromosome.

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

public Clone ( ) : IChromosome
리턴 IChromosome

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 type.

public CreateNew ( ) : IChromosome
리턴 IChromosome

Crossover() 공개 메소드

Crossover operator.

The method performs crossover between two chromosomes – interchanging range of genes (array elements) between these chromosomes.

public Crossover ( IChromosome pair ) : void
pair IChromosome Pair chromosome to crossover with.
리턴 void

Generate() 공개 메소드

Generate random chromosome value.

Regenerates chromosome's value using random number generator.

public Generate ( ) : void
리턴 void

Mutate() 공개 메소드

Mutation operator.

The method performs chromosome's mutation, changing randomly one of its genes (array elements).

public Mutate ( ) : void
리턴 void

ShortArrayChromosome() 보호된 메소드

Initializes a new instance of the ShortArrayChromosome class.

This is a copy constructor, which creates the exact copy of specified chromosome.

protected ShortArrayChromosome ( ShortArrayChromosome source ) : System
source ShortArrayChromosome Source chromosome to copy.
리턴 System

ShortArrayChromosome() 공개 메소드

Initializes a new instance of the ShortArrayChromosome class.
This constructor initializes chromosome setting genes' maximum value to maximum posible value of type.
public ShortArrayChromosome ( int length ) : System
length int Chromosome's length in array elements, [2, ].
리턴 System

ShortArrayChromosome() 공개 메소드

Initializes a new instance of the ShortArrayChromosome class.
public ShortArrayChromosome ( int length, int maxValue ) : System
length int Chromosome's length in array elements, [2, ].
maxValue int Maximum value of chromosome's gene (array element).
리턴 System

ToString() 공개 메소드

Get string representation of the chromosome.
public ToString ( ) : string
리턴 string

프로퍼티 상세

length 보호되어 있는 프로퍼티

Chromosome's length in number of elements.
protected int length
리턴 int

maxValue 보호되어 있는 프로퍼티

Maximum value of chromosome's gene (element).
protected int maxValue
리턴 int

val 보호되어 있는 프로퍼티

Chromosome's value.
protected ushort[] val
리턴 ushort[]