Ribasim
Ribasim copied to clipboard
Leave user data out of `allocation.arrow` for priorities for which the user does not have a demand
What
Currently the output file allocation.arrow contains rows for each user for each priority (existing anywhere in the model). This is unnecessary, since users often do not have a demand for all these priorities. Therefore we want in the output only data per user for priorities of which the user actually has a demand.
How
For uncoupled models this is simple: at initialization of the model create for each user a BitVector which states per priority whether that user possibly at some point in the simulation will have a demand of that priority, and use this when pushing data to the record.
For coupled models this might be more tricky, dependent on what the demand input for coupled users looks like.
EDIT 22-2-2024 Refinement session: for coupled models no additional work needed.
For refinement: who adds the user demand node and sets priority for allocation
Primod creates the user demand nodes in database.gpkg and sets a default priority. The priority can be adjusted manually if needed in the gpkg. Once this is set, the resolution will also work for coupled models.