Closed Quantalabs closed 2 years ago
/claim
Thank you @Quantalabs for claiming this issue! 🎉
Please reference this issue when you submit your Pull Request and make sure you follow the contributing guidelines.
My proposal for this is we make comp
a submodule of a larger comp
module (yes this is a breaking change, but we already are planning to release v3, see #115) and create another submodule called sub
in comp
for submodules. The submodules will be like compartments, but can only be a percentage of the larger compartment. The model will look like the following (when exported into JSON):
{
"compartments": {
"S": {
"equation": "S-(B*S*I/p)"
},
"I": {
"equation": "I+(B*S*I/p)-(u*I)",
"compartments": {
"Asymptomatic": {
"percent": 10,
},
"Symptomatic": {
"percent": 90,
}
}
},
"R": {
"equation": "R+(u*I)"
}
},
"key": {
"S": 10000,
"B": 0.3,
"I": 100,
"R": 0,
"p": 10100,
"u": 0.2
}
}
I've decided to disregard the idea to have a sub-compartment, but instead add a method in the compartment classes called .addSub()
. The JSON structure will stay.
With 88cb0c23de2b27857715dcb741df8b49282cb571 we have the initial code for subcompartments.
Sub compartments are now officially implemented with f8e2399f2bd43bbe12334ff4b403487d9c47a632, which will be merged into master soon.
Is your feature request related to a problem? Please describe. Currently, sub-compartments in models are not supported. This prevents users from having more advanced models, perhaps a SIR model with an asymptomatic and symptomatic sub-compartments for the infected compartment, or even two sub-compartments for recorded and actual case data.
Describe the solution you'd like Adding a simple way to include sub-compartments in a model, which will allow users to include more complex models like the examples above.
Describe alternatives you've considered Users could instead create two separate compartments for each sub-compartment, however now if #83 is implemented, plotting will plot those as separate compartments, so in stacked charts, the plots will have an infected category, and then a symptomatic category, and asymptomatic category, all plotted separately.
Additional context This feature should most likely be implemented before #83, or otherwise the issue will be reopened once finished.