Closed timothy-r closed 1 year ago
Hi @timothy-r, thanks for the code. It would be easier to evaluate this pull request if we had some documentation for it. For example, does it fix any bugs? Does it solve any usability issues? What were your goals? How does the code work? How did you make your design decisions? Does it make it easier for developers to maintain the code? Does it introduce any new risks?
This simulator was published for educational purposes, so any commentary you can provide, either in the source files or in a separate, new text file, would be helpful for those of us who want to learn from your experience.
Hi @davidrmiller to be honest I didn't mean to make a PR against your repo, I forked your repo & the PR was intended to be against my fork, somehow Github defaulted to yours.
Anyway, to explain what I was doing, firstly I saw your video presentation on YouTube and was impressed by how well it demonstrated natural selection and evolutionary adaptation. I then realised the code was in GitHub so I checked it out, compiled and ran it and that went well. Since I had that working I thought about experimenting to extend the code and see what I could do. Thus the code in this PR. All it actually does is start to use the google test library and add some unit tests, so no changes to actual functionality.
I saw bringing the codebase under test as the necessary first step in making changes, since it would otherwise be extremely hard to ensure that I'd not broken anything accidentally. What I'm now looking at is adding more structure and order to the software, it's clearly working, but it seems (to me at least) hard to make substantive changes easily and safely. These structural changes mean establishing the responsibilities of the classes, moving functionality where necessary to enforce these responsibilities, more data hiding, removing dependencies on global variables and implementing common software design patterns. Put simply re-architecting the current program in order to make it more extensible.
I'm seeing this as a personal project, partly as a challenge to myself to see how well I can do it. I am of course very willing to share the outcomes, if successful, though equally not assuming that you'd take whatever changes I make.
I'm a professional software developer and architect and not a scientist or mathematician, and whilst I understand the principles of natural selection I would not be able to have written the program that you have. I really like how you have the genetic information encoded as simple values and then use that data to build a neural net that itself implements the behaviour. I'm looking at this from the point of view of computer science and seeing how I can apply that to make the software more extensible.
Please feel free to delete this PR, if I have something more functional to share I can let you know later.
No worries about the accidental PR. It gave us a chance to see what another developer is working on. Your changes are interesting and could potentially make it easier to work with the code.
I should mention that I would be a bit reluctant to accept a PR on this repository if it depends on Google gtest.h. Not that I have anything against gtest.h, but one of the goals of this project has been to avoid adding more dependencies. So far, I have found that the test suite contributed by @venzen is adequate for testing modifications to the simulator, without depending on Google.
At the same time, I expect that many people will be intrigued by the direction you're going. I'll close this PR, but if you are so inclined, feel free to open an Issue on this repository as a way to announce your project and a way for the community to find you.
Ok, thanks for explaining your goals for the project. I don't have a specific favourite test library, Catch2 or Doctest would work as well a gtest.
Looks good