protected void MutateGene()
{
var rand = Generator.Random;
// select random point of mutation
int mutationPoint = rand.Next(length);
if (mutationPoint < headLength)
{
// genes from head can be randomized freely (type may change)
genes[mutationPoint].Generate();
}
else
{
// genes from tail cannot change their type - they
// should be always arguments
genes[mutationPoint].Generate(GPGeneType.Argument);
}
}