Make your own free website on Tripod.com

G+ Program Interface

This document describes the program interface for G+ control. Generally, G+ contains five basic objects of  a typical genetic algorithm: AlleleSet, AlleleSetArray, Genome, Population, and Algorithm. Below is a detailed description of each objects. This document also contains all constants defined in the control.


  1. AlleleSet    (Properties,   Methods)

 An AlleleSet object is a container for all possible values that a certain gene may assume. G+ currently supports 4 types of AlleleSet: enumerated, bounded, bounded with discretization, and binary.

Properties:

  1. Evaluate (Default)

Methods

  1. add 
  2. deleteAlleleSet
  3. find
  4. inc
  5. link
  6. lower
  7. lowerBoundType
  8. newBinary
  9. newBound
  10. newDiscrete
  11. newEnumerator
  12. remove
  13. size
  14. type
  15. unlink
  16. upper
  17. upperBoundType

Back 

 

Evaluate Property

Sets or gets certain allele from the allele set. 

Syntax:

object.Evaluate (i) [ = value ]

object(i) [ = value ]

The Evaluate property has these parts:

Part Description
object An AlleleSet Object
i An integer that specifies the zero based index of the allele to be set or got
value A variant that specifies the value of the allele 

Remarks

This property can only be used with enumerated allele set. You must call  newEnumerator before use this property.

Data Type

Variant

 

newEnumerator Method

Create a new enumerated AlleleSet.

Syntax:

object.newEnumerator 

bret = object.newEnumerator (n) 

The newEnumerator method has these parts:

Part Description
object An AlleleSet Object
n Size of the allele set

Remarks

Call this method to create a new enumerated allele set. If you have already called newEnumerator, newBound, newDiscrete, or newBinary before calling this method, you must call deleteAlleleSet first.

Return Value

True if successful; otherwise false.

 

newBound Method

Create a new bounded AlleleSet.

Syntax:

object.newBound lower, upper, lowerboundtype, upperboundtype

bret = object.newBound(lower, upper, lowerboundtype, upperboundtype)

The newBound method has these parts:

Part Description
object An AlleleSet Object
lower A real or integer value defining lower bound of the allele set. 
upper A real or integer value defining upper bound of the allele set. 
lowerboundtype A long value that can be set to one of the GABoundType values specifying the lower bound type of the allele set
upperboundtype A long value that can be set to one of the GABoundType values specifying the upper bound type of the allele set

Remarks

The allele set will be an integer allele set if both lower and upper are integers; otherwise it will be a real allele set.

Call this method to create a new bounded allele set. If you have already called newEnumerator, newBound, newDiscrete, or newBinary  before calling this method, you must call deleteAlleleSet first.

Return Value

True if successful; otherwise false.

 

newDiscrete Method

Create a new bounded AlleleSet with discretization.

Syntax:

object.newDiscrete lower, upper, increment, lowerboundtype, upperboundtype

bret = object.newDiscrete(lower, upper, increment,  lowerboundtype, upperboundtype)

The newDiscrete method has these parts:

Part Description
object An AlleleSet Object
lower A real or integer value defining lower bound of the allele set. 
upper A real or integer value defining upper bound of the allele set. 
increment A real or integer value defining the minimum increment of the allele set. 
lowerboundtype A long value that can be set to one of the GABoundType values specifying the lower bound type of the allele set
upperboundtype A long value that can be set to one of the GABoundType values specifying the upper bound type of the allele set

Remarks

The allele set will be an integer allele set if lower, upper and increment are all integers; otherwise it will be a real allele set.

Call this method to create a new bounded  allele set with discretization. If you have already called newEnumerator, newBound, newDiscrete, or newBinary  before calling this method, you must call deleteAlleleSet  first.

Return Value

True if successful; otherwise false.

 

newBinary Method

Create a new binary AlleleSet

Syntax:

object.newBinary size

bret = object.newBinary (size)

The newBinary method has these parts:

Part Description
object An AlleleSet Object
size Size of the allele set

Remarks

The size parameter also defines the length of a binary genome that is associated with this allele set.

Call this method to create a new binary allele set. If you have already called newEnumerator, newBound, newDiscrete, or newBinary before calling this method, you must call deleteAlleleSet first.

Return Value

True if successful; otherwise false.

 

deleteAlleleSet Method

Delete current contents of an AlleleSet object.

Syntax:

object.deleteAlleleSet

The deleteAlleleSet method has these parts:

Part Description
object An AlleleSet Object

Remarks

This method is used to 'clear' an existing AlleleSet object. Call this method before create a new allele set.

 

add Method

Add the indicated allele to the allele set.

Syntax:

object.add var

bret = object.add (var)

The add  method has these parts:

Part Description
object An AlleleSet Object
var A variant specifying the allele to be added

Remarks

This method works only for enumerated allele sets.

Return Value

True if successful; otherwise false.

 

remove Method

Remove the indicated allele from the allele set.

Syntax:

object.remove var

bret = object.remove (var)

The remove method has these parts:

Part Description
object An AlleleSet Object
var A variant specifying the allele to be removed

Remarks

This method works only for enumerated allele sets.

Return Value

True if successful; otherwise false.

 

link Method

Make an AlleleSet object refer to the data in another.

Syntax:

object.link newVal

bret = object.link (newVal)

The link method has these parts:

Part Description
object An AlleleSet Object
newVal An AlleleSet Object that is to be linked

Remarks

Generally, each allele set has its own data sets which means it has its own memory. Two  identical large enumerated allele sets will thus occupy two large memory area with two identical data sets. The link  method can make two or more identical allele sets share one data sets, reducing the total memory area that is required to store the data sets.

Return Value

True if successful; otherwise false.

 

unlink Method

Remove the connection.

Syntax:

object.unlink 

bret = object.unlink

The unlink method has these parts:

Part Description
object An AlleleSet Object

Remarks

When you unlink, the allele set makes its own copy of the data sets.

Return Value

True if successful; otherwise false.

 

type Method

Returns the type of the allele set.

Syntax:

t = object.type

The type method has these parts:

Part Description
object An AlleleSet Object

Return Value

The return value can be one of the numbers that is defined in GAAlleleType.

 

size Method

Returns the size of the allele set.

Syntax:

s = object.size

The size method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for enumerated and binary allele set.

Return Value

An integer indicate the size of the allele set.

 

inc Method

Returns the increment of an allele set.

Syntax:

i = object.inc

The inc method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for bounded allele set with discretization..

Return Value

A variant indicating the minimal increment of the allele set.

 

lower Method

Returns the lower bound of an allele set.

Syntax:

low = object.lower

The lower method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for bounded allele set or bounded allele set with discretization..

Return Value

A variant indicating the lower bound of the allele set.

 

upper Method

Returns the upper bound of an allele set.

Syntax:

up = object.upper

The upper method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for bounded allele set or bounded allele set with discretization..

Return Value

A variant indicating the upper bound of the allele set.

 

lowerBoundType Method

Returns the lower bound type of an allele set.

Syntax:

ltype = object.lowerBoundType 

The lowerBoundType method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for bounded allele set or bounded allele set with discretization..

Return Value

The return value can be one of the numbers that is defined in GABoundType.

 

upperBoundType Method

Returns the upper bound type of an allele set.

Syntax:

utype = object.upperBoundType 

The upperBoundType method has these parts:

Part Description
object An AlleleSet Object

Remarks

The method is only meaningful for bounded allele set or bounded allele set with discretization.

Return Value

The return value can be one of the numbers that is defined in GABoundType.

 

find Method

Check if an allele exists in an allele set.

Syntax:

bfound = object.find (var)

The find  method has these parts:

Part Description
object An AlleleSet Object
var A variant that specifies the allele to be found

Remarks

The method is only meaningful for enumerated allele set.

Return Value

True if the allele exists; otherwise False.


  1. AlleleSetArray  ( Methods)

The AlleleSetArray is a container object with an array of allele sets.

Methods:

  1. deleteArray
  2. Evaluate (Default)
  3. init
  4. link
  5. newArray
  6. size
  7. unlink

Back

 

Evaluate Method

Returns the specified AlleleSet within the AlleleSetArray Object.

Syntax:

object.Evaluate index

object (index)

Set aset = object.Evaluate (index)

Set aset = object (index)

The Evaluate method has these parts:

Part Description
object An AlleleSetArray Object
index The zero based index of the AlleleSet to be retrieved.

 

newArray Method

Create a new AlleleSetArray.

Syntax:

object.newArray ( n )

bret = object.newArray ( n )

The newArray method has these parts:

Part Description
object An AlleleSetArray Object
n An integer specifies the size of the AlleleSetArray

Return Value

True if successful; otherwise False.

 

deleteArray Method

Delete the AlleleSetArray.

Syntax:

object.deleteArray 

The deleteArray method has these parts:

Part Description
object An AlleleSetArray Object

Remarks

This method does not delete the object itself. What it actually does is to delete all allele sets within the object.

 

link Method

Link one allele set with another.

Syntax:

object.link index1, index2

bret = object.link (index1, index2)

The link method has these parts:

Part Description
object An AlleleSetArray Object
index1 The zero based index of the allele set within the AlleleSetArray to link
index2 The zero based index of the allele set within the AlleleSetArray to be linked

Remarks

Call this method to link index1 to index2. 

Return Value

True if successful; otherwise False.

 

unlink Method

Unlink the specified allele set within the AlleleSetArray.

Syntax:

object.unlink index

bret = object.unlink (index)

The unlink method has these parts:

Part Description
object An AlleleSetArray Object
index The zero based index of the allele set within the AlleleSetArray to unlink

Return Value

True if successful; otherwise False.

 

size  Method

Returns the size of the AlleleSetArray.

Syntax:

object.size

s=object.size

The size method has these parts:

Part Description
object An AlleleSetArray Object

Return Value

A long value indicating the size of the AlleleSetArray.

 

init  Method

Initialize all allele sets within the AlleleSetArray

Syntax:

object.init  

The init  method has these parts:

Part Description
object An AlleleSetArray Object

Remarks

Call this method after you have defined all allele sets within an AlleleSetArray. What init  does is to do a type check for the parameters within the object. All integers are converted to long values (VT_I4) and all real numbers are converted to double values (VT_R8). Those parameters of enumerated and binary allele sets will be unchanged. For example, if an AlleleSetArray has two allele sets A1 and A2. Let A1 to be an enumerated allele set with 5 elements: {'a', '1', '5', 'c', 'x'}  and A2 to be a bounded allele set which is defined as [10, 12.5]. Then after calling init, the elements within A1 will be the same type as before and the lowerbound and upperbound of A2 will be changed to double values (VT_R8).

 


  1. Genome  (Properties,   Methods)

A genome object contains a set of genes which the genetic algorithm attempts to optimize as a whole. G+ currently supports two different types of genomes: real genome and binary genome. Real genome is an array of mixed real and integer numbers and binary genome is an array of '0's and '1's.

Properties:

  1. AlleleSetArray
  2. gene (Default)
  3. initializer
  4. max
  5. min
  6. mutator
  7. type

 

Methods:

  1. Compare
  2. copy
  3. Crossover
  4. Evaluate
  5. getbitsbyte
  6. getbitslong
  7. Initialize
  8. IsGeneExists
  9. Mutate
  10. newGenome
  11. setbitsbyte
  12. setbitslong
  13. size
  14. ToString

Back

 

gene Property

Sets and gets a specific gene within the genome

Syntax:

object.gene (index) = [var]

object (index) = [var]

The gene property has these parts:

Part Description
object A Genome Object
index The zero based index of the gene within the genome to be set or got
var A variant specifying the value of that gene

 

Remarks

For binary genome the return value will be either 0 or 1. The data type of the return value will be Byte (VT_U1). For real genome the data type of the return value will be either long (VT_I4) or double (VT_R8) depending on the definition of that gene. If you assign a value to a certain gene of a binary genome, the value of that gene will be 0 if the value is zero and 1 for all other nonzero values assigned to it. 

Data Type

Variant

 

max Property

Sets or gets the maximum length of a genome.

Syntax:

object.max = [len]

The max property has these parts:

Part Description
object A Genome Object
len A long value specifies the maximum length of the genome

Remarks

Since current version of G+ only supports fixed length genome, this value should be equal to the length and minimum length of the genome.

Data Type

long

 

min Property

Sets or gets the minimum length of a genome.

Syntax:

object.min = [len]

The min property has these parts:

Part Description
object A Genome Object
len A long value specifies the minimum length of the genome

Remarks

Since current version of G+ only supports fixed length genome, this value should be equal to the length and maximum length of the genome.

Data Type

long

 

AlleleSetArray Property

Sets and gets the AlleleSetArray associated with the genome.

Syntax:

object.AlleleSetArray = asetarray

set asetarray = object.AlleleSetArray

The AlleleSetArray property has these parts:

Part Description
object A Genome Object
asetarray An AlleleSetArray object

Remarks

The AlleleSetArray property  is used to define the domain of each gene within a genome. For real genome, the length of the genome should be the same as the length of the AlleleSetArray with which it is associated so that each gene within the genome is properly defined. Figure 1 shows the relationship between a real genome and the AlleleSetArray associated with it. For binary genome, the AlleleSetArray should only contain one allele set whose type is binary. The length of the binary genome should be the same as the size of that binary allele set. Figure 2 shows the relationship between a binary genome and the AlleleSetArray. Due to the implementation details, when you assign an AlleleSetArray to a genome, DO NOT USE Set statement. 

Data Type

AlleleSetArray 

 

mutator Property

Sets and gets the mutator of the genome.

Syntax:

object.mutator = [mut]

The mutator property has these parts:

Part Description
object A Genome Object
mut A long value that can be set to one of the GAMutatorType values specifying the mutation operator of the genome

Remarks

Currently G+ supports the following mutators Flip Mutation, Swap Mutation,  Gaussian Mutation, and user defined mutation. The first three mutators are implemented by G+ internally. The last mutator is a custom mutator which is going to be implemented by the user to meet specific requirements. If user defined mutation is specified, the OnMutate event of G+ will be triggered each time when the genome is required for mutation. Blow is a brief description of each mutator.

Flip Mutation (Default): For binary genomes this operator simply inverts the value of the chosen gene (0 goes to 1 and 1 goes to 0). For real genomes it replaces the value of the chosen gene with a uniform random value selected between the user-specified upper and lower bounds for that gene. It is also called uniform mutator in some text books when it is applied to real genomes.

Gaussian Mutation: It picks a new value based on a Gaussian distribution around the current value. This mutator can only be applied to real genomes.

Swap Mutation: This mutator randomly swap elements within a genome. 

Data Type

long 

 

type Property

Sets and gets the type of the genome.

Syntax:

object.type = [typ]

The type property has these parts:

Part Description
object A Genome Object
typ A long value that can be set to one of the GAGenomeType values specifying the type of the genome

Remarks

G+ currently supports two types of genomes: real genome (default) and binary genome. Call this method to define the type of a genome before calling the newGenome method.

Data Type

long 

 

initializer Property

Sets and gets the initializer operator of the genome.

Syntax:

object.initializer = [init]

The initializer property has these parts:

Part Description
object A Genome Object
init A long value that can be set to one of the GAInitializerType values specifying the initializer of the genome

Remarks

Currently G+ supports the following initializers: Random Initializer, Ordered Initializer, and user defined Initializer. The first two initializers are implemented by G+ internally. The last initializer is a custom initializer which is going to be implemented by the user to meet specific requirements. If the user defined initializer  is specified, the OnInitialization event of G+ will be triggered each time when the genome is required for initialization. Blow is a brief description of each initializer.

Random Initializer (Default): This initializer sets each gene of a genome based on the allele set. It choose randomly the allele for each gene. It is also called Uniform Initializer in some text books.

Ordered Initializer: This is a Random initializer for order-based genome. It loops through the genome and assign each gene the next allele in the allele set. Once each gene has been initialized,  it scrambles the contents by swapping elements. This assumes that  all allele sets of the genome have the same definition. It can only be applied to real genomes.

Data Type

long 

 

newGenome Method

Create a new genome and initialize it.

Syntax:

object.newGenome [size]

bret = object.newGenome ( [size] )

The newGenome method has these parts:

Part Description
object A Genome Object
size Optional, specifies the length of the genome.

Remarks

Define the AlleleSetArray and type of the genome and call init of AlleleSetArray before calling this method. Normally the size parameter is omitted and the length of the genome will be determined automatically. For binary genome, the length of the genome will be equal to the size of the first allele set within the AlleleSetArray (the type of this allele set should be binary). For real genome, the length of the genome will be equal to the size of the AlleleSetArray.

Return Value

True if successful; otherwise False.

 

copy Method

Copy data from another genome

Syntax:

object.copy srcGenome, content

bret = object.copy (srcGenome, content )

The copy method has these parts:

Part Description
object A Genome Object
srcGenome The genome to be copied
content  A long value indicate how to copy the genome.

Remarks

The value of content can be a combination of  values listed in GACopyType. Below is a brief description:

GACOPY_ALL               &HFF        Copy all data from srcGenome

GACOPY_ALLELE        &H1          Only copy the data from the AlleleSetArray  of  srcGenome

GACOPY_DATA            &H2          Only copy the value of genes  from srcGenome

GACOPY_SETTING      &H4          Only copy the properties such as mutator from srcGenome

Return Value

True if successful; otherwise False.

 

size Method

Returns the length of the genome

Syntax:

sz = object.size

The size method has these parts:

Part Description
object A Genome Object

Return Value

A long value indicating the length of the genome.

 

Initialize Method

Initialize the genome.

Syntax:

object.Initialize 

The Initialize method has these parts:

Part Description
object A Genome Object

Remarks:

This method will use the initializer defined in the initializer property to initialize the genome.

 

ToString Method

Returns a String expression of the genome

Syntax:

str = object.ToString ( [strConnect] )

The ToString method has these parts:

Part Description
object A Genome Object
strConnect Optional, specifies the connection string between genes. 

Remarks:

Call this method to express the genome in a String. For example, if  genome X is a real genome and contains five genes with values 1,2,3,4,5,  then the ToString("=>") method will return a string like "1=>2=>3=>4=>5". 

Return Value

A String expression of the genome.

 

Compare Method

Compare one genome with another.

Syntax:

fret = object.Compare (pIGenome)

The Compare method has these parts:

Part Description
object A Genome Object
pIGenome The genome to be compared 

Remarks:

This method is supposed to return a number that indicates how similar two genomes are. If they are different lengths then this method returns -1. Otherwise the return value will be the percentage of different genes within the two genomes. For example, if genome A is 1=>2=>3=>4=>5 and genome B is 1=3=>2=>4=>5 then the return value will be 0.4.

 

Mutate Method

Mutate the genome.

Syntax:

object.Mutate 

The Mutate method has these parts:

Part Description
object A Genome Object

Remarks:

This method will use the mutator defined in the mutator property to mutate the genome.

Return Value

A long value indicating the number of genes mutated.

 

Crossover Method

Syntax:

nRet = object.Crossover mate, brother, sister

The Crossover method has these parts:

Part Description
object A Genome Object
mate A Genome Object as the sexual mate of object
brother A Genome Object as the first child of object and mate
sister A Genome Object as  the second child of  object and mate

Remarks:

This method will use the crossover operator associated with the genome to perform a sexual crossover to produce one or two offspring.

Return Value

A long value indicating how many children are produced after the crossover.

 

Evaluate Method

This method calls the genome's objective function  or fitness function to get the fitness value.

Syntax:

fret = object.Evaluate 

the Evaluate method has these parts:

Part Description
object A Genome Object

Remarks:

This method will trigger the OnEvaluateFitnessFunction event of G+ to get the fitness value of the genome.

Return Value

A float value indicating the fitness of the genome

 

getbitsbyte Method

Retrieves part of the bits within a binary genome.

Syntax:

byt = object.getbitsbyte (i , j)

the getbitsbyte method has these parts:

Part Description
object A Genome Object
i zero based index of the first bit to be retrieved
j zero based index of the last bit to be retrieved

Remarks

The difference between i and j should be less than 8. This method can only be applied to binary genomes. For example, if the genome is 0=>0=>0=>1=>0=>1=>0=>1=>1, i=2 and j=4, then byt will be 2 after calling this method.

Return Value

A byte value that stores the bits retrieved.

 

setbitsbyte Method

Sets part of the bits within a binary genome.

Syntax:

object.setbitsbyte i , j, byt

bret = object.setbitsbyte (i , j, byt)

the setbitsbyte method has these parts:

Part Description
object A Genome Object
i zero based index of the first bit to be set
j zero based index of the last bit to be set
byt A byte value that stores the data to be set

Remarks

The difference between i and j should be less than 8. This method can only be applied to binary genomes. For example, if the genome is 0=>0=>0=>1=>0=>1=>0=>1=>1, byt=5, i=2 and j=4, then the genome after calling this method will be 0=>0=>1=>0=>1=>1=>0=>1=>1.

Return Value

True if successful; otherwise False.

 

getbitslong Method

Retrieves part of the bits within a binary genome.

Syntax:

byt = object.getbitslong (i , j)

the getbitslong method has these parts:

Part Description
object A Genome Object
i zero based index of the first bit to be retrieved
j zero based index of the last bit to be retrieved

Remarks

The difference between i and j should be less than 32. This method can only be applied to binary genomes. 

Return Value

A long value that stores the bits retrieved.

 

setbitslong Method

Sets part of the bits within a binary genome.

Syntax:

object.setbitslong i , j, byt

bret = object.setbitslong (i , j, byt)

the setbitslong method has these parts:

Part Description
object A Genome Object
i zero based index of the first bit to be set
j zero based index of the last bit to be set
byt A long value that stores the data to be set

Remarks

The difference between i and j should be less than 32. This method can only be applied to binary genomes.  .

Return Value

True if successful; otherwise False.

 

IsGeneExists Method

Check whether a specific value exists within a genome.

Syntax:

bret = object.IsGeneExists (var)

the IsGeneExists method has these parts:

Part Description
object A Genome Object
var A variant specifying the value to be found

Return Value

True if exists; otherwise false.

 


  1. Population  (Properties, Methods

The population object is a container for the genomes. It also contains statistics information such as average, maximum, and minimum fitness. 

Properties:

  1. Individual (Default)
  2. order
  3. scaled
  4. selector

Methods:

  1. ave
  2. best
  3. dev
  4. div
  5. fitave
  6. fitdev
  7. fitmax
  8. fitmin
  9. fitsum
  10. fitvar
  11. Initialize
  12. max
  13. min
  14. nevals
  15. newPopulation
  16. size
  17. sum
  18. var
  19. worst

Back

 

Individual Property

Sets or gets a genome from the population.

Syntax:

  1. object.Individual (index) [ = srcgenome ]
  2. object (index) [=srcgenome]
  3. set destgenome = object.Individual (index)
  4. set destgenome = object (index)

The Individual property has these parts:

Part Description
object A Population Object
index An integer that specifies the zero based index of the genome to be set or got
destgenome , src genome  A Genome Object

Remarks

For syntax 1 and 2, the Individual property actually copies all the information from the srcgenome rather than keeping a reference of it, which means further modification on the  srcgenome will not affect the individual within the population. For syntax 3 and 4,  the Individual property returns a reference of the specified genome. Therefore, further modification on destgenome will directly affect the genome within the population.

Data Type

Genome

 

order Property

Sets/Gets the sort order. A population may be sorted in two ways, highest-score-is-best or lowest-score-is-best.

Syntax:

object.order [= od ]

The order property has these parts:

Part Description
object A Population Object
od A long value that can be set to one of the GASortOrder values specifying the order

Remarks

Normally the user need not to set this value. The Population Object will set this property automatically according to the maximini property of G+.

Data Type

long

 

selector Property

Sets and gets the selector of the population.

Syntax:

object.selector [= sel ]

The selector property has these parts:

Part Description
object A Population Object
sel  A long value that can be set to one of the GASelector values specifying the selector of the population

Remarks

G+ currently supports the following selectors: Roulette Wheel selector, Tournament selector, Rank selector, Uniform selector, SRS (Stochastic remainder sampling) Selector, Deterministic Sampling Selector, and user defined selector. The first six selectors are implemented by G+ internally. The last one is a custom selector that is going to be implemented by the user to meet specific requirements. Below is a brief description of each selector:

Roulette Wheel selector (Default): A selection operator in which the chance of a genome getting selected is proportional to its fitness. The roulette-wheel selection provides a zero bias but does not guarantee minimum spread.

Tournament selector: A selection operator which uses roulette selection N times to produce a tournament subset of genomes. The best genome in this subset is then chosen as the selected genome. This method of selection applies addition selective pressure over plain roulette selection.

Rank selector: The population is sorted according to the objective values. The fitness assigned to each individual depends only on its position in the individuals rank and not on the actual objective value. Rank-based selection overcomes the scaling problems of the proportional fitness assignment. (Stagnation in the case where the selective pressure is too small or premature convergence where selection has caused the search to narrow down too quickly.) The reproductive range is limited, so that no individuals generate an excessive number of offspring. Ranking introduces a uniform scaling across the population and provides a simple and effective way of controlling selective pressure.

Uniform selector: A selection operator which randomly selects a genome from the population.

SRS Selector: The selection happens in two stages. First it generates an array using the integer and remainder parts of the expected number of individuals. Then it picks an individual from the population by randomly picking from this array.

Deterministic Sampling Selector: This implementation only works if fitness scores are strictly positive or strictly negative.

Data Type

long

 

scaled Property

Specify whether to use raw objective score or scaled (fitness) score for selection, sorting, et.

Syntax:

object.scaled [= bscaled ]

The scaled property has these parts:

Part Description
object A Population Object
bscaled  A Boolean value. 

Remarks

If this property is set to True the scaled (fitness) score will be used; otherwise raw objective score will be used. The default value for this property is True.

Data Type

Boolean

 

newPopulation method

Create a new population and initialize it.

Syntax:

object.newPopulation  [size], Org 

bret = object.newPopulation  ([size], Org )

The newPopulation  method has these parts:

Part Description
object A Population Object
size Optional, specifies the size of the population.  
Org  A Genome Object that is used as a 'template' or 'typical' genome to initialize the population.

Remarks

If the size parameter is omitted, the size of the population will be equal to the defpopsize of G+. This method will call the initializer of each individual to initialize the genome.

Return Value

True if successful; otherwise False. 

 

size method

Returns the size of the population.

Syntax:

sz = object.size 

The size method has these parts:

Part Description
object A Population Object

Return Value

A long value specifying the size of the population.

 

sum method

Returns the sum of the objective scores.

Syntax:

sm = object.sum 

The sum method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the sum of the objective scores.

 

ave method

Returns the average of the objective scores.

Syntax:

av = object.ave 

The ave method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the average of the objective scores.

 

var method

Returns the variance of the objective scores.

Syntax:

v = object.var

The var method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the variance of the objective scores.

 

dev method

Returns the standard deviation of the objective scores.

Syntax:

d = object.dev

The dev method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the standard deviation of the objective scores.

 

max method

Returns the maximum objective score in the population.

Syntax:

m = object.max

The max method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the maximum objective score in the population.

 

min method

Returns the minimum objective score in the population.

Syntax:

m = object.min

The min method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the minimum objective score in the population.

 

div method

Returns the diversity of the population.

Syntax:

d = object.div

The div method has these parts:

Part Description
object A Population Object

Remarks

Diversity is a number between 0 and 1 where 1 indicates that each individual is completely different than every other individual. If you specify two indices, this member function returns the diversity of the specified individuals (it invokes the comparison function for those individuals).

Return Value

A float value specifying the diversity of the population.

 

fitsum method

Returns the sum of the fitness scores.

Syntax:

sm = object.fitsum

The fitsum method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the sum of the fitness scores.

 

fitave method

Returns the average of the fitness scores.

Syntax:

av = object.fitave

The fitave method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the average of the fitness scores.

 

fitmax method

Returns the maximum fitness score.

Syntax:

m = object.fitmax

The fitmax method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the maximum fitness score.

 

fitmin method

Returns the minimum fitness score.

Syntax:

m = object.fitmin 

The fitmin method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the minimum fitness score.

 

fitvar method

Returns the variance of the fitness scores.

Syntax:

v = object.fitvar

The fitvar method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the variance of the fitness scores.

 

fitdev method

Returns the standard deviation of the fitness scores.

Syntax:

d = object.fitdev

The fitdev method has these parts:

Part Description
object A Population Object

Return Value

A float value specifying the standard deviation of the fitness scores.

 

nevals method

Returns the number of objective function evaluations since the population was initialized.

Syntax:

n = object.nevals

The nevals method has these parts:

Part Description
object A Population Object

Return Value

A long value specifying the number of objective function evaluations since the population was initialized.

 

Initialize method

Initialize the population.

Syntax:

 object.Initialize 

The Initialize method has these parts:

Part Description
object A Population Object

Remarks

This method will call the initializer of each genome to initialize it.

 

best  method

Returns a reference to the ith best individual in the population.

Syntax:

object.best (i)

set genome = object.best (i)

The best  method has these parts:

Part Description
object A Population Object
i A zero based index specifying the required genome.

Remarks

The ith best genome is evaluated in terms of raw objective score.

Return Value

A Genome Object representing the ith best individual in the population.

 

worst method

Returns a reference to the ith worst individual in the population.

Syntax:

object.worst (i)

set genome = object.worst (i)

The worst method has these parts:

Part Description
object A Population Object
i A zero based index specifying the required genome.

Remarks

The ith worst genome is evaluated in terms of raw objective score.

Return Value

A Genome Object representing the ith worst individual in the population.


  1. GA  ( Properties, Methods, Events )

A GA object is an ActiveX control representing the genetic algorithm. This is the kernel object of G+.

Properties:

  1. algorithm
  2. crossover
  3. defgenometype
  4. definitializer
  5. defmutator
  6. defpopsize
  7. defselector
  8. elitist
  9. maxgeneration
  10. maximini
  11. nconvergence
  12. notifyaftercrossover
  13. notifyafterinit
  14. notifyaftermutation
  15. notifyafterstep
  16. pconvergence
  17. pcrossover
  18. pmutation
  19. population
  20. replacepercentage
  21. terminator

Method:

  1. convergence
  2. crossovers
  3. done
  4. evolve
  5. generation
  6. initialize
  7. mutations
  8. selections
  9. step

Events

  1. AfterCrossover
  2. AfterInitGenome
  3. AfterMutation
  4. AfterStep
  5. OnCrossover
  6. OnEvaluateFitnessFunction
  7. OnInitialization
  8. OnMutate
  9. OnSelection
  10. OnTermination

Back

 

population Property

Sets and gets the population of GA.

Syntax:

set p = object.population 

set object.population = p

The population property has these parts:

Part Description
object A GA Object

Remarks

When you assign a Population object to GA, it actually keeps a reference of the object. However, due to the implementation details of GA, it will not always return the same reference. The reason is because besides this Population object, the GA also maintains another Population object internally. In other words there are two Population objects within the GA control. Some algorithm such as SGA will use both population during the evolution process. Therefore, the return object of this property may be either the one you assigned to it or the internal one within the control. If we have some code like below:

Dim pop As New population, tmpPop As population
Dim g As GA
Dim sngBest1 As Single, sngBest2 As Single, sngBest3 As Single

'Initialization
...
'===

Set g.population = pop
g.evolve 0

sngBest1 = pop.best(0).Evaluate
sngBest2 = g.population(0).Evaluate
Set tmpPop = g.population(0)
sngBest3 = tmpPop.best(0).Evaluate

Then sngBest2 will always be the same as sngBest3 and sngBest1 may differ from sngBest2 since pop and g.population may refer to different Population object.

Data Type

Population

 

crossover Property

Sets and gets the crossover operator of GA

Syntax:

object.crossover [= c ]

The crossover property has these parts:

Part Description
object A GA Object
c A long value that can be set to one of the GACrossoverType values specifying the crossover operator of GA

Remarks

G+ currently supports eight crossover operators: Single-point Crossover, Two-point Crossover, Uniform Crossover, Even-Odd Crossover, Partial-Match Crossover, Order Crossover, Cycle Crossover, and user defined crossover. The first seven operators are implemented by G+ internally. The last one is a custom crossover operator that is going to be implemented by the user to meet specific needs. Below is a brief description of each operator:

Single-point Crossover (Default): It picks a single point at random and then copies genetic material from each parent. 

Two-point Crossover: Two crossover points are selected. The genes from beginning of parent 1 (father) to its first crossover point and the genes from its second crossover point to its end are copied to the new offspring. The rest (the first crossover point of parent 2 (mother) to its second crossover point) is copied to the new offspring in the same way.

Uniform Crossover: Bits are randomly copied from the first or from the second parent to the new offspring. For each bit a coin is flipped to see if that bit should come from the mother or the father. This allows the parent chromosomes to be mixed at the gene level rather than the segment level 

Even-Odd Crossover: For even crossover it takes the 0th element and every other one after that from the mother. The 1st and  every other come from the father. For odd crossover, it does just the opposite.

Partial-Match Crossover: It picks an arbitrary position in two parents. For example, the values of the gene in that position are 5 for father and 8 for mother. Then it will interchange 5 with 8 in both parents. This operation will be performed for several times. The children will have characteristics of both parents. 

Order Crossover: It picks about half of the elements of the first parent and copy them to the child, preserving the positions. Then it choose the remaining values from the second parent and copy them to the child, preserving the order. This preserves the some  orderings of elements in both parents and position of some in the first parent.

Cycle Crossover: The first is picked from mom, then cycle using dad. Finally, fill in the gaps with the elements from dad. This crossover preserves the position and value of everything.

Data Type

long

 

algorithm Property

Sets and gets the algorithm used in GA.

Syntax:

object.algorithm [= a ]

The algorithm property has these parts:

Part Description
object A GA Object
a A long value that can be set to one of the GAAlgorithmType values specifying the algorithm of GA

Remarks

G+ currently supports three algorithms: Simple GA (SGA) , Steady State GA, Crowding GA. Below is a brief description of each algorithm:

Simple GA ( SGA) (Default) : This is the standard algorithm described by Goldberg. The algorithm provides an option of elitism, which can substantially improve the performance of GA for many kinds of problems.

Steady State GA: The new individuals created by the algorithm are stored in a temporary population object. A certain number of individuals (the worst ones) in the current population are replaced by those stored in the temporary population (best ones). If a genome in the temporary population is worse than one in the main population, the genome in the main population will also be replaced regardless of its better score.

Crowding GA: All individuals in current population are copied into a mating pool. Two parents are selected from the mating pool at random. A child is generated by a predefined crossover and mutation method. The mother or father may be replaced by the child depending on their relative fitness to each other. This procedure continues until all individuals in the mating pool have been selected.

Note: This algorithm has its own selector. Therefore the selector properties of the Population Object will have no effect on this algorithm.

Data Type

long

 

maxgeneration Property

Sets and gets the maximum generation of GA.

Syntax:

object.maxgeneration [= m ]

The maxgeneration property has these parts:

Part Description
object A GA Object
m A long value specifying the maximum generation

Remarks

The maxgeneration property is used with the Generation Number Termination (GA_TERMINATEUPONGENERATION). The GA will stop the evolution when the user-specified max number (maxgeneration)  of evolutions have been run. The default value is 150.

Data Type

long

 

notifyafterstep Property

Determine whether AfterStep event will be triggered.

Syntax:

object.notifyafterstep [= b ]

The notifyafterstep property has these parts:

Part Description
object A GA Object
b A Boolean value

Remarks

If this property is set to True, then the AfterStep event will be triggered each time at the end of each generation. It is useful if you would like to retrieve the status of the genetic algorithms evolution at the end of each generation. The default value is True.

Data Type

Boolean

 

maximini Property

Sets and gets the objective of GA.

Syntax:

object.maximini  [= obj ]

The maximini property has these parts:

Part Description
object A GA Object
obj  A long value that can be set to one of the GAMaxMinType values specifying the objective of GA

Remarks

This defines the objective of GA: whether it is going to minimize or maximize the objective function. The default value for this property is GA_MINIMIZE.

Data Type

long

 

pmutation Property

Sets and gets the mutation rate.

Syntax:

object.pmutation [= pmut ]

The pmutation property has these parts:

Part Description
object A GA Object
pmut  A float value specifying the mutation rate

Remarks

The default value is 0.01.

Data Type

float

 

pcrossover Property

Sets and gets the crossover rate.

Syntax:

object.pcrossover [= pcos ]

The pcrossover property has these parts:

Part Description
object A GA Object
pcos  A float value specifying the crossover rate

Remarks

The default value is 0.9. This property will not affect the crossover rate of Crowding GA which is always 1.

Data Type

float

nconvergence Property

Sets and gets the number of generations used for the convergence test. The default value is 20.

Syntax:

object.nconvergence [= n ]

The nconvergence property has these parts:

Part Description
object A GA Object
A long value specifying the number of generations for the convergence test

Data Type

long

 

pconvergence Property

Sets and gets  the convergence percentage. The default value is 0.99.

Syntax:

object.pconvergence [= p ]

The pconvergence property has these parts:

Part Description
object A GA Object
A float value specifying the convergence percentage

Remarks

The convergence is defined as the ratio of the Nth previous best-of-generation score to the current best-of-generation score. N is defined by the nConvergence property.

Data Type

float 

 

notifyaftermutation Property

Determine whether AfterMutation event will be triggered.

Syntax:

object.notifyaftermutation [= b ]

The notifyaftermutation property has these parts:

Part Description
object A GA Object
b A Boolean value

Remarks

If this property is set to True, then the AfterMutation event will be triggered each time at the end of each mutation. It is useful if you would like to do some post-mutation process after each mutation. This event will not be triggered for custom mutator even if notifyaftermutation  is set to True. The default value is False.

Data Type

Boolean

 

notifyafterinit Property

Determine whether AfterInitGenome event will be triggered.

Syntax:

object.notifyafterinit [= b ]

The notifyafterinit property has these parts:

Part Description
object A GA Object
b A Boolean value

Remarks

If this property is set to True, then the AfterInitGenome event will be triggered each time after the initialization of a genome. It is useful if you would like to do some post-initialization process after each initialization. This event will not be triggered for custom initializer even if notifyafterinit is set to True. The default value is False.

Data Type

Boolean

 

notifyaftercrossover Property

Determine whether AfterCrossover event will be triggered.

Syntax:

object.notifyaftercrossover [= b ]

The notifyaftercrossover property has these parts:

Part Description
object A GA Object
b A Boolean value

Remarks

If this property is set to True, then the AfterCrossover event will be triggered each time after a crossover procedure. It is useful if you would like to do some post-crossover process. This event will not be triggered for custom crossover even if notifyaftercrossover is set to True. The default value is False.

Data Type

Boolean

 

terminator Property

Sets and gets the termination method used in GA.

Syntax:

object.terminator [= t ]

The terminator property has these parts:

Part Description
object A GA Object
t A long value that can be set to one of the GATerminatorType values specifying the termination method

Remarks

G+ currently supports four terminators: Terminate Upon Generation, Terminate Upon Convergence, Terminate Upon Population Convergence, user defined terminator. The first three terminators are implemented by G+ internally. The last one is a custom terminator which is going to be implemented by the user. Below is a brief description of each terminator.

Terminate Upon Generation (Default): A termination method that stops the evolution when the user-specified max number of evolutions have been run. The user-specified max number of evolutions is defined in maxgeneration property.

Terminate Upon Convergence: A termination method that stops the evolution when the fitness is deemed as converged. If it is going to maximize the objective function, then the GA will terminate when the convergence has exceeded the specified value in the pconvergence property. Otherwise it will terminate when the convergence has dropped below pconvergence.

Terminate Upon Population Convergence: A termination method that stops the evolution when the population is deemed as converged. It uses the ratio between the minimum and maximum to determine whether the population has converged. This method will NOT work if the values cross zero. If it is going to maximize the objective function, then terminate when the ratio exceeds the specified value in the pconvergence property. Otherwise terminate when the ratio drops below pconvergence. 

Data Type

long

 

elitist Property

Determine whether the algorithm is going to use elitism.

Syntax:

object.elitist [= b ]

The elitist property has these parts:

Part Description
object A GA Object
b A Boolean value

Remarks

This property is only valid for SGA. The default value is True.

Data Type

Boolean

 

replacepercentage Property

Determine the replace percentage of Steady GA.

Syntax:

object.replacepercentage [= p ]

The replacepercentage property has these parts:

Part Description
object A GA Object
p A float value between 0 and 1 specifying the replace percentage

Remarks

This property is used with Stead GA to determine how many genomes are going to be replaced each generation The default value is 0.5.

Data Type

float

 

definitializer Property

Sets and gets the default initializer that  G+ uses to define each genome when it is created.

Syntax:

object.definitializer [= init ]

The definitializer property has these parts:

Part Description
object A GA Object
init A long value that can be set to one of the GAInitializerType values 

Data Type

long

 

defmutator Property

Sets and gets the default mutator that G+ uses to define each genome when it is created.

Syntax:

object.defmutator [= mut ]

The defmutator property has these parts:

Part Description
object A GA Object
mut A long value that can be set to one of the GAMutatorType values 

Data Type

long

 

defgenometype Property

Sets and gets the default type that G+ uses to define each genome when it is created.

Syntax:

object.defgenometype [= typ ]

The defgenometype property has these parts:

Part Description
object A GA Object
typ A long value that can be set to one of the GAGenomeType values 

Data Type

long

 

defselector Property

Sets and gets the default selector G+ uses to define each population when it is created.

Syntax:

object.defselector [= sel ]

The defselector property has these parts:

Part Description
object A GA Object
sel A long value that can be set to one of the GASelector values 

Data Type

long

 

defpopsize Property

Sets and gets the default population size of each population when it is created. The default value is 100.

Syntax:

object.defpopsize [= size ]

The defpopsize property has these parts:

Part Description
object A GA Object
size A long value specifying the default population size

Data Type

long

 

initialize Method

Initialize the population.

Syntax:

object.initialize seed

The initialize method has these parts:

Part Description
object A GA Object
seed A random value specified by the user

 

step Method

Evolve the genetic algorithm for one generation.

Syntax:

object.step  

The step method has these parts:

Part Description
object A GA Object

 

evolve Method

Initialize the genetic algorithm then evolve it until the termination criteria have been satisfied.

Syntax:

object.evolve seed

The evolve  method has these parts:

Part Description
object A GA Object
seed A random value specified by the user

 

done  Method

Returns True if the termination criteria have been met; otherwise False.

Syntax:

bdone = object.done  

The done  method has these parts:

Part Description
object A GA Object
bdone  A Boolean value

 

generation Method

Returns the current generation.

Syntax:

n = object.generation

The generation method has these parts:

Part Description
object A GA Object

 

convergence Method

Returns the current convergence. 

Syntax:

c = object.convergence 

The convergence method has these parts:

Part Description
object A GA Object

Remarks:

The convergence is defined as the ratio of the Nth previous best-of-generation score to the current best-of-generation score.

 

crossovers Method

Returns the number of crossovers that have occurred since initialization.

Syntax:

c = object.crossovers 

The crossovers method has these parts:

Part Description
object A GA Object

 

mutations Method

Returns the number of mutations that have occurred since initialization.

Syntax:

m = object.mutations 

The mutations method has these parts:

Part Description
object A GA Object

 

selections Method

Returns the number of selections that have occurred since initialization.

Syntax:

s = object.selections 

The selections method has these parts:

Part Description
object A GA Object

 

OnEvaluateFitnessFunction Event

Occurs when genetic algorithm needs the fitness for a genome. The user must implement this event procedure to return the fitness. This is how you describe the objective / goal of the genetic optimization.

Syntax:

Private Sub object_OnEvaluateFitnessFunction (ByVal genome As GALib.IGenome, var As Variant, result As Single)

The OnEvaluateFitnessFunction event has these parts:

Part Description
object A GA Object
genome  A Genome Object specifying the individual to be evaluated
var  Reserved
result  Set this parameter to the fitness computed by the objective function.


OnCrossover Event

Occurs when the GA requires a custom crossover.

Syntax:

Private Sub object_OnCrossover(ByVal father As GALib.IGenome, ByVal mother As GALib.IGenome, ByVal brother As GALib.IGenome, ByVal sister As GALib.IGenome, var As Variant, result As Long)


The OnCrossover event has these parts:

Part Description
object A GA Object
father  A Genome object representing one of the parents
mother  A Genome object representing the other parent
brother  A Genome object representing the first child of the crossover
sister  A Genome object representing the second child of the crossover
var  Reserved
result  Set this parameter to show how many children are generated after the crossover

Remarks:

This event will be triggered only if the crossover property is set to custom crossover (GA_CUSTOMCROSSOVER).

 

OnMutate Event

Occurs when genetic algorithm needs a custom mutation.

Syntax:

Private Sub object_OnMutate (ByVal genome As GALib.IGenome, ByVal rate As Single, var As Variant, result As Long)

The OnMutate event has these parts:

Part Description
object A GA Object
genome  A Genome Object specifying the individual to be mutated
rate A float value specifying the mutation rate
var  Reserved
result  Set this parameter to the number of genes mutated

Remarks:

This event will be triggered only if the mutator property of a genome is set to custom mutator (GA_CUSTOMMUTATOR).

 

OnInitialization Event

Occurs when genetic algorithm needs a custom initialization.

Syntax:

Private Sub object_OnInitialization (ByVal genome As GALib.IGenome, var As Variant)

The OnInitialization event has these parts:

Part Description
object A GA Object
genome  A Genome Object specifying the individual to be initialized
var  Reserved

Remarks:

This event will be triggered only if the initializer property of a genome is set to custom initializer (GA_CUSTOMINITIALIZER).

 

OnTermination Event

Occurs when genetic algorithm needs the user to determine whether the evolution process should end.

Syntax:

Private Sub object_OnTermination (ByVal population As GALib.IPopulation, var As Variant, bEnd As Boolean)

The OnTermination event has these parts:

Part Description
object A GA Object
population  A Population Object specifying the population of GA
var  Reserved
bEnd  Set this variable to True if you want to terminate the evolution process; otherwise False

Remarks:

This event will be triggered only if the terminator  is set to custom terminator (GA_CUSTOMTERMINATOR).

 

OnSelection Event

Occurs when genetic algorithm needs the user to determine which genome should be selected for crossover.

Syntax:

Private Sub object_OnSelection (ByVal population As GALib.IPopulation, var As Variant, index As Long)

The OnSelection event has these parts:

Part Description
object A GA Object
population  A Population Object specifying the population of GA
var  Reserved
index  Set this variable to the index of the genome within the population that will be used for crossover

Remarks:

This event will be triggered only if the selector property of a population is set to custom selector (GA_CUSTOMSELECTOR).

 

 

AfterStep Event

Occurs after each generation.

Syntax:

Private Sub object_AfterStep  (ByVal population As population, var As Variant)

The AfterStep event has these parts:

Part Description
object A GA Object
population  A Population Object specifying the population of the GA
var  Reserved

Remarks:

This event will be triggered only if the notifyafterstep property is set to True.

 

AfterMutation Event

Occurs after each mutation.

Syntax:

Private Sub object_AfterMutation (ByVal genome As GALib.IGenome, ByVal rate As Single, ByVal nMut As Long)

The AfterMutation event has these parts:

Part Description
object A GA Object
genome  A Genome Object that has mutated
rate  A float value specifying the mutation rate
nMut  A long value specifying number of genes mutated

Remarks:

This event will be triggered only if the notifyaftermutation property is set to True.

 

AfterInitGenome Event

Occurs after the initialization of a genome..

Syntax:

Private Sub object_AfterInitGenome (ByVal genome As GALib.IGenome)

The AfterInitGenome event has these parts:

Part Description
object A GA Object
genome  A Genome Object that has been initialized

Remarks:

This event will be triggered only if the notifyafterinit property is set to True.

 

AfterCrossover Event

Occurs after a crossover.

Syntax:

Private Sub object_AfterCrossover  (ByVal father As GALib.IGenome, ByVal mother As GALib.IGenome, ByVal brother As GALib.IGenome, ByVal sister As GALib.IGenome)

The AfterCrossover event has these parts:

Part Description
object A GA Object
father  A Genome object representing one of the parents
mother  A Genome object representing the other parent
brother  A Genome object representing the first child of the crossover
sister  A Genome object representing the second child of the crossover

Remarks:

This event will be triggered only if the notifyaftercrossover property is set to True.

 


Constant Definition

  1. GAAlgorithmType
  2. GAAlleleType
  3. GABoundType
  4. GACopyType
  5. GACrossoverType
  6. GAGenomeType
  7. GAInitializerType
  8. GAMaxMinType
  9. GAMutatorType
  10. GASelector
  11. GASortOrder
  12. GATerminatorType

Back

  1. GAAlgorithmType
  2. Symbol Value Description
    GA_SIMPLEGA 0 Simple Genetic Algorithm (SGA)
    GA_CROWDINGGA 1 Crowding GA
    GA_STEADYGA 2 Steady State GA
    GA_UNKNOWNGA -1 Invalid Value

  3. GAAlleleType
  4. Symbol Value Description
    GAALLELE_ENUMERATED 1 Enumerated allele set
    GAALLELE_BOUNDED 2 Bounded allele set
    GAALLELE_DISCRETIZED 3 Bounded allele set with discretization
    GAALLELE_BINARY 4 Binary allele set

  5. GABoundType
  6. Symbol Value Description
    GABOUND_NONE 0 No boundary
    GABOUND_INCLUSIVE 1 Inclusive boundary
    GABOUND_EXCLUSIVE 2 Exclusive boundary

  7. GACopyType
  8. Symbol Value Description
    GACOPY_ALL &HFF Copy all data from the source genome
    GACOPY_ALLELE 1 Only copy the data from the AlleleSetArray of the source genome
    GACOPY_DATA 2 Only copy the value of genes from the source genome
    GACOPY_SETTING 4 Only copy the properties such as  mutator from the  source genome

  9. GACrossoverType
  10. Symbol Value Description
    GA_CUSTOMCROSSOVER 0 Custom Crossover
    GA_SINGLEPOINTCROSSOVER 1 Single Point Crossover
    GA_UNIFORMCROSSOVER 2 Uniform Crossover
    GA_ORDERCROSSOVER 3 Order Crossover
    GA_CYCLECROSSOVER 4 Cycle Crossover
    GA_PARTIALMATCHCROSSOVER 5 Partial Match Crossover
    GA_EVENODDCROSSOVER 6 Even Odd Crossover
    GA_TWOPOINTCROSSOVER 7 Two Point Crossover
    GA_NULLCROSSOVER -1 Invalid
    GA_UNKNOWNCROSSOVER -2 Invalid

  11. GAGenomeType
  12. Symbol Value Description
    GA_REALGENOME 1 Real Genome represented by a mixed array of integer and real numbers
    GA_BINARYGENOME 2 Binary Genome represented by a mixed array of '0's and '1's

  13. GAInitializerType
  14. Symbol Value Description
    GA_CUSTOMINITIALIZER 0 Custom Initializer
    GA_RANDOMINITIALIZER 1 Random Initializer
    GA_ORDERINITIALIZER 2 Ordered Initializer
    GA_NULLINITIALIZER -1 Invalid
    GA_UNKNOWNINITIALIZER -2 Invalid

  15. GAMaxMinType
  16. Symbol Value Description
    GA_MAXIMIZE 1 Aimed at maximize the objective function
    GA_MINIMIZE -1 Aimed at minimize the objective function

  17. GAMutatorType
  18. Symbol Value Description
    GA_CUSTOMMUTATOR 0 Custom mutator
    GA_FLIPMUTATOR 1 Flip mutator
    GA_GAUSSIANMUTATOR 2 Guassian mutator
    GA_SWAPMUTATOR 3 Swap mutator
    GA_NULLMUTATOR -1 Invalid
    GA_UNKNOWNMUTATOR -2 Invalid

  19. GASelector
  20. Symbol Value Description
    GA_ROULETTEEWHEELSELECTOR 1 Roulettee Wheel Selector
    GA_RANKSELECTOR 2 Rank Selector
    GA_TOURNAMENTSELECTOR 3 Tournament Selector
    GA_UNIFORMSELECTOR 4 Uniform Selector
    GA_SRSSELECTOR 5 Stochastic remainder sampling (SRS ) Selector
    GA_DSSELECTOR 6 Deterministic Sampling (DS) Selector
    GA_CUSTOMSELECTOR 7 Custom Selector
    GA_UNKNOWNSELECTOR -1 Invalid

  21. GASortOrder
  22. Symbol Value Description
    GA_LOWISBEST -1 low score is better
    GA_HIGHISBEST 1 high score is better

  23. GATerminatorType
  24. Symbol Value Description
    GA_TERMINATEUPONGENERATION 0 Terminate upon generation
    GA_TERMINATEUPONCONVERGENCE 1 Terminate upon convergence
    GA_TERMINATEUPONPOPCONVERGENCE 2 Terminate upon convergence of the population
    GA_CUSTOMTERMINATOR 3 Custom terminator 
    GA_NULLTERMINATOR -1 Invalid

 


Weidong Yuan, 23 September 2004