I am doing a very similar project for my Master's dissertation.
The approach I took was to write an S-Function block to implement the GA.
In the S-Function the number of discrete states is equal to the (number of
individuals plus one(representing best up till now for elitist method)
multilied by (num of var +1(for fitness)) plus two (current generation,
current chromosome).
Firstly the population is initialised (either randomly or by loading in a
saved initial population). Then for each individual the parameters are
output to be evaluated. The fitness is read in and written to the state
corresponing to that individual. When all individuals have been evaluated,
the selection crossover and mutation functions are called, and the next
generation begins.
It is important that the sample time for this block is set to equal the time
it takes to evaluate an individual. This can be done by setting ts when
initializing the block.
Hope this helps,
Joe
"Keong" <ywo...@yahoo.com> wrote in message
news:eeb04...@WebX.raydaftYaTP...