InstituteforDiseaseModeling / covasim

COVID-19 Agent-based Simulator (Covasim): a model for exploring coronavirus dynamics and interventions
https://covasim.org
MIT License
255 stars 224 forks source link

Apply Decorator design pattern in covasim #363

Closed zklou closed 3 years ago

zklou commented 3 years ago

Regard decorator design: I introduced a new concept into the file: we use location to simulate how covid will goes like. in the "location" It included temperature, most popular covid type, government policy, and so on. So this will be helpful when users trying to simulate a specific area, also we can use it as a tool for reproducing history or seeking for the future of covid.

By applying the decorator design pattern we can build the new model, during the period I added some other factors, such as access to the location to get temperature, main types of pneumonia, etc., to make the model more accurate and easy to operate. Users only need to open the program and enter the location information. See the future direction of covid and chose model easier, since I sorted those parameters into few groups and create few functions to respond call of model's name. For example, if we want to restore the history of the spread of covid or study pneumonia in the future Expansion trends in different regions, even find out other types of covid's expansion by entering different parameters.

cliffckerr commented 3 years ago

Thanks for the PR -- we're not considering major architectural changes currently, but we appreciate the contribution to open-source software!