Created
November 4, 2019 03:12
-
-
Save IntegerMan/75b134411c5e5b443862dd20f0fa9ff0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type ActorChromosome = | |
{ | |
dogImportance: double | |
acornImportance: double | |
rabbitImportance: double | |
treeImportance: double | |
squirrelImportance: double | |
randomImportance: double | |
} | |
let getRandomGene (random: System.Random): double = (random.NextDouble() * 2.0) - 1.0 | |
let getRandomChromosome (random: System.Random) = | |
{ | |
dogImportance = getRandomGene random; | |
acornImportance = getRandomGene random; | |
rabbitImportance = getRandomGene random; | |
treeImportance = getRandomGene random; | |
squirrelImportance = getRandomGene random; | |
randomImportance = getRandomGene random; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment