A Genetic Programming Framework for .NET

EngineOptions.MutationRate Property

Gets or sets the mutation rate.

public int MutationRate {get; set;}

Property Value

For the sake of accuracy, the range of this value is 0 lt;= MutationRate <= MaxValue, with MaxValue representing 100% and 0 representing 0%.

The default value is (MaxValue/10) (equivalent to (int) MaxValue*0.10), or approximately 10%).

Remarks

This value is used to set the MutationRate property of GeneticOperationArgs. It determines the rate at which Individuals are mutated.

If the caller uses another representation (such as a number between 0 and 100), this can be converted to MutationRate's range by performing the following calculation:

//int is used only as an example; any number format will work
int desiredValue = 10;

//range of caller's representation
int maxValue = 100;
int minValue = 0;

//convert desired value to a real number between 0 and 1, 
// then multiply it by int.MaxValue to get in the range of 0 to int.MaxValue
// (this method assumes that (minValue <= desiredValue <= maxValue))
MutationRate = int.MaxValue*((double) (desiredValue - minValue)/maxValue);

Exceptions

Exception Type Condition
ArgumentOutOfRangeException Thrown when value is less than zero.

See Also

EngineOptions Class | GeneticProgrammingEngine.Internal Namespace | mutation Term | GeneticOperationArgs Class | RecombinationRate Property