Open
Conversation
alxsrobert requested changes Aug 7, 2025
Collaborator
alxsrobert left a comment
There was a problem hiding this comment.
I just suggested a couple of minor edits, otherwise it all looks good to me.
| - The models' C++ code is in two levels that underlie the R source code - the C++ source code and the C++ headers. This is to make the header code (the model ODEs and helper functions) shareable so that they can be re-used in other Rcpp packages and [this is explored more in this blog post.](https://epiverse-trace.github.io/posts/share-cpp/) | ||
| | ||
| - _epidemics_ defines C++ namespaces in the package headers to more clearly indicate where certain functionalities sit. All model structures are in the namespace `epidemics`, while the namespaces `vaccination`, `intervention`, and `time_dependence` contain C++ code to handle these composable elements (such as calculating the effect of cumulative interventions). The namespace `odetools` defines the initial state type, which is an `Eigen::MatrixXd`. | ||
| - A common method for defining and solving ODEs in R is to write the ODE system in R and pass it to solvers such as `deSolve::lsoda()` from the [_deSolve_ package](https://cran.r-project.org/package=deSolve). We have adapted this approach to use the _odin_. The advantage of _odin_ is that it [generates systems of ordinary differential equations (ODE) and integrate them, using a domain specific language (DSL). The DSL uses R's syntax, but compiles to C in order to efficiently solve the system](https://cran.r-project.org/web/packages/odin/index.html) using deSolve. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - A common method for defining and solving ODEs in R is to write the ODE system in R and pass it to solvers such as `deSolve::lsoda()` from the [_deSolve_ package](https://cran.r-project.org/package=deSolve). We have adapted this approach to use the _odin_. The advantage of _odin_ is that it [generates systems of ordinary differential equations (ODE) and integrate them, using a domain specific language (DSL). The DSL uses R's syntax, but compiles to C in order to efficiently solve the system](https://cran.r-project.org/web/packages/odin/index.html) using deSolve. | |
| - A common method for defining and solving ODEs in R is to write the ODE system in R and pass it to solvers such as `deSolve::lsoda()` from the [_deSolve_ package](https://cran.r-project.org/package=deSolve). We have adapted this approach to use the R package [_odin_](https://cran.r-project.org/web/packages/odin/index.html). The advantage of _odin_ is that it generates systems of ordinary differential equations (ODE) and integrate them, using a domain specific language (DSL). The DSL uses R's syntax, but compiles to C in order to efficiently solve the system using deSolve. |
| - Interventions may be of the `<contacts_intervention>` or `<rate_intervention>` class, which inherit from the abstract super-class `<intervention>`. This inheritance structure was chosen to maintain coherence between the intervention types, and to keep the option open of unifying these classes into a single concrete type in the future. | ||
| | ||
| - All composable elements except the `population` are optional. Model functions internally generate dummy values for the other composable elements allowed for each model, as these are required for the C++ code. | ||
| - All composable elements except the `population` are optional. Model functions internally generate dummy values for the other composable elements allowed for each model. |
Collaborator
There was a problem hiding this comment.
Suggested change
| - All composable elements except the `population` are optional. Model functions internally generate dummy values for the other composable elements allowed for each model. | |
| - All composable elements except `population` are optional. Model functions internally generate dummy values for the other composable elements allowed for each model. |
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.
This PR updates the design principles vignette to reflect the odin changes.
It also standardizes the formatting of package names as italics when referenced in documentation and givnettes.