把所有 list(set(...)) 改为 sorted(set(...)),确保去重后顺序稳定
This commit is contained in:
@@ -32,7 +32,7 @@ def read_inf_inp(wn):
|
||||
pipe = wn.get_link(p)
|
||||
if pipe.initial_status == 0: # 状态为'Closed'
|
||||
n_pipe.append(p)
|
||||
candidate_pipe_init = list(set(all_pipe) - set(n_pipe))
|
||||
candidate_pipe_init = sorted(set(all_pipe) - set(n_pipe))
|
||||
pipe_start_node = wn.query_link_attribute(
|
||||
"start_node_name", link_type=wntr.network.model.Pipe
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user