-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Arguments:
-
gmap_key(str): key for google maps API for downloading the elevation values for the nodes
-
world_cities(pd.DataFrame): pandas DataFrame from the free csv file in: https://simplemaps.com/data/world-cities , it is used for extracting the coordinates of the cities.
-
min_population(int): the minimal population for the cities to be used for the generation of the Virtual Water Network
-
distance(int): is the distance of the nodes from the center point that are going to be kept for constructing the graph
-
demand_values(dict): a dictionnary where the keys are the type of soil occupation, and values are peak hour demands in m3/h/hectar
-
roughness_values(list): is a list of roughness values that will be assigned randomly to pipes
-
reservoir_heads(list): is a list of heads that will be assigned randomly to the reservoirs
-
pipe_diameters(list): list of possible diameters of pipes in the networks (in m)
rd = RandomWaterDistributionNetwork(gmap_key, world_cities, min_population, distance, demand_values, roughness_values, reservoir_heads, pipes_diameters, sf)
Returns a random networkx graph using the osmnx module
G = rd.generate_random_graph()
G = ox.project_graph(G)
Merges the clustered nodes that are less than tol apart and deletes self loops and parallel edges from the input graph. partial(bool): True if used for cleaning the main network subgraph.
G = rd.clean_graph(G, tol=15)
rd.add_node_demands(G)
subG = rd.main_network(G)
Cleans the input graph G from double lines, in these steps:
1- small cycles where the nodes are aligned 2- parallel edges and self loops 3- small cycles that are inside bigger cycles
subG = rd.clean_cycles(subG)
subG = rd.add_reservoirs(subG)
subG = rd.connect_reservoirs(G, subG)
F = nx.compose(G, subG)
rd.add_edge_roughness(F)
wn = rd.create_wn(F, subG)
wn = rd.pipe_sizing(wn)
wn = rd.add_valves(wn, subG, n_sectors=8)
{'Number of nodes': n_nodes, 'Number of edges': n_edges, 'Number of reservoirs':self.number_of_reservoirs,
'Velocity' : self.velocity, 'Pressure' : self.pressure, 'Lengths': lengths, 'Diameters': pipes_diameters,
'Degrees': degrees, 'Main valves': self.main_valves, 'Valves per sector': self.valves_per_sect}
- Number of nodes, Number of edges, Number of reservoirs: (int).
- Velocity, Pressure, Lengths, Diameters, Degrees: (list) containing that characteristic for all the elements of the network.
- Main valves: are the valves on the main network (the control valves)
- Valves per sector: the rest of the valves distributed per sector, the valve on pipe number 190 is in sector one is named S1_190.
stats = rd.stats(wn)