I am re-approaching this project from the bottom up. The ANNE engine was designed from the top-down, and it worked fine. But there was always a little mess about the learning. Also, the network was simply thrown together semi-randomly with hope for the best.
This is phase one of the new design. I am currently calling this project i_Constants (for "Intelligent Constants"). I am certainly open to better names for it. The "Intelligent" part is pretty obvious; they are supposed to be intelligent after all. But the "Constant" part might be a little confusing.
Variables are intended to be altered within the code by the program, or by the user. Variables fit nicely into for-next loops and coordinates, and so on. Constants on the other hand are to be set and will not change as the code executes. Constants are intended for fixed values that should not change, like Pi, the speed of light, or perhaps the border of a zone. i_Constants are more like constants than variables. While it is true that these i_Constants will change, they should also eventually settle into a "perfect" state from which they will not change. From that point on, they act as constants.
It would also be ill-advised to use i_Constants in place of variables. For example, a coder cannot set an i_Constant to a particular value (i.e. a=b+c*d or for i=1 to 10). Instead, the i_Constant is given a range in which it is allowed to select its own value from. This range represents the parameters in which the i_Constant can operate within. It can never go below the lowest parameter, or above the highest parameter.
Given the above arguments, the term Constant seemed to be more appropriate than the term Variable. As stated earlier, though, I am open to suggestions. Think of i_Constants as constants that are not set by the coder so much as they are constants that are best determined by a trial-and-error evolutionary process.
Here's the demo. It is based off of the old ANNE demo in which the AI must navigate through a randomized obstacle course and arrive at a "best" destination. Like the previous ANNE demo, the starting point is in the lower left corner, and the "best" destination is in the upper right corner.
The AI Entity gains points as it gets closer to the upper right corner. The AI loses points for colliding with an obstacle and gains points for each move that there is no collision.
The AI is a series of 20 paired "genes" - each pair determines a move and a turn. Basically, in 20 moves, the AI should be able to reach it's "best" destination once the combination of genes is set to a pattern that can navigate the obstacle course. Once your AI reaches MegaEpoch 400 (40k Epochs!!) or so, it should be well trained to reach the upper right corner while avoiding obstacles.
Each Cycle allows the AI to test a given patter over and over. Since this is a static course, there is no real need to re-test a pattern multiple times - only once (in this case, I chose twice to amplify the score). There needs to be at least two cycles in each epoch since a score cannot be obtained until at least one cycle has passed and the score is stored on the second cycle.
Each Epoch allows the i_Constants to "mutate" or select new values that will be used. The number of i_Constants that are "mutated" is determined by how many MegaEpochs have passed. The more MegaEpochs that have passed, the fewer mutations.
The program runs extremely fast in order to execute as many Epochs in a short amount of time as possible. In order to slow down the frame rate, press the space key. Press the space key again to speed things up.
Edit: Oh, this might require IanM's Matrix Utilities. I don't think so, but something might have slipped in.
Open MMORPG: It's your game!