Rubicite Genetic Algorith Framework Tutorial
General:
Basic Info
Selection Bias
Hard Problem
Downloads
Crossovers:
Cycle
Order X
Order 1
Edge Recombination
PMX Crossover
Order Multiple
Direct Insertion
Mutations:
Inversion
Random Slide
Insertion
Single Swap
Random Swap
Scramble
Mutation Technique:
Inversion
VB.NET 2008 Source Code
'Default Float 0 is "0.01" and represents Minimum Swath Size. Valid Values are [0, 0.75] 'Default Float 0 is "0.5" and represents Maximum Swath Size. Valid Values are [0, 0.75] 'If Swathsize is calculated to be less than 2, it will be raised to 2 Sub Inversion_Mutation(ByRef child1 As PChromo) Dim MaxSwathSizePercent As Double = 0.6 Dim MinSwatchSizePercent As Double = 0.0 '1 Determine start and stop of swath Dim X, Y As Integer Dim SwathSize As Integer = RAND.Next(Inversion_Master.Doubles(0) * AlleleCount, Inversion_Master.Doubles(1) * AlleleCount) If SwathSize < 2 Then SwathSize = 2 X = RAND.Next(0, AlleleCount - SwathSize) Y = X + SwathSize - 1 'Store swath values Dim C As New Collection For j As Integer = X To Y C.Add(child1.Alleles(j)) Next 'Put the values back in reverse order For j As Integer = Y To X Step -1 child1.Alleles(j) = C.Item(1) C.Remove(1) Next End Sub
© 2008/2009 Rubicite Interactive Inc.