Skip to content
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

Get rid of specifying sources in allocation by edges #1953

Open
SouthEndMusic opened this issue Nov 26, 2024 · 1 comment · May be fixed by #1956
Open

Get rid of specifying sources in allocation by edges #1953

SouthEndMusic opened this issue Nov 26, 2024 · 1 comment · May be fixed by #1956
Labels
allocation Allocation layer breaking A change that breaks existing models

Comments

@SouthEndMusic
Copy link
Collaborator

Currently, if you want to specify a source for the allocation algorithm you have to indicate this in the Edge table, were you have to specify the subnetwork ID of the subnetwork in which the edge should be a source. This is not intuitive, as it might seem like you have to assign each edge to a subnetwork in much the same way you have to do that for nodes. It is not clear from the table structure itself that this has anything to do with sources.

I can find #932 with a suggestion to remove this way of indicating sources, but then it was decided to keep it because it would be helpful in specifying an order of preference over sources. That is actually what this issue comes out of; discussions on how to specify source preference in the input (see also #1505).

As discussed with @visr, the nicest way to indicate a source order is to have a new table, say SourceOrder, with columns subnetwork_id (int32) and node_id (int32), where per subnetwork the source order is given by the order in this table.

Then what's needed for this issue is the same as in #932, namely automatically infer sources in subnetworks. I.e.: if a LevelBounary or FlowBoundary node is part of a subnetwork, it is a source for that subnetwork, and each connected edge is treated as a source in the allocation algorithm. Edges being sources in the allocation algorithm should be something internal, not exposed to the modeller.

Note that this would involve a breaking change, as the subnetwork_id column wil be removed from the Node table.

@SouthEndMusic SouthEndMusic added allocation Allocation layer breaking A change that breaks existing models labels Nov 26, 2024
@github-project-automation github-project-automation bot moved this to To do in Ribasim Nov 26, 2024
@SouthEndMusic
Copy link
Collaborator Author

SouthEndMusic commented Nov 26, 2024

As an alternative to removing the subnetwork_id column from the Node table now, we could give it a deprecation warning when data is added to it, and remove it in a new major release.

@SouthEndMusic SouthEndMusic moved this from To do to 🏗 In progress in Ribasim Nov 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allocation Allocation layer breaking A change that breaks existing models
Projects
Status: 🏗 In progress
Development

Successfully merging a pull request may close this issue.

1 participant