Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds configuration-based parameter parsing to SimPathsMultiRun, allowing model parameters to be dynamically updated from a config file without rebuilding the model.
- Introduces a new static map (parameterArgs) to store parameter configurations.
- Updates the YAML config parser to extract "parameter_args" and calls an overloaded updateParameters method.
- Alters the Parameters class by removing the final modifier from some fields to allow dynamic updates.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/main/java/simpaths/experiment/SimPathsMultiRun.java | Added support for reading and updating parameter arguments using reflection. |
| src/main/java/simpaths/data/Parameters.java | Modified constant fields to be mutable to support dynamic parameter updates. |
Comments suppressed due to low confidence (2)
src/main/java/simpaths/experiment/SimPathsMultiRun.java:382
- [nitpick] Consider renaming the method parameter 'parameter_args' to 'parameterArgs' to maintain consistency with the field naming and common Java conventions.
public static void updateParameters(Map<String, Object> parameter_args) {
src/main/java/simpaths/data/Parameters.java:266
- [nitpick] Since the final modifier was removed from fields like MIN_START_YEAR, MAX_START_YEAR, and BASE_PRICE_YEAR to allow dynamic updates, consider renaming them using camelCase (e.g., minStartYear) to clarify that these values are mutable.
private static int MIN_START_YEAR = 2011; //Minimum allowed starting point. Should correspond to the oldest initial population.
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.
What
SimPathsMultiRunwhich reads parameter configs from config fileWhy