jinzhuyu / ICOSSAR2021-NetworkResilienceAssessment

Code for the ICOSSAR 2021 paper titled Comparing Topology-based and Flow-based Resilience Assessment of Interdependent Infrastructure Networks
9 stars 1 forks source link

about the code #1

Open zzxx59342506 opened 1 year ago

zzxx59342506 commented 1 year ago

I am learning to use networkx to study interdependent networks. I don't know how to build a flow-based model. Luckily, I found your code on GitHub. So I try to run and interpret your code. There are some confusions in the process of running the code. I built a python 3.6 environment in anaconda, and the following python libraries are installed. pip install mip pip install julia pip install numpy pip install pandas pip install matplotlib pip install networkx

After I ran main.py, it reports the following error: ... Cbc0010I After 16385 nodes, 321 on tree, -13.380952 best solution, best possible -13.523809 (297.91 seconds) Cbc0010I After 16403 nodes, 321 on tree, -13.380952 best solution, best possible -13.523809 (298.64 seconds) Cbc0010I After 16414 nodes, 320 on tree, -13.380952 best solution, best possible -13.523809 (299.44 seconds) Cbc0020I Exiting on maximum time Cbc0005I Partial search - best objective -13.380952 (best possible -13.523809), took 281261 iterations and 16427 nodes (300.03 seconds) Cbc0032I Strong branching done 25062 times (270980 iterations), fathomed 2493 nodes and fixed 2206 variables Cbc0035I Maximum depth 81, 150724 variables fixed on reduced cost Total time (CPU seconds): 300.65 (Wallclock seconds): 300.65

Infeasible or unbounded problem Traceback (most recent call last): File "main.py", line 910, in main() File "main.py", line 907, in main is_save=is_save, model_type =model_type) File "main.py", line 845, in plot_resil redun_rate=redun_rate, n_repeat_random=n_repeat_random, model_type= model_type) File "main.py", line 796, in get_resil_df model_type=model_type) File "main.py", line 668, in get_solution self.optimize_restore(attack_types=attack_types, attack_portions=attack_portions, redun_rate=redun_rate, model_type=model_type) TypeError: 'NoneType' object is not iterable

I don't know how to solve this problem.

jinzhuyu commented 1 year ago

Can you install Gurobi and try again?Also, I would suggest running the functions in main.py step by step to identify where the bugs occur.JZSent from my HONOR phone-------- Original message --------From: zzxx59342506 @.>Date: Fri, Nov 4, 2022, 13:53To: jinzhuyu/ICOSSAR2021 @.>Cc: Subscribed @.***>Subject: [jinzhuyu/ICOSSAR2021] about the code (Issue #1) I am learning to use networkx to study interdependent networks. I don't know how to build a flow-based model. Luckily, I found your code on GitHub. So I try to run and interpret your code. There are some confusions in the process of running the code. I built a python 3.6 environment in anaconda, and the following python libraries are installed. pip install mip pip install julia pip install numpy pip install pandas pip install matplotlib pip install networkx After I ran main.py, it reports the following error: ... Cbc0010I After 16385 nodes, 321 on tree, -13.380952 best solution, best possible -13.523809 (297.91 seconds) Cbc0010I After 16403 nodes, 321 on tree, -13.380952 best solution, best possible -13.523809 (298.64 seconds) Cbc0010I After 16414 nodes, 320 on tree, -13.380952 best solution, best possible -13.523809 (299.44 seconds) Cbc0020I Exiting on maximum time Cbc0005I Partial search - best objective -13.380952 (best possible -13.523809), took 281261 iterations and 16427 nodes (300.03 seconds) Cbc0032I Strong branching done 25062 times (270980 iterations), fathomed 2493 nodes and fixed 2206 variables Cbc0035I Maximum depth 81, 150724 variables fixed on reduced cost Total time (CPU seconds): 300.65 (Wallclock seconds): 300.65 Infeasible or unbounded problem Traceback (most recent call last): File "main.py", line 910, in main() File "main.py", line 907, in main is_save=is_save, model_type =model_type) File "main.py", line 845, in plot_resil redun_rate=redun_rate, n_repeat_random=n_repeat_random, model_type= model_type) File "main.py", line 796, in get_resil_df model_type=model_type) File "main.py", line 668, in get_solution self.optimize_restore(attack_types=attack_types, attack_portions=attack_portions, redun_rate=redun_rate, model_type=model_type) TypeError: 'NoneType' object is not iterable I don't know how to solve this problem.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

zzxx59342506 commented 1 year ago

I installed Gurobi and tried again. It still outputs the same result. I ran the functions in main.py step by step and noticed that it occurred after running

s.plot_resil(attack_types=attack_types, attack_portions=attack_portions, redun_rate=REDUN_RATE,n_repeat_random=N_REPEAT, is_save=is_save, model_type =model_type)

and I also noticed that the warning Infeasible or unbounded problem come from the function named optimize_restore, but I have no idea how to solve it.

jinzhuyu commented 1 year ago

Can you run optimizer_restore line by line?Sent from my HONOR phone-------- Original message --------From: zzxx59342506 @.>Date: Sat, Nov 5, 2022, 05:18To: jinzhuyu/ICOSSAR2021 @.>Cc: Jin-Zhu Yu @.>, Comment @.>Subject: Re: [jinzhuyu/ICOSSAR2021] about the code (Issue #1) I installed Gurobi and tried again. It still outputs the same result. I ran the functions in main.py step by step and noticed that it occurred after running 's.plot_resil(attack_types=attack_types, attack_portions=attack_portions, redun_rate=REDUN_RATE,n_repeat_random=N_REPEAT, is_save=is_save, model_type =model_type)' and I also noticed that the warning 'Infeasible or unbounded problem' come from the function named 'optimize_restore', but I have no idea how to solve it.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>