PDA

View Full Version : Genetic Algorithm



troelsi
06-21-2007, 11:50 AM
Hi

Any tips on how to handle the representation format used by GA.

The representation format that I'm working on can be thought of as a string of paired values and the sequence of these paired values represents a sequence ie.:

(1,2) (3,4) (1,7)

Several strings are generated in order to represent a population.
At this moment I'm using an two-dimensional array(population, sequence) defined as an single array to represent the above string.
If the above string represents population 1 then
array(1,2) = 3,4

However something tells me that there is a much better way to represent these strings. Especially when the crossover between to strings and the mutation has to be carried out.


Any Ideas?

Best regards
Troels

Ebrow
06-22-2007, 05:12 AM
Not sure what you are looking for. Is it something like this?



Type myArrayType
myPart1 As String
myPart2 As String
End Type
Public myArray(999, 999) As myArrayType

Sub test()
myArray(1, 1).myPart1 = "5"
myArray(1, 1).myPart2 = "6"
End Sub