Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Network intervention simulation #345

Merged
merged 35 commits into from
Jan 27, 2023
Merged

Conversation

benoitblanc
Copy link
Collaborator

This pull request aims to add some features for the user to simulate network incidents :

  • network leakage
  • network interruption
  • network pollution

@bogdanvaduva
Copy link

You've used my proposal for adding network path capabilities to QWAT. The pipe_reference table should be explained a little bit more, it needed geometry because otherwise we couldn't have a real path shown. The pipe_reference table must be kept up to date because otherwise the path could be different from what the user sees.

@sjib
Copy link

sjib commented Oct 28, 2021

@benoitblanc Does this has a connection with what kind of network simulation software? Does this comply with the SIA405 water datamodel (Hydraulischer_Strang, hydraulischer_Knoten)?

@ponceta ponceta added this to the 1.3.7 milestone Dec 7, 2021
@m-kuhn m-kuhn assigned m-kuhn and 3nids and unassigned m-kuhn Dec 7, 2021
Copy link
Member

@3nids 3nids left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
I have been asked to perform a review.
It's really nice to see these features getting into the code base, they have been long awaited!

It's a bit hard to jump quickly into the code and I think we miss a few things generally:

  • a couple of lines explaining how this work, directly in the code: the roles of the tables and functions
  • documenting each SQL object a bit more in detail, it would help a lot understanding the code
  • tests are missing: I believe you had some data to play with, this should be added to the code base for such functionality
  • for now there are only deltas, the code should also be added in the source (but I guess you plan to do it only at the end)

Some questions:

  • wouldn't there be a way to avoid code duplication for the routing method? maybe by creating lower level functions which could be reused?
  • it's not clear to me the reason of vw_pipe_reference, is it because the table behind might not be up to date?
  • instead of using tables and functions, why not using materialised views?

@3nids
Copy link
Member

3nids commented Dec 10, 2021

does it fix #171 ?

@ponceta
Copy link
Member

ponceta commented Nov 11, 2022

Since there are only deltas, the network simulation are not initialized when initializing from scratch :

https://github.com/qwat/qwat-data-model/blob/master/init_qwat.sh

Please add the necessary files (same content as the deltas) and code adaptation to make it work for new users of TEKSI water module.

@benoitblanc
Copy link
Collaborator Author

@ponceta I have added code from deltas to data-model and init_qwat.sh

@ponceta
Copy link
Member

ponceta commented Nov 18, 2022

Something doesn't please the CI. Is it possible that the delta initialize the functions but does not run these and therefore does not create the tables or vice versa?

Check...DIFFERENCES FOUND
tables

  • ('qwat_network', 'network')
    columns
  • ('qwat_network', 'network', 'cost', None, 'YES', 'double precision', None, '5
  • ('qwat_network', 'network', 'geometry', None, 'YES', 'USER-DEFINED', None, No
  • ('qwat_network', 'network', 'id', None, 'YES', 'integer', None, '32', '2', No
  • ('qwat_network', 'network', 'network_id', "nextval('qwat_network.network_netw
  • ('qwat_network', 'network', 'reverse_cost', None, 'YES', 'double precision',
  • ('qwat_network', 'network', 'source', None, 'YES', 'integer', None, '32', '2'
  • ('qwat_network', 'network', 'target', None, 'YES', 'integer', None, '32', '2'
    constraints
  • ('pipe_reference_fk_pipe_fkey', 'qwat_network.pipe_reference.fk_pipe', 'qwat_
    views
    sequences
  • ('network_network_id_seq', 'qwat_network')

@ponceta
Copy link
Member

ponceta commented Dec 19, 2022

@benoitblanc could you rename the deltas to 1.4.0_XXX

@benoitblanc benoitblanc force-pushed the network_intervention_simulation branch from c9c6078 to 5f7a1f7 Compare January 13, 2023 15:02
@benoitblanc
Copy link
Collaborator Author

@ponceta I have renamed deltas to match v 1.4.0

@ponceta

This comment was marked as resolved.

@ponceta
Copy link
Member

ponceta commented Jan 23, 2023

@benoitblanc if you're ready to merge, please remove the [WIP] Tag in the name of your pull request.

@benoitblanc benoitblanc changed the title [WIP] Network intervention simulation Network intervention simulation Jan 23, 2023
@ponceta ponceta merged commit 9d3ad65 into master Jan 27, 2023
@ponceta ponceta deleted the network_intervention_simulation branch January 27, 2023 09:16
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add network routing functions
7 participants