Simulate dots walking across a plane over multiple generations, learning to become more accurate after every generation.
Open Driver.m
in MATLAB 2015+ and click the Run
button
Driver.m
start
:(x, y)
coordinate where all dots start fromgoal
:(x, y)
coordinate where all dots should try to get tonum_gens
: number of generations to simulate
Move.m
pop_size
: population sizenum_keep
: the best this many individuals to keep each generationmax_step
: the largest distance any individual can take in one simulation stepmutation_rate
: the percentage of directions which will change on new individuals each generationplane_size
: the greatest coordinate (both x and y) that an agent can step to without dying off
- The number of steps each generation is determined by the distance to
goal
fromstart
inDriver.m
and thedist_modifier
inMove.m
- The
plane_size
inMove.m
does not check ifstart
andgoal
are within the bounds; ensurestart
andgoal
are within the square defined by the corners(0, 0)
and theplane_size
coordinate - Diagonal
start
andgoal
coordinates yield better results than keepingstart
andgoal
on the samex
ory
line due to how new directions are chosen