I am using genetic algorithms to determine survival in my Netlogo model, and the ultimate output of the GA is a decimal number between 0 and 1, inclusive. For crossover / mutation purposes, I need to work with gray code rather than binary numbers. I have a function to convert binary to decimal, but not gray code to binary (which I've struggled with).
Any suggestions on how to code a gray code to binary function?