Open-Source-Spatial-Clean-Cooking-Tool / OnStove

This repository contain the general code for the Open Source Spatial Clean Cooking Tool OnStove
MIT License
7 stars 8 forks source link

Allow more than two technologies to be chosen in `maximum_net_benefit` #310

Open camiloramirezgo opened 1 year ago

camiloramirezgo commented 1 year ago

Currently, the maximum_net_benefit method selects the technologies with the maximum net benefit in each cell. If the best technology can't supply all of the population in the cell (this can be the case for Electricity and Biogas) it duplicates the cell and selects the second-best technology for the rest of the population, adjusting the households and population numbers of the cell.

When adding the MiniGrids technology, there can be a case (technically at least) where we would have some population being supplied by Electricity, some more by MiniGrids and the rest with Biogas. Thus, we need to check if after the second technology there is still population without access and look for a third technology. I suggest, however, that we refactor the method to make it general for any number of possible technologies, so we avoid having this issue again in the future.

camiloramirezgo commented 1 year ago

This can be done by implementing a while loop that checks the sum of households supplied against the total households in each cell, and tracks that until all household get supplied.