I was not really happy with the performance of the first version of this program, so I looked around to make some improvements. The program took quite a while to run – over an hour for the first iteration. I was particularly annoyed by how I was storing the states. It would be quite a bit simpler to put the states into some list, and then refer to them by index or subscript. Remember that each state is represented by three numbers, showing the positions of each of our three arm motors – M1, M2, and M3. Let’s create an index to those states and replace that with a single number which we will refer to as stat (state minus the "e"). Then any variable that has stat rather than state uses the index and not ...
Version 2 – indexed states and actions
Get Artificial Intelligence for Robotics now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.