Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse knapsacks from file path #1

Merged
merged 12 commits into from
Oct 20, 2024
Merged

Parse knapsacks from file path #1

merged 12 commits into from
Oct 20, 2024

Conversation

NicMcPhee
Copy link
Member

@NicMcPhee NicMcPhee commented Oct 7, 2024

This parses knapsack problem specification files in the form used by https://github.com/JorikJooken/knapsackProblemInstances

Closes: #10

This outlines my basic idea for what this might look like for students.
This gets most of the parsing sorted for `Knapsack` and `Item`. The error handling is really complex, though, so I'm thinking that we want to switch this to using `anyhow` instead.
This basically copies over all the Clippy warnings from the `unhindered-ec` project, although I did remove the `use_debug` warning since that's probably a reasonable thing to use in experiments like this.

I also added `clippy.toml` with an `allowed-duplicate-crates` entry for the various `rand` crates since we pull in multiple versions in `unhindered-ec` (through no fault of our own).
This finishing up that parsing, after converting all the error handling to `anyhow` instead of explicit error types.

I also threw in various accessor methods for both `Item` and `Knapsack` so we can keep the fields encapsulated but still have access to them.
This is essentially what GitKraken created for me by default, although I added the Clippy check.
@NicMcPhee NicMcPhee added this pull request to the merge queue Oct 20, 2024
Merged via the queue into main with commit 1a4499d Oct 20, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parse a knapsack from a file path
1 participant