Skip to content

Instantly share code, notes, and snippets.

@IntegerMan
Created November 4, 2019 03:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IntegerMan/75b134411c5e5b443862dd20f0fa9ff0 to your computer and use it in GitHub Desktop.
Save IntegerMan/75b134411c5e5b443862dd20f0fa9ff0 to your computer and use it in GitHub Desktop.
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