C# 클래스 AForge.Genetic.ExtendedGeneFunction

Genetic programming gene, which represents arithmetic functions, common mathematical functions and arguments.

Extended gene function may represent arithmetic functions (+, -, *, /), some common mathematical functions (sin, cos, ln, exp, sqrt) or an argument to functions. This class is used by Genetic Programming (or Gene Expression Programming) chromosomes to build arbitrary expressions with help of genetic operators.

상속: IGPGene
파일 보기 프로젝트 열기: holisticware-admin/MonoVersal.AForgeNET 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
rand ThreadSafeRandom

공개 메소드들

메소드 설명
Clone ( ) : IGPGene

Clone the gene.

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

CreateNew ( ) : IGPGene

Creates new gene with random type and value.

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

CreateNew ( GPGeneType type ) : IGPGene

Creates new gene with certain type and random value.

The method creates new gene with specified type, but random value. The method is useful as factory method for those classes, which work with gene's interface, but not with particular gene class.

ExtendedGeneFunction ( int variablesCount ) : System

Initializes a new instance of the ExtendedGeneFunction class.

The constructor creates randomly initialized gene with random type and value by calling Generate( ) method.

ExtendedGeneFunction ( int variablesCount, GPGeneType type ) : System

Initializes a new instance of the ExtendedGeneFunction class.

The constructor creates randomly initialized gene with random value and preset gene type.

Generate ( ) : void

Randomize gene with random type and value.

The method randomizes the gene, setting its type and value randomly.

Generate ( GPGeneType type ) : void

Randomize gene with random value.

The method randomizes a gene, setting its value randomly, but type is set to the specified one.

ToString ( ) : string

Get string representation of the gene.

비공개 메소드들

메소드 설명
ExtendedGeneFunction ( int variablesCount, bool random ) : System

메소드 상세

Clone() 공개 메소드

Clone the gene.

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

public Clone ( ) : IGPGene
리턴 IGPGene

CreateNew() 공개 메소드

Creates new gene with random type and value.

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

public CreateNew ( ) : IGPGene
리턴 IGPGene

CreateNew() 공개 메소드

Creates new gene with certain type and random value.

The method creates new gene with specified type, but random value. The method is useful as factory method for those classes, which work with gene's interface, but not with particular gene class.

public CreateNew ( GPGeneType type ) : IGPGene
type GPGeneType Gene type to create.
리턴 IGPGene

ExtendedGeneFunction() 공개 메소드

Initializes a new instance of the ExtendedGeneFunction class.

The constructor creates randomly initialized gene with random type and value by calling Generate( ) method.

public ExtendedGeneFunction ( int variablesCount ) : System
variablesCount int Total amount of variables in the task which is supposed /// to be solved.
리턴 System

ExtendedGeneFunction() 공개 메소드

Initializes a new instance of the ExtendedGeneFunction class.

The constructor creates randomly initialized gene with random value and preset gene type.

public ExtendedGeneFunction ( int variablesCount, GPGeneType type ) : System
variablesCount int Total amount of variables in the task which is supposed /// to be solved.
type GPGeneType Gene type to set.
리턴 System

Generate() 공개 메소드

Randomize gene with random type and value.

The method randomizes the gene, setting its type and value randomly.

public Generate ( ) : void
리턴 void

Generate() 공개 메소드

Randomize gene with random value.

The method randomizes a gene, setting its value randomly, but type is set to the specified one.

public Generate ( GPGeneType type ) : void
type GPGeneType Gene type to set.
리턴 void

ToString() 공개 메소드

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

프로퍼티 상세

rand 보호되어 있는 정적으로 프로퍼티

Random number generator for chromosoms generation.
protected static ThreadSafeRandom rand
리턴 ThreadSafeRandom