Last active
November 4, 2019 03:48
-
-
Save IntegerMan/2db33c960ccc0639035e3d97b67a123b 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
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) | |
else | |
state |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment