MAIN POINT TO GRASP: The Cell is not programmed to go after the food. It is programmed so that touching the food has a positive "fitness"/reinforcement. (Controls: Hit up and down to toggle visibility of path/quadrant lines/ and hit C/V to toggle the control test visibility. The control has an orange line and moves absolutely randomly with no learning AI. They will start off with relatively similar behavior, and if your cell learns bad habits (like circling into a wall over and over) then you can always hit the flag and restart or let it play out. Pressing T now toggles turbo mode, do NOT shift click the green flag) (So basically, it "learns") There is not much playing involved yet, however there is a lot more going on here than what is seen on the surface... I suggest leaving this on, maybe open in a window and just checking up on it every now and again. The green cell is programed to make random movements as picked from certain "memory banks" depending on its relative x and y coordinates to the food. Over time the Cell will eventually learn the behavior through certain actions being "Weighted" or reinforced. Reinforcement is represented by that action being re-added to its specific list of possible actions, thus making it slightly more likely to occur when that situation arises again. Over time, the cell will learn to pretty much go to the food. Feel free to "See Inside" to take a peek at what is kind of going on :)
I plan to add many more things, but for now, this is already pretty complicated. In the future I will probably include hunger and have the cell learn to get the food when hungry (through a long series of complicated variables and lists). If you have suggestions or critiques, please leave a comment, if you think it is cool give it a Love, and if you love it, give it a favorite! :D I'll try to respond to all comments :) NOTE: IT MAY TAKE A LONG TIME FOR IT TO LEARN, So I recommend leaving it open in its own window in the back, don't use the actual turbo button! I made a function that makes it run even faster in game that you can toggle by pressing T. Over time, if it is learning the right behavior, the average time taken to reach the food should drop. The lowest I have ever had it go (before I had to close the window) was about 15 seconds average, and still decreasing. This, however, took many hours. So if you really can't wait and you don't care if you miss seeing it slowly learn where to go, maybe leave it open while you are gone at school, or busy reading, or just over night while you sleep, and wake up and see the change. ;D VVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV Label Key: Current Attempt Time: The time the AICell is taking to get the food. Food Eaten: Count of food eaten by AICell Average time taken to eat food: A real time average that includes the current time at its current state assuming the AICell got the food at that moment. Total time: the total time the program has been running. Time Taken to eat food on the last success: Well it is just that... Control time: The current attempt time for the control cell. Control Food Count: The total amount of food consumed by the control. Control Average: The real time average it has taken for the control to get a food including the current attempt time assuming it got the food at that moment.