Skip to content

Enhancements to SimulationTester and Main Function with Config Flexibility #48

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

weihangzheng
Copy link
Collaborator

@weihangzheng weihangzheng commented Jan 21, 2024

Enhancements to SimulationTester and Main Function with Config Flexibility

Description

This pull request introduces several enhancements to the SimulationTester class and the main function used in the simulation framework. The key changes are as follows:

1. SimulationTester Class Enhancements:

  • Multiple Simulation Runs: Added functionality to run simulations multiple times and calculate an average convergence score. This is achieved through the new run_multiple_simulations method.
  • Config File Flexibility: Introduced an optional config_file parameter in both the __init__ method and run_simulation method of the SimulationTester class. This allows users to specify a json file for the simulation, enhancing flexibility and customization of the simulation runs.
  • Results Output: Updated the print_results method to not only print the simulation results to the console but also write them to a CSV file. This file is stored in a directory specified by config.simulation_dir.

2. Main Function Modification:

  • Dynamic Config Import: Modified the main function to support dynamic import of the BaselineConfig class based on an optional config_file parameter. This change allows the function to adapt to different configuration needs, improving the usability of the simulation framework for various scenarios.

These enhancements aim to increase the versatility and user-friendliness of the simulation framework, providing more options for configuration and output handling.

Additional Notes

  • Ensure that the directory structure and Python paths are correctly set up for these changes to function as intended.
  • The updates assume that baseline_run and other dependent functions/modules are compatible with these enhancements.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heads up here, this looks like its cloning the Config module that we already have in NEPIADA. This isn't ideal, since if we add a config parameter to that file, we would have to make changes here to keep things in sync. Instead I would recommend importing the Config module, and setting the values in a function here, and return a "Config" type module as the return parameter.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Thanoshan I used json here addressed like you mentioned on Discord

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.

3 participants