You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In some of the matsim-melbourne network code (and related work that uses this ), there are parameter settings referring to data paths and other aspects for specific regions that could change in the future. If that occurred, or new regions were wanting to be modelled, the code would have to be edited.
It could be useful to extract these city-specific conguration parameters to external configuration files. This would have several benefits:
reduce need to rewrite code
reduce code length and complexity
could re-use single source of city configuration parameters across multiple files or projects
The following excerpt of the NetworkGenerate.R code contains around 100 lines devoted to city-specific parameters in the makeNetwork() function:
In some of the matsim-melbourne network code (and related work that uses this ), there are parameter settings referring to data paths and other aspects for specific regions that could change in the future. If that occurred, or new regions were wanting to be modelled, the code would have to be edited.
It could be useful to extract these city-specific conguration parameters to external configuration files. This would have several benefits:
The following excerpt of the
NetworkGenerate.R
code contains around 100 lines devoted to city-specific parameters in themakeNetwork()
function:network/NetworkGenerator.R
Lines 2 to 111 in 6711eda
I would propose that these lines could be removed, and instead of asking for the following arguments
instead, the function could work as follows:
where region is the path to a region configuration file, like `./regions/Bendigo.yml'.
Then, the parameters in this file could be loaded in
.R
or.sh
scripts by calling a sub-function, accepting command line argumentsI've made a demonstration of how these changes could work on a branch of a related project that uses this code, demonstrating the loading of city parameters from configuration files into R global environment or Shell environments.
https://github.com/jibeproject/networkMelbourne/compare/refactor-configuration
This contains an example region files using the current parameters from the code for Bendigo.
If of use, I could make a similar branch here, and you could see if these changes would be useful!
The text was updated successfully, but these errors were encountered: