AI mouse in a maze

The Not AI mouse in a maze project was very successful at getting the virtual mouse to navigate a randomly generated maze using a fairly simple set of rules. It could solve about 99% of them. However, there were some maze designs that it got stuck on and others where it was very slow to find the correct path. So, finally it was time to see how well my mouse could do at solving the maze using AI (the NEAT algorithm). A brief description of the code, how it works, and a video of the mouse is on Github ...

October 14, 2022 · 2 min

Not AI mouse in a maze

Building on the Not AI Car project, I started out trying to get the car to drive across a maze. I changed the car to a mouse, as the lines detecting the edge looked like whiskers. As I’d done with the track, the first thing to code was an algorithm to generate a random maze each time. The backtracking algorithm was well suited to this application and there were many implementations to choose from (see the code for links), so I just need to make a few modifications. ...

October 4, 2022 · 3 min

Not AI car

I’d been looking for a project to work on to learn Python and AI when I came across a video about Neural network racing cars around a track. Initially, I thought creating something like that would be too hard for a first project in Python, so I started work on it. Many of the comments on that video asked whether a trained car would do just as well on another track, so I decided to create the track dynamically with an algorithm that would produce a different track each time. Then, I added a car and calculated distances to the edge of the track and thought I should just check that it could drive by providing instructions for steering and acceleration. As I’d calculated the distances to the edge of the track, I divided those by the respective angles (positive and negative) and added them up to decide which way to steer and by how much. The distance straight ahead was ignored as it wouldn’t affect steering and would resulting in dividing by zero. The acceleration instruction was based on the distance straight ahead. As with a physical car, limits were place on the inputs (rate of change of steering and acceleration/deceleration) and the capabilities of the car (maximum steering angle and speed). ...

October 3, 2022 · 2 min