-
Notifications
You must be signed in to change notification settings - Fork 16
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
1133 Change member functions in Model class from public to private in IDE model #1166
base: main
Are you sure you want to change the base?
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.
Nice PR, I guess this really prevents the model functions from being misused. :) I just have a few comments. Please also tick the boxes of the checks by author.
@@ -61,6 +61,67 @@ class Model | |||
CustomIndexArray<ScalarType, AgeGroup> deaths, size_t num_agegroups, |
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.
Just a side note: Can you remove the second #include here? And what is the header cstddef needed for?
* @brief Checks constraints on model parameters and initial data. | ||
* @return Returns true if one (or more) constraint(s) are not satisfied, otherwise false. | ||
*/ | ||
bool check_constraints(ScalarType dt) const |
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.
Can we maybe move the implementation of the function in the cpp file? This got a little long. If you want to keep it in place, we should include the logging.h file.
@@ -61,6 +61,67 @@ class Model | |||
CustomIndexArray<ScalarType, AgeGroup> deaths, size_t num_agegroups, | |||
CustomIndexArray<ScalarType, AgeGroup> total_confirmed_cases = CustomIndexArray<ScalarType, AgeGroup>()); |
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.
We have a typo in lines 54+55: containg instead of containing
* | ||
* @return Index representing the initialization method. | ||
*/ | ||
int get_initialization_method_compartments() |
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.
Can you add the const keyword here?
CustomIndexArray<ScalarType, AgeGroup> | ||
m_total_confirmed_cases; ///< CustomIndexArray that contains the total number of confirmed cases at time t0 for every AgeGroup. | ||
|
||
private: | ||
// ---- Functionality to calculate the sizes of the compartments for time t0. ---- | ||
/** | ||
* @brief Compute the compartment specified in idx_InfectionState at the current time -- only using historic flow |
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.
In line 224 there is also a typo: infoming instead of incoming.
@@ -406,6 +407,11 @@ class Model | |||
m_transitiondistributions_in_forceofinfection; ///< CustomIndexArray | |||
// of Type AgeGroup containing a Vector containing the weighted TransitionDistributions for all necessary time | |||
// points in the force of infection term. | |||
|
|||
// ---- Friend classes/functions. ---- | |||
friend class Simulation; |
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.
Maybe you can add some small comments why these friends are necessary.
// Attention: m_populations and m_transitions do not necessarily have the same number of time points due to the | ||
// initialization part. | ||
TimeSeries<ScalarType> | ||
m_transitions; ///< TimeSeries containing points of time and the corresponding number of transitions for every |
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.
Btw: Actually, m_ is only used for private variables. I dont know if you want to change this,
Changes and Information
Merge Request - Guideline Checklist
Please check our git workflow. Use the draft feature if the Pull Request is not yet ready to review.
Checks by code author
Checks by code reviewer(s)
Closes #1133