-
Notifications
You must be signed in to change notification settings - Fork 0
Refactoring Simulation concept #149
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the simulation concept by extracting the Simulation struct and related logic into a dedicated module to improve code organization and component isolation.
- Moves the Simulation struct and related functionality from lib.rs to a new simulation/mod.rs module
- Introduces new internal structs (Scenario, Solution, Features, Algorithm) to better organize simulation components
- Updates the public API to use a compute() method that returns an iterator instead of scout() that returns a Vec
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
File | Description |
---|---|
crates/revrt/src/simulation/mod.rs | New module containing the refactored Simulation struct with improved component separation |
crates/revrt/src/lib.rs | Removes Simulation implementation and imports it from the new simulation module |
crates/revrt/src/cost.rs | Adds Clone trait to CostFunction to support the refactored design |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
495094a
to
97495dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As long as you're going through the effort of refactoring and re-organizing, do we think that "Simulation" is the right term? We're not really simulating anything, right? It's more like a "computation" or something along those lines.
Nitpicky but this is the kind of PR where we can think about those things IMO
I'm not super happy with Whatever name it is, it's state is defined by the composition of |
0f7c11e
to
e4116a2
Compare
Preparing to route async, that will iterate on the solutions found.
In preparation to refact away from the legacy dataset.
e4116a2
to
c97de1a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (3)
crates/revrt/src/lib.rs:171
- The method
scout
does not exist onRouting
. Should usecompute(...).collect()
to match the new API.
let solutions = simulation.scout(&start, end);
crates/revrt/src/lib.rs:171
- The method
scout
does not exist onRouting
. Should usecompute(...).collect()
to match the new API.
let solutions = simulation.scout(&start, end);
crates/revrt/src/lib.rs:233
- The method
scout
does not exist onRouting
. Should usecompute(...).collect()
to match the new API.
let solutions = simulation.scout(&start, end);
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
* Defining high level signature of the new Simulation concept * refact: Moving Simulation into its own module * refact: Retruning an iterator Preparing to route async, that will iterate on the solutions found. * refact: Using dataset as a scenario * refact: Hiding dataset behind scenario In preparation to refact away from the legacy dataset. * feat: Adding CostFunction to Scenario * clean: * Back to parallel iteration on start/end combination * refact: Renaming Simulation struct to Routing * Renaming Simmulation struct to Routing * feat: (input) Features * cfg: Adding dependencies required by async Features * feat: Scenario with Features * Remminder on new planned structs * clean: * fix: Routing offers compute() instead of scout() * typo: * style:
Refactoring the full crate concept model to help isolating components thus isolating major refactoring in smaller parts.