增加resilience

This commit is contained in:
Cricial 2025-02-12 15:23:55 +08:00
parent 0233f642e4
commit ebc8159bf8
20 changed files with 5628 additions and 29 deletions

View File

@ -143,6 +143,27 @@
</Attribute>
</value>
</entry>
<entry key="\output_result\resilience\anova.csv">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
<entry key="\output_result\resilience\anova_visualization.csv">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
<entry key="\output_result\resilience\experiment_result.csv">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
<entry key="\output_result\risk\count.csv">
<value>
<Attribute>

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="dataSourceStorageLocal" created-in="PY-242.23726.102">
<data-source name="iiabmdb@localhost" uuid="8145438e-516b-4005-a581-b91b5eedc759">
<database-info product="MySQL" version="8.0.36" jdbc-version="4.2" driver-name="MySQL Connector/J" driver-version="mysql-connector-j-8.2.0 (Revision: 06a1f724497fd81c6a659131fda822c9e5085b6c)" dbms="MYSQL" exact-version="8.0.36" exact-driver-version="8.2">
<extra-name-characters>#@</extra-name-characters>
<identifier-quote-string>`</identifier-quote-string>
</database-info>
<case-sensitivity plain-identifiers="lower" quoted-identifiers="lower" />
<secret-storage>master_key</secret-storage>
<user-name>iiabm_user</user-name>
<schema-mapping>
<introspection-scope>
<node kind="schema">
<name qname="@" />
<name qname="information_schema" />
</node>
</introspection-scope>
</schema-mapping>
</data-source>
</component>
</project>

12
.idea/dataSources.xml Normal file
View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="DataSourceManagerImpl" format="xml" multifile-model="true">
<data-source source="LOCAL" name="iiabmdb@localhost" uuid="8145438e-516b-4005-a581-b91b5eedc759">
<driver-ref>mysql.8</driver-ref>
<synchronize>true</synchronize>
<jdbc-driver>com.mysql.cj.jdbc.Driver</jdbc-driver>
<jdbc-url>jdbc:mysql://localhost:3306/iiabmdb</jdbc-url>
<working-dir>$ProjectFileDir$</working-dir>
</data-source>
</component>
</project>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,2 @@
#n:iiabmdb
!<md> [0, 0, null, null, -2147483648, -2147483648]

View File

@ -0,0 +1,2 @@
#n:information_schema
!<md> [0, 0, null, null, -2147483648, -2147483648]

View File

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/input_data/input_firm_data/Firm_amended.csv" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/input_data/input_firm_data/firm_amended.csv" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/output_result/resilience/anova_visualization.csv" charset="UTF-8" />
</component>
</project>

10
.idea/sqldialects.xml Normal file
View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="SqlDialectMappings">
<file url="file://$PROJECT_DIR$/SQL_analysis_experiment.sql" dialect="MySQL" />
<file url="file://$PROJECT_DIR$/SQL_analysis_risk.sql" dialect="MySQL" />
<file url="file://$PROJECT_DIR$/SQL_db_user_create.sql" dialect="MySQL" />
<file url="file://$PROJECT_DIR$/SQL_export_high_risk_setting.sql" dialect="MySQL" />
<file url="file://$PROJECT_DIR$/SQL_migrate_db.sql" dialect="MySQL" />
</component>
</project>

View File

@ -1,4 +1,4 @@
select distinct experiment.idx_scenario,
select distinct experiment.idx_scenario,
n_max_trial, prf_size, prf_conn, cap_limit_prob_type, cap_limit_level, diff_new_conn, remove_t, netw_prf_n,
mean_count_firm_prod, mean_count_firm, mean_count_prod,
mean_max_ts_firm_prod, mean_max_ts_firm, mean_max_ts_prod,
@ -74,9 +74,6 @@ left join
from iiabmdb.with_exp_result
where `status` = "R"
group by s_id, id_firm) as s_n_remove_prod
left join iiabmdb_basic_info.firm_n_prod as firm_n_prod
on s_n_remove_prod.id_firm = firm_n_prod.code
where n_remove_prod = n_prod
group by s_id) as s_n_all_prod_remove_firm
on sample.id = s_n_all_prod_remove_firm.s_id
) as secnario_count

View File

@ -1,13 +1,16 @@
CREATE DATABASE iiabmdb20230829;
RENAME TABLE iiabmdb.not_test_experiment TO iiabmdb20230829.not_test_experiment,
iiabmdb.not_test_result TO iiabmdb20230829.not_test_result,
iiabmdb.not_test_sample TO iiabmdb20230829.not_test_sample,
iiabmdb.test_experiment TO iiabmdb20230829.test_experiment,
iiabmdb.test_result TO iiabmdb20230829.test_result,
iiabmdb.test_sample TO iiabmdb20230829.test_sample;
RENAME TABLE iiabmdb.with_exp_experiment TO iiabmdb20230829.with_exp_experiment,
iiabmdb.with_exp_result TO iiabmdb20230829.with_exp_result,
iiabmdb.with_exp_sample TO iiabmdb20230829.with_exp_sample,
iiabmdb.without_exp_experiment TO iiabmdb20230829.without_exp_experiment,
iiabmdb.without_exp_result TO iiabmdb20230829.without_exp_result,
iiabmdb.without_exp_sample TO iiabmdb20230829.without_exp_sample;
-- 创建新的数据库
CREATE DATABASE iiabmdb2025211;
-- 重命名表到新数据库
RENAME TABLE
iiabmdb.test_experiment TO iiabmdb2025211.test_experiment,
iiabmdb.test_result TO iiabmdb2025211.test_result,
iiabmdb.test_sample TO iiabmdb2025211.test_sample;
RENAME TABLE
iiabmdb.with_exp_experiment TO iiabmdb2025211.with_exp_experiment,
iiabmdb.with_exp_result TO iiabmdb2025211.with_exp_result,
iiabmdb.with_exp_sample TO iiabmdb2025211.with_exp_sample,
iiabmdb.without_exp_experiment TO iiabmdb2025211.without_exp_experiment,
iiabmdb.without_exp_result TO iiabmdb2025211.without_exp_result,
iiabmdb.without_exp_sample TO iiabmdb2025211.without_exp_sample;

View File

@ -0,0 +1,9 @@
,mean_count_firm_prod,mean_max_ts_firm_prod,mean_n_remove_firm_prod,mean_end_ts
prf_size,0.366,0.576,0,0.006
prf_conn,0.332,0.053,0,0
cap_limit_prob_type,0.446,0,0,0
n_max_trial,0.234,0,0,0
cap_limit_level,0.47,0,0,0
diff_new_conn,0.499,0.009,0,0
remove_t,0.305,0.28,0,0.101
netw_prf_n,0.356,0.128,0,0.734
1 mean_count_firm_prod mean_max_ts_firm_prod mean_n_remove_firm_prod mean_end_ts
2 prf_size 0.366 0.576 0 0.006
3 prf_conn 0.332 0.053 0 0
4 cap_limit_prob_type 0.446 0 0 0
5 n_max_trial 0.234 0 0 0
6 cap_limit_level 0.47 0 0 0
7 diff_new_conn 0.499 0.009 0 0
8 remove_t 0.305 0.28 0 0.101
9 netw_prf_n 0.356 0.128 0 0.734

View File

@ -0,0 +1,22 @@
自变量,level,系统恢复用时R1,产业-企业边累计扰乱次数R2,产业-企业边最大传导深度R3,产业-企业边断裂总数R4
采购策略P1,三供应商,13.75,94.41,8.422,0
采购策略P1,双供应商,13.63,94.42,8.336,0
采购策略P1,单供应商,13.74,94.4,8.437,0
是否规模偏好P2,倾向,13.91,94.42,8.41,0
是否规模偏好P2,不倾向,13.5,94.41,8.386,0
最大尝试次数P3,高,12.8,94.4,8.395,0
最大尝试次数P3,中,13.51,94.42,8.358,0
最大尝试次数P3,低,14.8,94.42,8.442,0
是否已有连接偏好P4,倾向,13.24,94.4,8.355,0
是否已有连接偏好P4,不倾向,14.17,94.42,8.441,0
额外产能分布P5,均匀分布,14.06,94.42,8.619,0
额外产能分布P5,正态分布,13.36,94.41,8.178,0
额外产能分布参数P6,高,15.56,94.41,9.724,0
额外产能分布参数P6,中,13.12,94.4,7.999,0
额外产能分布参数P6,低,12.44,94.42,7.472,0
新供应关系构成概率P7,低,14.2,94.42,8.31,0
新供应关系构成概率P7,中,13.7,94.4,8.398,0
新供应关系构成概率P7,高,13.21,94.41,8.486,0
最大尝试时间步P8,低,13.82,94.42,8.971,0
最大尝试时间步P8,中,13.49,94.42,8.503,0
最大尝试时间步P8,高,13.81,94.4,7.721,0
1 自变量 level 系统恢复用时R1 产业-企业边累计扰乱次数R2 产业-企业边最大传导深度R3 产业-企业边断裂总数R4
2 采购策略P1 三供应商 13.75 94.41 8.422 0
3 采购策略P1 双供应商 13.63 94.42 8.336 0
4 采购策略P1 单供应商 13.74 94.4 8.437 0
5 是否规模偏好P2 倾向 13.91 94.42 8.41 0
6 是否规模偏好P2 不倾向 13.5 94.41 8.386 0
7 最大尝试次数P3 12.8 94.4 8.395 0
8 最大尝试次数P3 13.51 94.42 8.358 0
9 最大尝试次数P3 14.8 94.42 8.442 0
10 是否已有连接偏好P4 倾向 13.24 94.4 8.355 0
11 是否已有连接偏好P4 不倾向 14.17 94.42 8.441 0
12 额外产能分布P5 均匀分布 14.06 94.42 8.619 0
13 额外产能分布P5 正态分布 13.36 94.41 8.178 0
14 额外产能分布参数P6 15.56 94.41 9.724 0
15 额外产能分布参数P6 13.12 94.4 7.999 0
16 额外产能分布参数P6 12.44 94.42 7.472 0
17 新供应关系构成概率P7 14.2 94.42 8.31 0
18 新供应关系构成概率P7 13.7 94.4 8.398 0
19 新供应关系构成概率P7 13.21 94.41 8.486 0
20 最大尝试时间步P8 13.82 94.42 8.971 0
21 最大尝试时间步P8 13.49 94.42 8.503 0
22 最大尝试时间步P8 13.81 94.4 7.721 0

View File

@ -0,0 +1,37 @@
idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts,
0,7,1,1,uniform,5.0000,0.3000,3,3,94.3905,25.8389,15.5684,10.3042,8.2747,5.5937,,,15.2632
1,5,1,1,uniform,10.0000,0.5000,5,2,94.4211,25.8526,15.5684,8.2442,6.6884,4.5368,,,12.7537
2,3,1,1,uniform,15.0000,0.7000,7,1,94.4211,25.8526,15.5684,7.0926,5.6989,3.8189,,,13.2421
3,7,1,1,uniform,5.0000,0.3000,3,2,94.4032,25.8526,15.5684,10.3284,8.3516,5.6368,,,15.4642
4,5,1,1,uniform,10.0000,0.5000,5,1,94.4211,25.8526,15.5684,8.2842,6.6389,4.4221,,,12.5284
5,3,1,1,uniform,15.0000,0.7000,7,3,94.4211,25.8526,15.5684,7.0789,5.5937,3.7137,,,13.6147
6,7,1,1,normal,5.0000,0.5000,7,3,94.4063,25.8400,15.5684,10.1158,8.2200,5.5147,,,14.3758
7,5,1,1,normal,10.0000,0.7000,3,2,94.4211,25.8526,15.5684,8.0211,6.4116,4.2947,,,11.9158
8,3,1,1,normal,15.0000,0.3000,5,1,94.4211,25.8526,15.5684,6.6611,5.2316,3.4979,,,13.0347
9,7,1,0,uniform,5.0000,0.7000,5,3,94.4000,25.8516,15.5684,10.8484,8.9726,6.2316,,,15.2137
10,5,1,0,uniform,10.0000,0.3000,7,2,94.4211,25.8526,15.5684,8.2421,6.6011,4.4411,,,14.5495
11,3,1,0,uniform,15.0000,0.5000,3,1,94.4211,25.8526,15.5684,7.1937,5.7442,3.7242,,,14.9758
12,7,1,0,normal,10.0000,0.7000,3,1,94.4211,25.8526,15.5684,8.4179,6.8137,4.5884,,,11.6758
13,5,1,0,normal,15.0000,0.3000,5,3,94.4211,25.8526,15.5684,7.2000,5.6800,3.8368,,,13.2495
14,3,1,0,normal,5.0000,0.5000,7,2,94.4211,25.8526,15.5684,8.7758,7.1768,4.6400,,,16.7832
15,7,1,0,normal,10.0000,0.7000,5,3,94.4211,25.8526,15.5684,8.4800,6.8326,4.7326,,,11.6084
16,5,1,0,normal,15.0000,0.3000,7,2,94.4211,25.8526,15.5684,7.2495,5.8063,3.8611,,,13.2989
17,3,1,0,normal,5.0000,0.5000,3,1,94.4211,25.8526,15.5684,8.8453,7.2789,4.5863,,,16.8937
18,7,0,1,normal,10.0000,0.3000,7,1,94.4211,25.8526,15.5684,8.2905,6.5737,4.4768,,,12.3000
19,5,0,1,normal,15.0000,0.5000,3,3,94.4211,25.8526,15.5684,7.3737,5.8684,3.9411,,,11.1611
20,3,0,1,normal,5.0000,0.7000,5,2,94.4211,25.8526,15.5684,8.8400,7.1789,4.8305,,,15.2400
21,7,0,1,normal,10.0000,0.5000,7,1,94.2084,25.8242,15.5453,8.3768,6.7484,4.5558,,,11.6558
22,5,0,1,normal,15.0000,0.7000,3,3,94.4211,25.8526,15.5684,7.3253,5.8726,3.9663,,,10.6347
23,3,0,1,normal,5.0000,0.3000,5,2,94.4211,25.8526,15.5684,8.5432,6.9621,4.5263,,,15.3916
24,7,0,1,uniform,15.0000,0.5000,3,2,94.4211,25.8526,15.5684,8.2053,6.4221,4.4084,,,11.5705
25,5,0,1,uniform,5.0000,0.7000,5,1,94.4063,25.8400,15.5684,9.8326,7.8979,5.3768,,,14.5716
26,3,0,1,uniform,10.0000,0.3000,7,3,94.4211,25.8526,15.5684,7.4747,6.0158,3.8495,,,13.5979
27,7,0,0,normal,15.0000,0.5000,5,2,94.4211,25.8526,15.5684,7.6232,6.2011,4.0674,,,10.8221
28,5,0,0,normal,5.0000,0.7000,7,1,94.3811,25.8274,15.5505,9.9442,8.0916,5.5853,,,15.0863
29,3,0,0,normal,10.0000,0.3000,3,3,94.4211,25.8526,15.5684,7.1200,5.6505,3.6642,,,15.3021
30,7,0,0,uniform,15.0000,0.7000,7,2,94.4211,25.8526,15.5684,8.3558,6.7084,4.6537,,,11.3000
31,5,0,0,uniform,5.0000,0.3000,3,1,94.4211,25.8526,15.5684,10.0063,8.0895,5.2726,,,16.5568
32,3,0,0,uniform,10.0000,0.5000,5,3,94.4211,25.8526,15.5684,7.4326,6.0211,3.8421,,,15.0526
33,7,0,0,uniform,15.0000,0.3000,5,1,94.4211,25.8526,15.5684,8.3021,6.6600,4.4116,,,12.4042
34,5,0,0,uniform,5.0000,0.5000,7,3,94.4053,25.8526,15.5674,10.3084,8.3789,5.4537,,,15.8716
35,3,0,0,uniform,10.0000,0.7000,3,2,94.4211,25.8526,15.5684,7.5989,6.1305,4.1295,,,14.4716
1 idx_scenario,n_max_trial,prf_size,prf_conn,cap_limit_prob_type,cap_limit_level,diff_new_conn,remove_t,netw_prf_n,mean_count_firm_prod,mean_count_firm,mean_count_prod,mean_max_ts_firm_prod,mean_max_ts_firm,mean_max_ts_prod,mean_n_remove_firm_prod,mean_n_all_prod_remove_firm,mean_end_ts,
2 0,7,1,1,uniform,5.0000,0.3000,3,3,94.3905,25.8389,15.5684,10.3042,8.2747,5.5937,,,15.2632
3 1,5,1,1,uniform,10.0000,0.5000,5,2,94.4211,25.8526,15.5684,8.2442,6.6884,4.5368,,,12.7537
4 2,3,1,1,uniform,15.0000,0.7000,7,1,94.4211,25.8526,15.5684,7.0926,5.6989,3.8189,,,13.2421
5 3,7,1,1,uniform,5.0000,0.3000,3,2,94.4032,25.8526,15.5684,10.3284,8.3516,5.6368,,,15.4642
6 4,5,1,1,uniform,10.0000,0.5000,5,1,94.4211,25.8526,15.5684,8.2842,6.6389,4.4221,,,12.5284
7 5,3,1,1,uniform,15.0000,0.7000,7,3,94.4211,25.8526,15.5684,7.0789,5.5937,3.7137,,,13.6147
8 6,7,1,1,normal,5.0000,0.5000,7,3,94.4063,25.8400,15.5684,10.1158,8.2200,5.5147,,,14.3758
9 7,5,1,1,normal,10.0000,0.7000,3,2,94.4211,25.8526,15.5684,8.0211,6.4116,4.2947,,,11.9158
10 8,3,1,1,normal,15.0000,0.3000,5,1,94.4211,25.8526,15.5684,6.6611,5.2316,3.4979,,,13.0347
11 9,7,1,0,uniform,5.0000,0.7000,5,3,94.4000,25.8516,15.5684,10.8484,8.9726,6.2316,,,15.2137
12 10,5,1,0,uniform,10.0000,0.3000,7,2,94.4211,25.8526,15.5684,8.2421,6.6011,4.4411,,,14.5495
13 11,3,1,0,uniform,15.0000,0.5000,3,1,94.4211,25.8526,15.5684,7.1937,5.7442,3.7242,,,14.9758
14 12,7,1,0,normal,10.0000,0.7000,3,1,94.4211,25.8526,15.5684,8.4179,6.8137,4.5884,,,11.6758
15 13,5,1,0,normal,15.0000,0.3000,5,3,94.4211,25.8526,15.5684,7.2000,5.6800,3.8368,,,13.2495
16 14,3,1,0,normal,5.0000,0.5000,7,2,94.4211,25.8526,15.5684,8.7758,7.1768,4.6400,,,16.7832
17 15,7,1,0,normal,10.0000,0.7000,5,3,94.4211,25.8526,15.5684,8.4800,6.8326,4.7326,,,11.6084
18 16,5,1,0,normal,15.0000,0.3000,7,2,94.4211,25.8526,15.5684,7.2495,5.8063,3.8611,,,13.2989
19 17,3,1,0,normal,5.0000,0.5000,3,1,94.4211,25.8526,15.5684,8.8453,7.2789,4.5863,,,16.8937
20 18,7,0,1,normal,10.0000,0.3000,7,1,94.4211,25.8526,15.5684,8.2905,6.5737,4.4768,,,12.3000
21 19,5,0,1,normal,15.0000,0.5000,3,3,94.4211,25.8526,15.5684,7.3737,5.8684,3.9411,,,11.1611
22 20,3,0,1,normal,5.0000,0.7000,5,2,94.4211,25.8526,15.5684,8.8400,7.1789,4.8305,,,15.2400
23 21,7,0,1,normal,10.0000,0.5000,7,1,94.2084,25.8242,15.5453,8.3768,6.7484,4.5558,,,11.6558
24 22,5,0,1,normal,15.0000,0.7000,3,3,94.4211,25.8526,15.5684,7.3253,5.8726,3.9663,,,10.6347
25 23,3,0,1,normal,5.0000,0.3000,5,2,94.4211,25.8526,15.5684,8.5432,6.9621,4.5263,,,15.3916
26 24,7,0,1,uniform,15.0000,0.5000,3,2,94.4211,25.8526,15.5684,8.2053,6.4221,4.4084,,,11.5705
27 25,5,0,1,uniform,5.0000,0.7000,5,1,94.4063,25.8400,15.5684,9.8326,7.8979,5.3768,,,14.5716
28 26,3,0,1,uniform,10.0000,0.3000,7,3,94.4211,25.8526,15.5684,7.4747,6.0158,3.8495,,,13.5979
29 27,7,0,0,normal,15.0000,0.5000,5,2,94.4211,25.8526,15.5684,7.6232,6.2011,4.0674,,,10.8221
30 28,5,0,0,normal,5.0000,0.7000,7,1,94.3811,25.8274,15.5505,9.9442,8.0916,5.5853,,,15.0863
31 29,3,0,0,normal,10.0000,0.3000,3,3,94.4211,25.8526,15.5684,7.1200,5.6505,3.6642,,,15.3021
32 30,7,0,0,uniform,15.0000,0.7000,7,2,94.4211,25.8526,15.5684,8.3558,6.7084,4.6537,,,11.3000
33 31,5,0,0,uniform,5.0000,0.3000,3,1,94.4211,25.8526,15.5684,10.0063,8.0895,5.2726,,,16.5568
34 32,3,0,0,uniform,10.0000,0.5000,5,3,94.4211,25.8526,15.5684,7.4326,6.0211,3.8421,,,15.0526
35 33,7,0,0,uniform,15.0000,0.3000,5,1,94.4211,25.8526,15.5684,8.3021,6.6600,4.4116,,,12.4042
36 34,5,0,0,uniform,5.0000,0.5000,7,3,94.4053,25.8526,15.5674,10.3084,8.3789,5.4537,,,15.8716
37 35,3,0,0,uniform,10.0000,0.7000,3,2,94.4211,25.8526,15.5684,7.5989,6.1305,4.1295,,,14.4716

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 MiB

After

Width:  |  Height:  |  Size: 5.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 MiB

After

Width:  |  Height:  |  Size: 7.5 MiB

View File

@ -23,7 +23,7 @@ list_firm = list(set(list_firm))
Firm = pd.read_csv("input_data/input_firm_data/Firm_amended.csv")
Firm['Code'] = Firm['Code'].astype('string')
Firm.fillna(0, inplace=True)
Firm_attr = Firm.loc[:, ["Code", "Type_Region", "Revenue_Log"]]
Firm_attr = Firm.loc[:, ["Code", "企业名称", "Type_Region", "Revenue_Log"]]
firm_industry_relation = pd.read_csv("input_data/firm_industry_relation.csv")
firm_industry_relation['Firm_Code'] = firm_industry_relation['Firm_Code'].astype('string')
firm_product = []
@ -58,15 +58,13 @@ for _, row in count_dcp.iterrows():
G_firm.add_edges_from(lst_add_edge)
# dcp_networkx
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="twopi", args="")
node_label = nx.get_node_attributes(G_firm, 'Revenue_Log')
pos = nx.nx_agraph.graphviz_layout(G_firm, prog="dot", args="")
node_label = nx.get_node_attributes(G_firm, '企业名称')
# desensitize
node_label = {
key: key
for key in node_label.keys()
}
node_label = {key: f"{key} {value}" for key, value in node_label.items()}
node_size = list(nx.get_node_attributes(G_firm, 'Revenue_Log').values())
node_size = list(map(lambda x: x**3, node_size))
node_size = list(map(lambda x: x ** 3, node_size))
edge_label = nx.get_edge_attributes(G_firm, "edge_label")
edge_label = {(n1, n2): label for (n1, n2, _), label in edge_label.items()}
edge_width = nx.get_edge_attributes(G_firm, "edge_width")
@ -81,7 +79,7 @@ nx.draw(G_firm,
pos,
node_size=node_size,
labels=node_label,
font_size=6,
font_size=2,
width=1,
edge_color=colors,
edge_cmap=cmap,
@ -94,5 +92,5 @@ position = fig.add_axes([0.95, 0.05, 0.01, 0.3])
cb = plt.colorbar(sm, fraction=0.01, cax=position)
cb.ax.tick_params(labelsize=4)
cb.outline.set_visible(False)
plt.savefig("output_result\\risk\\count_dcp_network_twopi")
plt.savefig("output_result\\risk\\count_dcp_network_dot")
plt.close()

0
执行sql语句.py Normal file
View File

View File

@ -46,7 +46,7 @@ def visualize_progress():
ax.text(i, v + 0.5, str(v), ha='center', fontsize=12)
# 刷新绘图
plt.pause(1) # 暂停一段时间以更新图表
plt.pause(3) # 暂停一段时间以更新图表
# 关闭窗口时,停止交互模式
# plt.ioff()