SetGenSeed

<< Click to Display Table of Contents >>

Navigation:  »No topics above this level«

SetGenSeed

Return to chapter overview

 

SetGenSeed (Seed As Integer)

 

Purpose: This function sets a seed for the random generator that initializes the chromosome contents of a new population when created.  If this function is not used, the random generator will be seeded by a non-reproducible value from the computer’s internal clock.  This will give the actual random initialization of a population.  A SetGenSeed function with the same argument causes direct repetition of the previously generated pseudo-random sequence.  As a result, the initial genetic information over the whole population will be reproduced. SetGenSeed is useful when exploring the influence of crossover and mutation rates on the optimum search process, while keeping the starting population genetics constant.

 

Note: Function SetGenSeed must be called before MakePopulation.

 

Arguments:

Seed is the number to be seeded into the GALIB32.DLL random generator.  It is in the range 0 to 32,767.

 

Example: i = SetSeed(379)

 

This example sets the seed for the random generator to 379.

 

Related Functions: none