Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
let handleChromosomeMove (state: GameState, random: System.Random, chromosome: ActorChromosome) =
if state.SimState = SimulationState.Simulating then
let current = state.World.Squirrel.Pos
let movedPos = getCandidates(current, state.World, true)
|> Seq.sortBy(fun pos -> evaluateTile(chromosome, state.World, pos, random))
|> Seq.head
let newState = moveActor state state.World.Squirrel movedPos
simulateActors(newState, random.Next)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.