Major refactoring#2
Open
fdch wants to merge 20 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I've decided to do a major restructuring of the code, so that we avoid code duplication and are able to make some improvements. The external is meant to be backwards compatible with the previous version (ie, one can still use [boids2d] or [boids3d] with the same interface --hopefully i did not miss anything). The main object now, however, is [boids], which can be configured to 2, 3 or other dimensions. Neighbors can be dynamically set to be any number of neighbors (not just 0-4, as before), and I'm planning to include more additions like different edge behaviors.
I've split the codebase with the object, the parameters (boids-params) and a vector utility (vec) that is meant to simplify things. It ended up, naturally, increasing the complexity as we now have more files that do different things. Anyhow, I think it is more practical as it is easier to debug. No tests though, unfortunately, as I'm not really sure how tests would look like on an external.
Next steps will be to test the CI pipeline and publish to deken. However, before this, I wanted to put this out there and maybe a generous soul can have a look at the code and maybe test it if they have time. I've added and modified examples, cleaned up help files, and I've also added a few nice abstractions to be shipped with the lib.
I've only tested on debian for now, but plan to work on the CI soon.