i'm using matlabs ga optimise array of integer variables, want each variable unique value. more precise, want proportion have unique values.
for example, have find optimal integer values 10 variables, requirement optimisation needs ensure last 5 unique values between given range. how go ensuring last 5 variables unique?
i thinking of using non-linear constraint flags repeated variables mean ga still run iteration cause error. way thinking of, not sure how it, create custom creation function ensure unqiue?
any on matter appreciated! thanks!
perhaps use setup similar drawing deck in fitness function?
i.e. wanted 3 unique integers range 1-10, instead of trying tell ga select 3 unique integers, tell select index between 1 , 10 first variable, 1-9 second , 1-8 third. pass array of unique integers between 1 , 10 fitness function, either programmatically or using anonymous function. first variable selects integer array (by indexing), remove integer array. repeat second , third variables. way each variable selects unique value (like drawing deck of cards).
Comments
Post a Comment