-
Notifications
You must be signed in to change notification settings - Fork 2
An example of Genetic Algorithm implementation
License
gmuric/ga_example
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
# An example of Genetic Algorithm implementation This is just an example of Genetic Algorithm implementation used in the following video: https://www.youtube.com/watch?v=XcinBPhgT7M More detailed explanation of the solution: The "snakes" are made of 25 segments each. The solution (chromosome) is a list of angles (alpha) that segment can take where 0 < alpha < pi/2 (so that snakes can't go backwards). The length of each segment is 1. If the starting coordinates of the segment are xi and yi, then the end of the segment is at the coordinates xi+1 = xi + cos(alpha) and yi+1 = yi + sin(alpha). The dimensions of the playground are 32x18. The fitness function is the distance between the end of the last segment and the food. If snake hits the obstacle or the frame or the food, the point of intersection becomes the end of the last segment. The program was implemented in MATLAB using Optimization Toolbox.
About
An example of Genetic Algorithm implementation
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published