|
Algorithm 1 Water Distribution System Optimization |
-
1:
Globals: , ,
-
2:
Load Data: ,
-
3:
Train Model and Evaluate:
-
4:
train_test_split(X, y, 0.2, 42)
-
5:
LinearRegression().fit(X_train, y_train)
-
6:
mean_absolute_error(y_test, )
-
7:
Optimization Process:
-
8:
pd.read_excel(’city_.xlsx’, names=[’node_id’, ’base_demand’, ’lps_demand’])
-
9:
for in
do
-
10:
,
-
11:
-
12:
if then
-
13:
print(“Successful optimization at node”, )
-
14:
-
15:
else
-
16:
print(“Optimization was not achieved in the node”, )
-
17:
end if
-
18:
-
19:
end for
|