Joakim Fast
03/01/2018, 4:33 PMpoohbar
03/01/2018, 4:39 PMp <- generateInitialPopulation
while (end condition is not met):
select best fit survivors using fitness function
mate and mutate survivors
p <- combine offspring and elites into new population
now p has your best population
Joakim Fast
03/01/2018, 4:40 PMpoohbar
03/01/2018, 4:42 PMval p = List(n) { rnd.nextInt() to rnd.nextInt() }
// or if you dont like this then:
val p = List(n) { Pair(rnd.nextInt(), rnd.nextInt()) }
Joakim Fast
03/01/2018, 4:48 PMpoohbar
03/01/2018, 4:52 PMdata class Creature(val x: Int, val y: Int, val t: Team)
Joakim Fast
03/01/2018, 4:52 PM