Compare commits

..

No commits in common. "5c7788e86eafeafa0a2d32cf26459ca90a7aa13f" and "f7354a4a441f75bba80aae19a703bd2bf013f16d" have entirely different histories.

23 changed files with 12576 additions and 38261 deletions

View File

@ -31,13 +31,6 @@
</Attribute> </Attribute>
</value> </value>
</entry> </entry>
<entry key="\input_data\input_firm_data\firm_amended.csv">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
<entry key="\input_data\input_firm_data\firms_devices.csv"> <entry key="\input_data\input_firm_data\firms_devices.csv">
<value> <value>
<Attribute> <Attribute>
@ -136,13 +129,6 @@
</Attribute> </Attribute>
</value> </value>
</entry> </entry>
<entry key="\output_result\risk\count.csv">
<value>
<Attribute>
<option name="separator" value="," />
</Attribute>
</value>
</entry>
<entry key="\output_result\risk\count_dcp.csv"> <entry key="\output_result\risk\count_dcp.csv">
<value> <value>
<Attribute> <Attribute>

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,9 +1,5 @@
import json
import os import os
import datetime import datetime
import networkx as nx
import pandas as pd
from mesa import Model from mesa import Model
from typing import TYPE_CHECKING from typing import TYPE_CHECKING
@ -40,231 +36,9 @@ class Computation:
dct_sample_para = {'sample': sample_random, dct_sample_para = {'sample': sample_random,
'seed': sample_random.seed, 'seed': sample_random.seed,
**dct_exp} **dct_exp}
product_network_test = nx.adjacency_graph(json.loads(dct_sample_para['g_bom']))
model = MyModel(dct_sample_para) model = MyModel(dct_sample_para)
for i in range(1): for i in range(1):
model.step() model.step()
print(i, datetime.datetime.now()) print(i, datetime.datetime.now())
model.end() model.end()
return False return False
def initialize_firm_network(self):
# Read the firm data
firm = pd.read_csv("input_data/input_firm_data/Firm_amended.csv")
firm['Code'] = firm['Code'].astype(str)
firm.fillna(0, inplace=True)
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 = []
grouped = firm_industry_relation.groupby('Firm_Code')['Product_Code'].apply(list)
firm_product.append(grouped)
firm_attr['Product_Code'] = firm_attr['Code'].map(grouped)
firm_attr.set_index('Code', inplace=True)
grouped = firm_industry_relation.groupby('Firm_Code')
self.firm_prod_labels_dict = {code: group['Product_Code'].tolist() for code, group in grouped}
# 遍历'Product_Code' 与 index 交换
for index, row in firm_attr.iterrows():
id_index_list = []
for i in row['Product_Code']:
for key_values in self.id_code.items():
if int(key_values[0]) == i:
for id in key_values[1]:
id_index_list.append(id)
firm_attr.at[index, 'Product_Code'] = id_index_list
self.G_Firm.add_nodes_from(firm["Code"])
# Assign attributes to the firm nodes
firm_labels_dict = {code: firm_attr.loc[code].to_dict() for code in self.G_Firm.nodes}
nx.set_node_attributes(self.G_Firm, firm_labels_dict)
self.Firm = firm
def initialize_firm_product_network(self):
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_industry_relation['Product_Code'] = firm_industry_relation['Product_Code'].apply(lambda x: [x])
# 将 'firm_prod' 表中的每一行作为图中的节点
self.G_FirmProd.add_nodes_from(firm_industry_relation.index)
# 为每个节点分配属性
# 遍历'Product_Code' 与 index 交换
for index, row in firm_industry_relation.iterrows():
id_index_list = []
for i in row['Product_Code']:
for key_values in self.id_code.items():
if int(key_values[0]) == i:
for id in key_values[1]:
id_index_list.append(id)
firm_industry_relation.at[index, 'Product_Code'] = id_index_list
firm_prod_labels_dict = {code: firm_industry_relation.loc[code].to_dict() for code in
firm_industry_relation.index}
nx.set_node_attributes(self.G_FirmProd, firm_prod_labels_dict)
def add_edges_to_firm_network(self):
""" Add edges between firms based on the product BOM relationships """
# Add edges to G_Firm according to G_bom
for node in nx.nodes(self.G_Firm):
lst_pred_product_code = []
for product_code in self.G_Firm.nodes[node]['Product_Code']:
lst_pred_product_code += list(self.G_bom.predecessors(product_code))
lst_pred_product_code = list(set(lst_pred_product_code))
lst_pred_product_code = list(sorted(lst_pred_product_code)) # Ensure consistency
for pred_product_code in lst_pred_product_code:
# Get a list of firms producing the component (pred_product_code)
lst_pred_firm = [firm_code for firm_code, product in self.firm_prod_labels_dict.items() if
pred_product_code in product]
# Select multiple suppliers (multi-sourcing)
n_pred_firm = self.int_netw_prf_n
if n_pred_firm > len(lst_pred_firm):
n_pred_firm = len(lst_pred_firm)
if self.is_prf_size:
# 获取 firm 的 size 列表
lst_pred_firm_size = [self.G_Firm.nodes[pred_firm]['Revenue_Log'] for pred_firm in lst_pred_firm]
# 检查 lst_pred_firm_size 是否为空或总和为 0
if len(lst_pred_firm_size) == 0 or sum(lst_pred_firm_size) == 0:
# print("警告: lst_pred_firm_size 为空或总和为 0无法生成概率分布")
lst_choose_firm = [] # 返回空结果,或根据需要处理
else:
# 计算总和
sum_pred_firm_size = sum(lst_pred_firm_size)
# 归一化生成 lst_prob
lst_prob = [size / sum_pred_firm_size for size in lst_pred_firm_size]
# 使用 np.isclose() 确保概率总和接近 1
if not np.isclose(sum(lst_prob), 1.0):
# print(f"警告: 概率总和为 {sum(lst_prob)},现在进行修正")
lst_prob = [prob / sum(lst_prob) for prob in lst_prob]
# 确保没有负值或 0
lst_prob = [max(0, prob) for prob in lst_prob]
# 根据修正后的概率选择 firm
lst_choose_firm = self.nprandom.choice(lst_pred_firm, n_pred_firm, replace=False, p=lst_prob)
else:
# 直接进行随机选择
lst_choose_firm = self.nprandom.choice(lst_pred_firm, n_pred_firm, replace=False)
# Add edges from predecessor firms to current node (firm)
lst_add_edge = [(pred_firm, node, {'Product': pred_product_code}) for pred_firm in lst_choose_firm]
self.G_Firm.add_edges_from(lst_add_edge)
# Add edges to firm-product network
self.add_edges_to_firm_product_network(node, pred_product_code, lst_choose_firm)
def add_edges_to_firm_product_network(self, node, pred_product_code, lst_choose_firm):
""" Helper function to add edges to the firm-product network """
set_node_prod_code = set(self.G_Firm.nodes[node]['Product_Code'])
set_pred_succ_code = set(self.G_bom.successors(pred_product_code))
lst_use_pred_prod_code = list(set_node_prod_code & set_pred_succ_code)
if len(lst_use_pred_prod_code) == 0:
print("错误")
pred_node_list = []
for pred_firm in lst_choose_firm:
for n, v in self.G_FirmProd.nodes(data=True):
for v1 in v['Product_Code']:
if v1 == pred_product_code and v['Firm_Code'] == pred_firm:
pred_node_list.append(n)
if len(pred_node_list) != 0:
pred_node = pred_node_list[0]
else:
pred_node = -1
current_node_list = []
for use_pred_prod_code in lst_use_pred_prod_code:
for n, v in self.G_FirmProd.nodes(data=True):
for v1 in v['Product_Code']:
if v1 == use_pred_prod_code and v['Firm_Code'] == node:
current_node_list.append(n)
if len(current_node_list) != 0:
current_node = current_node_list[0]
else:
current_node = -1
if current_node != -1 and pred_node != -1:
self.G_FirmProd.add_edge(pred_node, current_node)
def connect_unconnected_nodes(self):
""" Connect unconnected nodes in the firm network """
for node in nx.nodes(self.G_Firm):
if self.G_Firm.degree(node) == 0:
current_node_list = []
for product_code in self.G_Firm.nodes[node]['Product_Code']:
for n, v in self.G_FirmProd.nodes(data=True):
for v1 in v['Product_Code']:
if v['Firm_Code'] == node and v1 == product_code:
current_node_list.append(n)
if len(current_node_list) != 0:
current_node = current_node_list[0]
else:
current_node = -1
lst_succ_product_code = list(self.G_bom.successors(product_code))
for succ_product_code in lst_succ_product_code:
lst_succ_firm = [firm_code for firm_code, product in self.firm_prod_labels_dict.items() if
succ_product_code in product]
n_succ_firm = self.int_netw_prf_n
if n_succ_firm > len(lst_succ_firm):
n_succ_firm = len(lst_succ_firm)
if self.is_prf_size:
lst_succ_firm_size = [self.G_Firm.nodes[succ_firm]['Revenue_Log'] for succ_firm in
lst_succ_firm]
if len(lst_succ_firm_size) == 0 or sum(lst_succ_firm_size) == 0:
# print("警告: lst_pred_firm_size 为空或总和为 0无法生成概率分布")
lst_choose_firm = [] # 返回空结果,或根据需要处理
else:
# 计算总和
sum_pred_firm_size = sum(lst_succ_firm_size)
# 归一化生成 lst_prob
lst_prob = [size / sum_pred_firm_size for size in lst_succ_firm_size]
# 使用 np.isclose() 确保概率总和接近 1
if not np.isclose(sum(lst_prob), 1.0):
# print(f"警告: 概率总和为 {sum(lst_prob)},现在进行修正")
lst_prob = [prob / sum(lst_prob) for prob in lst_prob]
# 确保没有负值或 0
lst_prob = [max(0, prob) for prob in lst_prob]
lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False,
p=lst_prob)
else:
lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False)
lst_add_edge = [(node, succ_firm, {'Product': product_code}) for succ_firm in
lst_choose_firm]
self.G_Firm.add_edges_from(lst_add_edge)
# Add edges to firm-product network
succ_node_list = []
for succ_firm in lst_choose_firm:
for n, v in self.G_FirmProd.nodes(data=True):
for v1 in v['Product_Code']:
if v1 == succ_product_code and v['Firm_Code'] == succ_firm:
succ_node_list.append(n)
if len(succ_node_list) != 0:
succ_node = succ_node_list[0]
else:
succ_node = -1
if current_node != -1 and succ_node != -1:
self.G_FirmProd.add_edge(current_node, succ_node)
self.sample.g_firm = json.dumps(nx.adjacency_data(self.G_Firm))
self.firm_network = self.G_Firm # 直接使用 networkx 图对象
self.firm_prod_network = self.G_FirmProd # 直接使用 networkx 图对象

View File

@ -39,7 +39,7 @@ class ControllerDB:
self.lst_saved_s_id = [] self.lst_saved_s_id = []
self.experiment_data = [] self.experiment_data = []
self.batch_size = 5000 self.batch_size = 2000
# 根据需求设置每批次的大小 # 根据需求设置每批次的大小
def init_tables(self): def init_tables(self):
@ -79,18 +79,29 @@ class ControllerDB:
# 结点属性值 相当于 图上点的 原始 产品名称 # 结点属性值 相当于 图上点的 原始 产品名称
bom_nodes = pd.read_csv('input_data/input_product_data/BomNodes.csv') bom_nodes = pd.read_csv('input_data/input_product_data/BomNodes.csv')
bom_nodes['Code'] = bom_nodes['Code'].astype(str) bom_nodes['Code'] = bom_nodes['Code'].astype(str)
bom_nodes.set_index('Index', inplace=True) bom_nodes.set_index('Code', inplace=True)
# bom_cate_net = pd.read_csv('input_data/input_product_data/BomCateNet.csv', index_col=0)
# bom_cate_net.fillna(0, inplace=True)
# # 创建 可以多边的有向图 同时 转置操作 使得 上游指向下游结点 也就是 1.1.1 - 1.1 类似这种
# # 将第一列转换为字符串类型
# print("sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss")
# print(bom_cate_net.columns)
# print(bom_cate_net.index) # 打印行标题(索引)
# print(bom_cate_net.iloc[:, 0]) # 打印第一列的内容
#
# g_bom = nx.from_pandas_adjacency(bom_cate_net.T,
# create_using=nx.MultiDiGraph())
bom_cate_net = pd.read_csv('input_data/input_product_data/合成结点.csv') bom_cate_net = pd.read_csv('input_data/input_product_data/合成结点.csv')
g_bom = nx.from_pandas_edgelist(bom_cate_net, source='UPID', target='ID', create_using=nx.MultiDiGraph()) g_bom = nx.from_pandas_edgelist(bom_cate_net, source='UPID', target='ID', create_using=nx.MultiDiGraph())
# 填充每一个结点 的具体内容 通过 相同的 code 并且通过BomNodes.loc[code].to_dict()字典化 格式类似 格式 { code0 : {level: 0 ,name: 工业互联网 }} # 填充每一个结点 的具体内容 通过 相同的 code 并且通过BomNodes.loc[code].to_dict()字典化 格式类似 格式 { code0 : {level: 0 ,name: 工业互联网 }}
bom_labels_dict = {} bom_labels_dict = {}
for index in g_bom.nodes: for code in g_bom.nodes:
try: try:
bom_labels_dict[index] = bom_nodes.loc[index].to_dict() int_code = int(code)
# print(bom_labels_dict[index]) bom_labels_dict[code] = bom_nodes.loc[int_code].to_dict()
except KeyError: except KeyError:
print(f"节点 {index} 不存在于 bom_nodes 中") print(f"节点 {code} 不存在于 bom_nodes 中")
# 分配属性 给每一个结点 获得类似 格式:{1: {'label': 'A', 'value': 10}, # 分配属性 给每一个结点 获得类似 格式:{1: {'label': 'A', 'value': 10},
nx.set_node_attributes(g_bom, bom_labels_dict) nx.set_node_attributes(g_bom, bom_labels_dict)
# 改为json 格式 # 改为json 格式

View File

@ -39,9 +39,9 @@ class FirmAgent(Agent):
for agent in self.model.company_agents if agent.unique_id == u] for agent in self.model.company_agents if agent.unique_id == u]
# 设备c的数量 (总量) 使用这个来判断设备数量 # 设备c的数量 (总量) 使用这个来判断设备数量
self.n_equip_c = n_equip_c self.n_equip_c = n_equip_c
# 设备c产量 根据设备量进行估算 # 设备c产量 更具设备量进行估算
self.c_yield = production_output self.c_yield = production_output
# 消耗材料量 根据设备量进行估算 { } # 消耗材料量 根据设备量进行估算
self.c_consumption = demand_quantity self.c_consumption = demand_quantity
# 设备c购买价格初始值 # 设备c购买价格初始值
# self.c_price = c_price # self.c_price = c_price

View File

@ -1,6 +1,4 @@
Firm_Code,Product_Code Firm_Code,Product_Code
6,7
7,7
29954548,7 29954548,7
169456313,7 169456313,7
771821595,7 771821595,7
@ -5817,6 +5815,7 @@
3375823631,2717 3375823631,2717
3384021594,2717 3384021594,2717
3384489464,2717 3384489464,2717
3387414634,2717
3391140557,2717 3391140557,2717
3391580446,2717 3391580446,2717
3394344425,2717 3394344425,2717
@ -5854,6 +5853,7 @@
4728160558,2717 4728160558,2717
4977024731,2717 4977024731,2717
5075022186,2717 5075022186,2717
5080328229,2717
5082745863,2717 5082745863,2717
11174854725,2717 11174854725,2717
11197373335,2717 11197373335,2717
@ -5982,6 +5982,7 @@
3339447871,2718 3339447871,2718
3341201089,2718 3341201089,2718
3393520654,2718 3393520654,2718
3417211306,2718
4050411188,2718 4050411188,2718
1452048,32338 1452048,32338
2010673,32338 2010673,32338
@ -10024,6 +10025,7 @@
2327979389,32441 2327979389,32441
3226664625,32441 3226664625,32441
3462551351,32441 3462551351,32441
3315213370,32442
829768,32443 829768,32443
961017,32443 961017,32443
6292428,32443 6292428,32443
@ -10096,6 +10098,7 @@
3395900897,32443 3395900897,32443
4187134530,32443 4187134530,32443
5235871870,32443 5235871870,32443
1273878359,32444
863079,32445 863079,32445
1452048,32445 1452048,32445
4928854,32445 4928854,32445
@ -10200,6 +10203,7 @@
3359835624,32445 3359835624,32445
3374200023,32445 3374200023,32445
3383829951,32445 3383829951,32445
3387414634,32445
3407754893,32445 3407754893,32445
3414432268,32445 3414432268,32445
3417604299,32445 3417604299,32445
@ -12700,6 +12704,7 @@
1662628216,34566 1662628216,34566
1718070442,34566 1718070442,34566
2311333794,34566 2311333794,34566
2311554061,34566
2312469536,34566 2312469536,34566
2313316346,34566 2313316346,34566
2314838109,34566 2314838109,34566
@ -12886,6 +12891,7 @@
2707711529,34566 2707711529,34566
2735580560,34566 2735580560,34566
2745792038,34566 2745792038,34566
2784653609,34566
2787318020,34566 2787318020,34566
2788202283,34566 2788202283,34566
2794900565,34566 2794900565,34566
@ -13428,8 +13434,10 @@
3193452645,34574 3193452645,34574
3240604547,34574 3240604547,34574
3340308357,34574 3340308357,34574
3387414634,34574
3415340571,34574 3415340571,34574
4114133480,34574 4114133480,34574
5080328229,34574
11209117004,34574 11209117004,34574
5979030,36914 5979030,36914
5979313,36914 5979313,36914
@ -13716,6 +13724,7 @@
18729611,56321 18729611,56321
25624519,56321 25624519,56321
26516263,56321 26516263,56321
27218524,56321
27892215,56321 27892215,56321
42901962,56321 42901962,56321
57430434,56321 57430434,56321
@ -13762,6 +13771,7 @@
2328469644,56321 2328469644,56321
2329948539,56321 2329948539,56321
2330435233,56321 2330435233,56321
2335686424,56321
2339188563,56321 2339188563,56321
2342317074,56321 2342317074,56321
2346409693,56321 2346409693,56321
@ -13771,11 +13781,13 @@
2388525637,56321 2388525637,56321
2441725544,56321 2441725544,56321
2568380877,56321 2568380877,56321
2784653609,56321
2985599329,56321 2985599329,56321
3007255509,56321 3007255509,56321
3019316903,56321 3019316903,56321
3041197460,56321 3041197460,56321
3049154839,56321 3049154839,56321
3049563940,56321
3121176272,56321 3121176272,56321
3146829971,56321 3146829971,56321
3164072929,56321 3164072929,56321
@ -13785,10 +13797,12 @@
3218443122,56321 3218443122,56321
3269126593,56321 3269126593,56321
3270983544,56321 3270983544,56321
3275082457,56321
3288105727,56321 3288105727,56321
3309861393,56321 3309861393,56321
3310322470,56321 3310322470,56321
3312199997,56321 3312199997,56321
3387414634,56321
3400353135,56321 3400353135,56321
3403941251,56321 3403941251,56321
3453584345,56321 3453584345,56321
@ -13796,6 +13810,7 @@
4060785478,56321 4060785478,56321
4062109631,56321 4062109631,56321
4541270393,56321 4541270393,56321
5080328229,56321
11194786363,56321 11194786363,56321
640320,56322 640320,56322
961017,56322 961017,56322
@ -13818,6 +13833,7 @@
26102189,56322 26102189,56322
26516263,56322 26516263,56322
27042865,56322 27042865,56322
27218524,56322
28667694,56322 28667694,56322
33358838,56322 33358838,56322
33822284,56322 33822284,56322
@ -14234,6 +14250,7 @@
2334362489,56322 2334362489,56322
2334642264,56322 2334642264,56322
2334685597,56322 2334685597,56322
2335686424,56322
2335911998,56322 2335911998,56322
2336951312,56322 2336951312,56322
2337333600,56322 2337333600,56322
@ -14375,6 +14392,7 @@
2454080715,56322 2454080715,56322
2454364226,56322 2454364226,56322
2549748974,56322 2549748974,56322
2784653609,56322
2807640082,56322 2807640082,56322
2820140348,56322 2820140348,56322
2943360015,56322 2943360015,56322
@ -14427,6 +14445,7 @@
3046734929,56322 3046734929,56322
3047432238,56322 3047432238,56322
3048263744,56322 3048263744,56322
3049563940,56322
3053428173,56322 3053428173,56322
3053827066,56322 3053827066,56322
3053874899,56322 3053874899,56322
@ -14528,6 +14547,7 @@
3269509541,56322 3269509541,56322
3270983544,56322 3270983544,56322
3272228873,56322 3272228873,56322
3275082457,56322
3276276473,56322 3276276473,56322
3276806203,56322 3276806203,56322
3280089923,56322 3280089923,56322
@ -14571,6 +14591,7 @@
3381895548,56322 3381895548,56322
3384021594,56322 3384021594,56322
3386142122,56322 3386142122,56322
3387414634,56322
3392439831,56322 3392439831,56322
3395273704,56322 3395273704,56322
3395544335,56322 3395544335,56322
@ -14613,6 +14634,7 @@
4314826963,56322 4314826963,56322
4342133203,56322 4342133203,56322
4518793468,56322 4518793468,56322
5080328229,56322
5170566512,56322 5170566512,56322
5227003959,56322 5227003959,56322
11163946716,56322 11163946716,56322
@ -14653,23 +14675,30 @@
515770253,56323 515770253,56323
519195163,56323 519195163,56323
578458519,56323 578458519,56323
579145151,56323
648145286,56323 648145286,56323
655053188,56323 655053188,56323
724699853,56323 724699853,56323
737770776,56323 737770776,56323
756272716,56323 756272716,56323
769007667,56323 769007667,56323
781863255,56323
828320335,56323 828320335,56323
830662620,56323 830662620,56323
835660918,56323 835660918,56323
928405229,56323
930767828,56323 930767828,56323
1020971686,56323 1020971686,56323
1171719000,56323 1171719000,56323
1196081613,56323 1196081613,56323
1281892063,56323
1283152579,56323
1307998566,56323 1307998566,56323
1320580022,56323
1420260418,56323 1420260418,56323
1428867455,56323 1428867455,56323
2310078704,56323 2310078704,56323
2311554061,56323
2313858141,56323 2313858141,56323
2313862397,56323 2313862397,56323
2316430101,56323 2316430101,56323
@ -14691,9 +14720,11 @@
2352536665,56323 2352536665,56323
2353049653,56323 2353049653,56323
2353542014,56323 2353542014,56323
2354579046,56323
2358443746,56323 2358443746,56323
2358890410,56323 2358890410,56323
2359644835,56323 2359644835,56323
2375567426,56323
2813351721,56323 2813351721,56323
2944851453,56323 2944851453,56323
2989110680,56323 2989110680,56323
@ -14707,6 +14738,7 @@
3145216638,56323 3145216638,56323
3147315589,56323 3147315589,56323
3148373610,56323 3148373610,56323
3157908852,56323
3178503917,56323 3178503917,56323
3190725108,56323 3190725108,56323
3194480206,56323 3194480206,56323
@ -14720,8 +14752,12 @@
3333770952,56323 3333770952,56323
3343051793,56323 3343051793,56323
3355136417,56323 3355136417,56323
3355311700,56323
3384021594,56323 3384021594,56323
3387414634,56323
3391580446,56323 3391580446,56323
3417211306,56323
3424960996,56323
3479493493,56323 3479493493,56323
4001232767,56323 4001232767,56323
4018874937,56323 4018874937,56323
@ -14729,8 +14765,14 @@
4132230808,56323 4132230808,56323
4518793468,56323 4518793468,56323
5075022186,56323 5075022186,56323
5080328229,56323
5268652928,56323
11169314959,56323
11196261229,56323 11196261229,56323
11198973632,56323 11198973632,56323
11201118913,56323
11202794098,56323
11222347815,56323
1452048,56341 1452048,56341
11807506,56341 11807506,56341
23463174,56341 23463174,56341
@ -15554,4 +15596,4 @@
4199627392,513742 4199627392,513742
5007987573,513742 5007987573,513742
5081045257,513742 5081045257,513742
11210240616,513742 11210240616,513742

1 Firm_Code Product_Code
6 7
7 7
2 29954548 7
3 169456313 7
4 771821595 7
5815 3375823631 2717
5816 3384021594 2717
5817 3384489464 2717
5818 3387414634 2717
5819 3391140557 2717
5820 3391580446 2717
5821 3394344425 2717
5853 4728160558 2717
5854 4977024731 2717
5855 5075022186 2717
5856 5080328229 2717
5857 5082745863 2717
5858 11174854725 2717
5859 11197373335 2717
5982 3339447871 2718
5983 3341201089 2718
5984 3393520654 2718
5985 3417211306 2718
5986 4050411188 2718
5987 1452048 32338
5988 2010673 32338
10025 2327979389 32441
10026 3226664625 32441
10027 3462551351 32441
10028 3315213370 32442
10029 829768 32443
10030 961017 32443
10031 6292428 32443
10098 3395900897 32443
10099 4187134530 32443
10100 5235871870 32443
10101 1273878359 32444
10102 863079 32445
10103 1452048 32445
10104 4928854 32445
10203 3359835624 32445
10204 3374200023 32445
10205 3383829951 32445
10206 3387414634 32445
10207 3407754893 32445
10208 3414432268 32445
10209 3417604299 32445
12704 1662628216 34566
12705 1718070442 34566
12706 2311333794 34566
12707 2311554061 34566
12708 2312469536 34566
12709 2313316346 34566
12710 2314838109 34566
12891 2707711529 34566
12892 2735580560 34566
12893 2745792038 34566
12894 2784653609 34566
12895 2787318020 34566
12896 2788202283 34566
12897 2794900565 34566
13434 3193452645 34574
13435 3240604547 34574
13436 3340308357 34574
13437 3387414634 34574
13438 3415340571 34574
13439 4114133480 34574
13440 5080328229 34574
13441 11209117004 34574
13442 5979030 36914
13443 5979313 36914
13724 18729611 56321
13725 25624519 56321
13726 26516263 56321
13727 27218524 56321
13728 27892215 56321
13729 42901962 56321
13730 57430434 56321
13771 2328469644 56321
13772 2329948539 56321
13773 2330435233 56321
13774 2335686424 56321
13775 2339188563 56321
13776 2342317074 56321
13777 2346409693 56321
13781 2388525637 56321
13782 2441725544 56321
13783 2568380877 56321
13784 2784653609 56321
13785 2985599329 56321
13786 3007255509 56321
13787 3019316903 56321
13788 3041197460 56321
13789 3049154839 56321
13790 3049563940 56321
13791 3121176272 56321
13792 3146829971 56321
13793 3164072929 56321
13797 3218443122 56321
13798 3269126593 56321
13799 3270983544 56321
13800 3275082457 56321
13801 3288105727 56321
13802 3309861393 56321
13803 3310322470 56321
13804 3312199997 56321
13805 3387414634 56321
13806 3400353135 56321
13807 3403941251 56321
13808 3453584345 56321
13810 4060785478 56321
13811 4062109631 56321
13812 4541270393 56321
13813 5080328229 56321
13814 11194786363 56321
13815 640320 56322
13816 961017 56322
13833 26102189 56322
13834 26516263 56322
13835 27042865 56322
13836 27218524 56322
13837 28667694 56322
13838 33358838 56322
13839 33822284 56322
14250 2334362489 56322
14251 2334642264 56322
14252 2334685597 56322
14253 2335686424 56322
14254 2335911998 56322
14255 2336951312 56322
14256 2337333600 56322
14392 2454080715 56322
14393 2454364226 56322
14394 2549748974 56322
14395 2784653609 56322
14396 2807640082 56322
14397 2820140348 56322
14398 2943360015 56322
14445 3046734929 56322
14446 3047432238 56322
14447 3048263744 56322
14448 3049563940 56322
14449 3053428173 56322
14450 3053827066 56322
14451 3053874899 56322
14547 3269509541 56322
14548 3270983544 56322
14549 3272228873 56322
14550 3275082457 56322
14551 3276276473 56322
14552 3276806203 56322
14553 3280089923 56322
14591 3381895548 56322
14592 3384021594 56322
14593 3386142122 56322
14594 3387414634 56322
14595 3392439831 56322
14596 3395273704 56322
14597 3395544335 56322
14634 4314826963 56322
14635 4342133203 56322
14636 4518793468 56322
14637 5080328229 56322
14638 5170566512 56322
14639 5227003959 56322
14640 11163946716 56322
14675 515770253 56323
14676 519195163 56323
14677 578458519 56323
14678 579145151 56323
14679 648145286 56323
14680 655053188 56323
14681 724699853 56323
14682 737770776 56323
14683 756272716 56323
14684 769007667 56323
14685 781863255 56323
14686 828320335 56323
14687 830662620 56323
14688 835660918 56323
14689 928405229 56323
14690 930767828 56323
14691 1020971686 56323
14692 1171719000 56323
14693 1196081613 56323
14694 1281892063 56323
14695 1283152579 56323
14696 1307998566 56323
14697 1320580022 56323
14698 1420260418 56323
14699 1428867455 56323
14700 2310078704 56323
14701 2311554061 56323
14702 2313858141 56323
14703 2313862397 56323
14704 2316430101 56323
14720 2352536665 56323
14721 2353049653 56323
14722 2353542014 56323
14723 2354579046 56323
14724 2358443746 56323
14725 2358890410 56323
14726 2359644835 56323
14727 2375567426 56323
14728 2813351721 56323
14729 2944851453 56323
14730 2989110680 56323
14738 3145216638 56323
14739 3147315589 56323
14740 3148373610 56323
14741 3157908852 56323
14742 3178503917 56323
14743 3190725108 56323
14744 3194480206 56323
14752 3333770952 56323
14753 3343051793 56323
14754 3355136417 56323
14755 3355311700 56323
14756 3384021594 56323
14757 3387414634 56323
14758 3391580446 56323
14759 3417211306 56323
14760 3424960996 56323
14761 3479493493 56323
14762 4001232767 56323
14763 4018874937 56323
14765 4132230808 56323
14766 4518793468 56323
14767 5075022186 56323
14768 5080328229 56323
14769 5268652928 56323
14770 11169314959 56323
14771 11196261229 56323
14772 11198973632 56323
14773 11201118913 56323
14774 11202794098 56323
14775 11222347815 56323
14776 1452048 56341
14777 11807506 56341
14778 23463174 56341
15596 4199627392 513742
15597 5007987573 513742
15598 5081045257 513742
15599 11210240616 513742

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
Code,Index,Name,产业种类 Code,Index,Name,产业种类
32338,7,硅原材料,0 32338,2,硅原材料,0
32445,8,光刻胶及其配套试剂,0 32445,8,光刻胶及其配套试剂,0
56341,9,蚀刻液,0 56341,9,蚀刻液,0
7,10,氟化硅,0 7,10,氟化硅,0
@ -101,4 +101,4 @@ Code,Index,Name,产业种类
34569,106,半导体塑封料,0 34569,106,半导体塑封料,0
34568,107,键合线,0 34568,107,键合线,0
34570,108,底部填充料,0 34570,108,底部填充料,0
34574,109,半导体切割材料,0 34574,109,半导体切割材料,0

1 Code Index Name 产业种类
2 32338 7 2 硅原材料 0
3 32445 8 光刻胶及其配套试剂 0
4 56341 9 蚀刻液 0
5 7 10 氟化硅 0
101 34569 106 半导体塑封料 0
102 34568 107 键合线 0
103 34570 108 底部填充料 0
104 34574 109 半导体切割材料 0

View File

@ -1,241 +1,241 @@
,产业id,消耗材料id 产业id,消耗材料id,消耗量
0,36914,32338 36914,47,255111.0204
1,36914,32338 36914,49,255111.0204
2,36914,32338 36914,44,255111.0204
3,36914,32440 36914,15,12136238.88
4,36914,46505 36914,18,255111.0204
5,36914,32446 36914,20,93744.7931
6,36914,32433 36914,22,75.22587792
7,36914,32443 36914,23,25897.2899
8,36914,32435 36914,25,324.0499357
9,36914,32439 36914,31,361.9578012
10,36914,56321 36914,36,90.93237991
11,36914,32440 36914,15,12136238.88
12,36914,46505 36914,18,255111.0204
13,36914,32446 36914,20,93744.7931
14,36914,32433 36914,22,75.22587792
15,36914,32443 36914,23,25897.2899
16,36914,32435 36914,25,324.0499357
17,36914,32439 36914,31,361.9578012
18,36914,32338 36914,46,255111.0204
19,32338,32338 32338,2,255111.0204
20,32338,32440 32338,15,12136238.88
21,32338,46505 32338,18,255111.0204
22,32338,32446 32338,20,93744.7931
23,32338,32433 32338,22,75.22587792
24,32338,32443 32338,23,25897.2899
25,32338,32435 32338,25,324.0499357
26,32338,32438 32338,27,251973.3182
27,32338,32338 32338,2,255111.0204
28,32338,32440 32338,15,12136238.88
29,32338,46505 32338,18,255111.0204
30,32338,32446 32338,20,93744.7931
31,32338,32433 32338,22,75.22587792
32,32338,32443 32338,23,25897.2899
33,32338,32435 32338,25,324.0499357
34,32338,32438 32338,27,251973.3182
35,32338,32440 32338,15,12136238.88
36,32338,46505 32338,18,255111.0204
37,32338,32446 32338,20,93744.7931
38,32338,32433 32338,22,75.22587792
39,32338,32443 32338,23,25897.2899
40,32338,32435 32338,25,324.0499357
41,32338,32438 32338,27,251973.3182
42,32338,56320 32338,32,54.21991745
43,32338,32440 32338,15,12136238.88
44,32338,46505 32338,18,255111.0204
45,32338,32446 32338,20,93744.7931
46,32338,32433 32338,22,75.22587792
47,32338,32443 32338,23,25897.2899
48,32338,32435 32338,25,324.0499357
49,32338,32438 32338,27,251973.3182
50,32338,56322 32338,33,153200.7295
51,32338,32440 32338,15,12136238.88
52,32338,46505 32338,18,255111.0204
53,32338,32446 32338,20,93744.7931
54,32338,32433 32338,22,75.22587792
55,32338,32443 32338,23,25897.2899
56,32338,32435 32338,25,324.0499357
57,32338,32438 32338,27,251973.3182
58,32338,56319 32338,34,1.058122239
59,32338,32440 32338,15,12136238.88
60,32338,46505 32338,18,255111.0204
61,32338,32446 32338,20,93744.7931
62,32338,32433 32338,22,75.22587792
63,32338,32443 32338,23,25897.2899
64,32338,32435 32338,25,324.0499357
65,32338,32438 32338,27,251973.3182
66,32338,56323 32338,35,1973.630646
67,32338,32449 32338,19,41.8950274
68,32338,32446 32338,20,93744.7931
69,32338,32433 32338,22,75.22587792
70,32338,32443 32338,23,25897.2899
71,32338,32435 32338,25,324.0499357
72,32338,32447 32338,28,501.5058528
73,32338,32436 32338,29,17085.44484
74,32338,32438 32338,27,251973.3182
75,32338,36914 32338,40,202.540151
76,32338,32449 32338,19,41.8950274
77,32338,32446 32338,20,93744.7931
78,32338,32433 32338,22,75.22587792
79,32338,32443 32338,23,25897.2899
80,32338,32435 32338,25,324.0499357
81,32338,32447 32338,28,501.5058528
82,32338,32436 32338,29,17085.44484
83,32338,32438 32338,27,251973.3182
84,32338,36914 32338,38,202.540151
85,32338,32449 32338,19,41.8950274
86,32338,32446 32338,20,93744.7931
87,32338,32433 32338,22,75.22587792
88,32338,32443 32338,23,25897.2899
89,32338,32435 32338,25,324.0499357
90,32338,32447 32338,28,501.5058528
91,32338,32436 32338,29,17085.44484
92,32338,32438 32338,27,251973.3182
93,32338,36914 32338,41,202.540151
94,32338,32449 32338,19,41.8950274
95,32338,32446 32338,20,93744.7931
96,32338,32433 32338,22,75.22587792
97,32338,32443 32338,23,25897.2899
98,32338,32435 32338,25,324.0499357
99,32338,32447 32338,28,501.5058528
100,32338,32436 32338,29,17085.44484
101,32338,32438 32338,27,251973.3182
102,32338,36914 32338,39,202.540151
103,32338,32449 32338,19,41.8950274
104,32338,32446 32338,20,93744.7931
105,32338,32433 32338,22,75.22587792
106,32338,32443 32338,23,25897.2899
107,32338,32435 32338,25,324.0499357
108,32338,32447 32338,28,501.5058528
109,32338,32436 32338,29,17085.44484
110,32338,32438 32338,27,251973.3182
111,32338,36914 32338,43,202.540151
112,32338,32449 32338,19,41.8950274
113,32338,32446 32338,20,93744.7931
114,32338,32433 32338,22,75.22587792
115,32338,32443 32338,23,25897.2899
116,32338,32435 32338,25,324.0499357
117,32338,32447 32338,28,501.5058528
118,32338,32436 32338,29,17085.44484
119,32338,32438 32338,27,251973.3182
120,32338,36914 32338,42,202.540151
121,2717,32338 2717,2,255111.0204
122,2717,32445 2717,8,361.9578012
123,2717,56341 2717,9,255111.0204
124,2717,7 2717,10,950.9542139
125,2717,46504 2717,11,361.9578012
126,2717,32451 2717,17,2420351.677
127,2717,32449 2717,19,41.8950274
128,2717,32446 2717,20,93744.7931
129,2717,32442 2717,21,121.8232841
130,2717,32443 2717,23,25897.2899
131,2717,32450 2717,24,8314.140278
132,2717,32435 2717,25,324.0499357
133,2717,32447 2717,28,501.5058528
134,2717,32439 2717,31,361.9578012
135,2717,32338 2717,44,255111.0204
136,2717,32338 2717,45,255111.0204
137,2714,32445 2714,8,361.9578012
138,2714,56341 2714,9,255111.0204
139,2714,7 2714,10,950.9542139
140,2714,46504 2714,11,361.9578012
141,2714,32451 2714,17,2420351.677
142,2714,46505 2714,18,255111.0204
143,2714,32449 2714,19,41.8950274
144,2714,32446 2714,20,93744.7931
145,2714,32443 2714,23,25897.2899
146,2714,32450 2714,24,8314.140278
147,2714,32447 2714,28,501.5058528
148,2714,32439 2714,31,361.9578012
149,2715,32445 2715,8,361.9578012
150,2715,56341 2715,9,255111.0204
151,2715,7 2715,10,950.9542139
152,2715,46504 2715,11,361.9578012
153,2715,32451 2715,17,2420351.677
154,2715,46505 2715,18,255111.0204
155,2715,32449 2715,19,41.8950274
156,2715,32446 2715,20,93744.7931
157,2715,32443 2715,23,25897.2899
158,2715,32450 2715,24,8314.140278
159,2715,32447 2715,28,501.5058528
160,2715,32439 2715,31,361.9578012
161,2716,32445 2716,8,361.9578012
162,2716,56341 2716,9,255111.0204
163,2716,7 2716,10,950.9542139
164,2716,46504 2716,11,361.9578012
165,2716,32451 2716,17,2420351.677
166,2716,46505 2716,18,255111.0204
167,2716,32449 2716,19,41.8950274
168,2716,32446 2716,20,93744.7931
169,2716,32443 2716,23,25897.2899
170,2716,32450 2716,24,8314.140278
171,2716,32447 2716,28,501.5058528
172,2716,32439 2716,31,361.9578012
173,2718,32445 2718,8,361.9578012
174,2718,56341 2718,9,255111.0204
175,2718,7 2718,10,950.9542139
176,2718,46504 2718,11,361.9578012
177,2718,32451 2718,17,2420351.677
178,2718,46505 2718,18,255111.0204
179,2718,32449 2718,19,41.8950274
180,2718,32446 2718,20,93744.7931
181,2718,32443 2718,23,25897.2899
182,2718,32450 2718,24,8314.140278
183,2718,32447 2718,28,501.5058528
184,2718,32439 2718,31,361.9578012
185,317589,32445 317589,8,361.9578012
186,317589,56341 317589,9,255111.0204
187,317589,7 317589,10,950.9542139
188,317589,46504 317589,11,361.9578012
189,317589,32434 317589,12,12136238.88
190,317589,32441 317589,13,815.5392074
191,317589,32444 317589,14,4.812205136
192,317589,32440 317589,15,12136238.88
193,317589,32432 317589,16,330.6631997
194,317589,32451 317589,17,2420351.677
195,317589,46505 317589,18,255111.0204
196,317589,32449 317589,19,41.8950274
197,317589,32446 317589,20,93744.7931
198,317589,32442 317589,21,121.8232841
199,317589,32433 317589,22,75.22587792
200,317589,32443 317589,23,25897.2899
201,317589,32450 317589,24,8314.140278
202,317589,32435 317589,25,324.0499357
203,317589,32437 317589,26,53770.08531
204,317589,32438 317589,27,251973.3182
205,317589,32447 317589,28,501.5058528
206,317589,32436 317589,29,17085.44484
207,317589,32448 317589,30,255111.0204
208,317589,32439 317589,31,361.9578012
209,317589,8 317589,37,1155.484342
210,317589,32338 317589,44,255111.0204
211,317589,32338 317589,45,255111.0204
212,317589,32338 317589,46,255111.0204
213,317589,32338 317589,47,255111.0204
214,317589,32338 317589,48,255111.0204
215,317589,32338 317589,49,255111.0204
216,317589,32338 317589,50,255111.0204
217,317589,32338 317589,51,255111.0204
218,317589,32338 317589,52,255111.0204
219,317589,32338 317589,53,255111.0204
220,317589,32338 317589,54,255111.0204
221,317589,32338 317589,55,255111.0204
222,317589,2717 317589,90,0.826657999
223,317589,2714 317589,91,0.826657999
224,317589,2715 317589,92,1.928868665
225,317589,2716 317589,93,0.826657999
226,317589,2718 317589,94,16438.82054
227,10,317589 10,95,55482.385
228,10,34573 10,101,7178.474475
229,10,34571 10,102,314.0388569
230,10,34567 10,103,552.0321994
231,10,34572 10,104,865.399695
232,10,34566 10,105,361.9578012
233,10,34569 10,106,272.0475731
234,10,34568 10,107,41.8950274
235,10,34570 10,108,8.783241241
236,10,34574 10,109,153200.7295
237,513740,317589 513740,95,55482.385
238,513742,317589 513742,95,55482.385
239,11,317589 11,95,55482.385

1 产业id 消耗材料id 消耗量
2 0 36914 32338 47 255111.0204
3 1 36914 32338 49 255111.0204
4 2 36914 32338 44 255111.0204
5 3 36914 32440 15 12136238.88
6 4 36914 46505 18 255111.0204
7 5 36914 32446 20 93744.7931
8 6 36914 32433 22 75.22587792
9 7 36914 32443 23 25897.2899
10 8 36914 32435 25 324.0499357
11 9 36914 32439 31 361.9578012
12 10 36914 56321 36 90.93237991
13 11 36914 32440 15 12136238.88
14 12 36914 46505 18 255111.0204
15 13 36914 32446 20 93744.7931
16 14 36914 32433 22 75.22587792
17 15 36914 32443 23 25897.2899
18 16 36914 32435 25 324.0499357
19 17 36914 32439 31 361.9578012
20 18 36914 32338 46 255111.0204
21 19 32338 32338 2 255111.0204
22 20 32338 32440 15 12136238.88
23 21 32338 46505 18 255111.0204
24 22 32338 32446 20 93744.7931
25 23 32338 32433 22 75.22587792
26 24 32338 32443 23 25897.2899
27 25 32338 32435 25 324.0499357
28 26 32338 32438 27 251973.3182
29 27 32338 32338 2 255111.0204
30 28 32338 32440 15 12136238.88
31 29 32338 46505 18 255111.0204
32 30 32338 32446 20 93744.7931
33 31 32338 32433 22 75.22587792
34 32 32338 32443 23 25897.2899
35 33 32338 32435 25 324.0499357
36 34 32338 32438 27 251973.3182
37 35 32338 32440 15 12136238.88
38 36 32338 46505 18 255111.0204
39 37 32338 32446 20 93744.7931
40 38 32338 32433 22 75.22587792
41 39 32338 32443 23 25897.2899
42 40 32338 32435 25 324.0499357
43 41 32338 32438 27 251973.3182
44 42 32338 56320 32 54.21991745
45 43 32338 32440 15 12136238.88
46 44 32338 46505 18 255111.0204
47 45 32338 32446 20 93744.7931
48 46 32338 32433 22 75.22587792
49 47 32338 32443 23 25897.2899
50 48 32338 32435 25 324.0499357
51 49 32338 32438 27 251973.3182
52 50 32338 56322 33 153200.7295
53 51 32338 32440 15 12136238.88
54 52 32338 46505 18 255111.0204
55 53 32338 32446 20 93744.7931
56 54 32338 32433 22 75.22587792
57 55 32338 32443 23 25897.2899
58 56 32338 32435 25 324.0499357
59 57 32338 32438 27 251973.3182
60 58 32338 56319 34 1.058122239
61 59 32338 32440 15 12136238.88
62 60 32338 46505 18 255111.0204
63 61 32338 32446 20 93744.7931
64 62 32338 32433 22 75.22587792
65 63 32338 32443 23 25897.2899
66 64 32338 32435 25 324.0499357
67 65 32338 32438 27 251973.3182
68 66 32338 56323 35 1973.630646
69 67 32338 32449 19 41.8950274
70 68 32338 32446 20 93744.7931
71 69 32338 32433 22 75.22587792
72 70 32338 32443 23 25897.2899
73 71 32338 32435 25 324.0499357
74 72 32338 32447 28 501.5058528
75 73 32338 32436 29 17085.44484
76 74 32338 32438 27 251973.3182
77 75 32338 36914 40 202.540151
78 76 32338 32449 19 41.8950274
79 77 32338 32446 20 93744.7931
80 78 32338 32433 22 75.22587792
81 79 32338 32443 23 25897.2899
82 80 32338 32435 25 324.0499357
83 81 32338 32447 28 501.5058528
84 82 32338 32436 29 17085.44484
85 83 32338 32438 27 251973.3182
86 84 32338 36914 38 202.540151
87 85 32338 32449 19 41.8950274
88 86 32338 32446 20 93744.7931
89 87 32338 32433 22 75.22587792
90 88 32338 32443 23 25897.2899
91 89 32338 32435 25 324.0499357
92 90 32338 32447 28 501.5058528
93 91 32338 32436 29 17085.44484
94 92 32338 32438 27 251973.3182
95 93 32338 36914 41 202.540151
96 94 32338 32449 19 41.8950274
97 95 32338 32446 20 93744.7931
98 96 32338 32433 22 75.22587792
99 97 32338 32443 23 25897.2899
100 98 32338 32435 25 324.0499357
101 99 32338 32447 28 501.5058528
102 100 32338 32436 29 17085.44484
103 101 32338 32438 27 251973.3182
104 102 32338 36914 39 202.540151
105 103 32338 32449 19 41.8950274
106 104 32338 32446 20 93744.7931
107 105 32338 32433 22 75.22587792
108 106 32338 32443 23 25897.2899
109 107 32338 32435 25 324.0499357
110 108 32338 32447 28 501.5058528
111 109 32338 32436 29 17085.44484
112 110 32338 32438 27 251973.3182
113 111 32338 36914 43 202.540151
114 112 32338 32449 19 41.8950274
115 113 32338 32446 20 93744.7931
116 114 32338 32433 22 75.22587792
117 115 32338 32443 23 25897.2899
118 116 32338 32435 25 324.0499357
119 117 32338 32447 28 501.5058528
120 118 32338 32436 29 17085.44484
121 119 32338 32438 27 251973.3182
122 120 32338 36914 42 202.540151
123 121 2717 32338 2 255111.0204
124 122 2717 32445 8 361.9578012
125 123 2717 56341 9 255111.0204
126 124 2717 7 10 950.9542139
127 125 2717 46504 11 361.9578012
128 126 2717 32451 17 2420351.677
129 127 2717 32449 19 41.8950274
130 128 2717 32446 20 93744.7931
131 129 2717 32442 21 121.8232841
132 130 2717 32443 23 25897.2899
133 131 2717 32450 24 8314.140278
134 132 2717 32435 25 324.0499357
135 133 2717 32447 28 501.5058528
136 134 2717 32439 31 361.9578012
137 135 2717 32338 44 255111.0204
138 136 2717 32338 45 255111.0204
139 137 2714 32445 8 361.9578012
140 138 2714 56341 9 255111.0204
141 139 2714 7 10 950.9542139
142 140 2714 46504 11 361.9578012
143 141 2714 32451 17 2420351.677
144 142 2714 46505 18 255111.0204
145 143 2714 32449 19 41.8950274
146 144 2714 32446 20 93744.7931
147 145 2714 32443 23 25897.2899
148 146 2714 32450 24 8314.140278
149 147 2714 32447 28 501.5058528
150 148 2714 32439 31 361.9578012
151 149 2715 32445 8 361.9578012
152 150 2715 56341 9 255111.0204
153 151 2715 7 10 950.9542139
154 152 2715 46504 11 361.9578012
155 153 2715 32451 17 2420351.677
156 154 2715 46505 18 255111.0204
157 155 2715 32449 19 41.8950274
158 156 2715 32446 20 93744.7931
159 157 2715 32443 23 25897.2899
160 158 2715 32450 24 8314.140278
161 159 2715 32447 28 501.5058528
162 160 2715 32439 31 361.9578012
163 161 2716 32445 8 361.9578012
164 162 2716 56341 9 255111.0204
165 163 2716 7 10 950.9542139
166 164 2716 46504 11 361.9578012
167 165 2716 32451 17 2420351.677
168 166 2716 46505 18 255111.0204
169 167 2716 32449 19 41.8950274
170 168 2716 32446 20 93744.7931
171 169 2716 32443 23 25897.2899
172 170 2716 32450 24 8314.140278
173 171 2716 32447 28 501.5058528
174 172 2716 32439 31 361.9578012
175 173 2718 32445 8 361.9578012
176 174 2718 56341 9 255111.0204
177 175 2718 7 10 950.9542139
178 176 2718 46504 11 361.9578012
179 177 2718 32451 17 2420351.677
180 178 2718 46505 18 255111.0204
181 179 2718 32449 19 41.8950274
182 180 2718 32446 20 93744.7931
183 181 2718 32443 23 25897.2899
184 182 2718 32450 24 8314.140278
185 183 2718 32447 28 501.5058528
186 184 2718 32439 31 361.9578012
187 185 317589 32445 8 361.9578012
188 186 317589 56341 9 255111.0204
189 187 317589 7 10 950.9542139
190 188 317589 46504 11 361.9578012
191 189 317589 32434 12 12136238.88
192 190 317589 32441 13 815.5392074
193 191 317589 32444 14 4.812205136
194 192 317589 32440 15 12136238.88
195 193 317589 32432 16 330.6631997
196 194 317589 32451 17 2420351.677
197 195 317589 46505 18 255111.0204
198 196 317589 32449 19 41.8950274
199 197 317589 32446 20 93744.7931
200 198 317589 32442 21 121.8232841
201 199 317589 32433 22 75.22587792
202 200 317589 32443 23 25897.2899
203 201 317589 32450 24 8314.140278
204 202 317589 32435 25 324.0499357
205 203 317589 32437 26 53770.08531
206 204 317589 32438 27 251973.3182
207 205 317589 32447 28 501.5058528
208 206 317589 32436 29 17085.44484
209 207 317589 32448 30 255111.0204
210 208 317589 32439 31 361.9578012
211 209 317589 8 37 1155.484342
212 210 317589 32338 44 255111.0204
213 211 317589 32338 45 255111.0204
214 212 317589 32338 46 255111.0204
215 213 317589 32338 47 255111.0204
216 214 317589 32338 48 255111.0204
217 215 317589 32338 49 255111.0204
218 216 317589 32338 50 255111.0204
219 217 317589 32338 51 255111.0204
220 218 317589 32338 52 255111.0204
221 219 317589 32338 53 255111.0204
222 220 317589 32338 54 255111.0204
223 221 317589 32338 55 255111.0204
224 222 317589 2717 90 0.826657999
225 223 317589 2714 91 0.826657999
226 224 317589 2715 92 1.928868665
227 225 317589 2716 93 0.826657999
228 226 317589 2718 94 16438.82054
229 227 10 317589 95 55482.385
230 228 10 34573 101 7178.474475
231 229 10 34571 102 314.0388569
232 230 10 34567 103 552.0321994
233 231 10 34572 104 865.399695
234 232 10 34566 105 361.9578012
235 233 10 34569 106 272.0475731
236 234 10 34568 107 41.8950274
237 235 10 34570 108 8.783241241
238 236 10 34574 109 153200.7295
239 237 513740 317589 95 55482.385
240 238 513742 317589 95 55482.385
241 239 11 317589 95 55482.385

View File

@ -1,382 +1,216 @@
,产业id,制造产品id 产业id,制造产品id,制造量
0,2714,8 0,182,314
1,2714,9 1,152,869
2,2714,10 1,187,591
3,2714,11 2,132,559
4,2714,17 3,158,610
5,2714,18 3,141,575
6,2714,19 3,159,882
7,2714,20 4,163,604
8,2714,23 4,102,584
9,2714,24 4,150,746
10,2714,28 5,103,700
11,2714,31 5,159,113
12,2714,58 6,159,554
13,2714,59 6,143,608
14,2714,61 6,107,134
15,2714,62 7,105,665
16,2714,65 7,103,921
17,2714,66 8,143,261
18,2714,70 8,173,369
19,2715,8 9,179,848
20,2715,9 10,140,256
21,2715,10 11,107,571
22,2715,11 12,104,589
23,2715,17 12,140,127
24,2715,18 12,106,300
25,2715,19 13,198,783
26,2715,20 14,146,561
27,2715,23 15,108,306
28,2715,24 15,114,957
29,2715,28 15,141,991
30,2715,31 16,151,195
31,2715,58 16,103,833
32,2715,59 16,200,506
33,2715,61 17,158,342
34,2715,62 17,185,895
35,2715,65 17,165,781
36,2715,66 18,105,895
37,2715,70 19,196,484
38,2716,8 19,126,732
39,2716,9 20,171,510
40,2716,10 20,108,417
41,2716,11 21,143,763
42,2716,17 21,178,926
43,2716,18 22,161,596
44,2716,19 23,200,724
45,2716,20 23,155,180
46,2716,23 23,158,212
47,2716,24 24,195,324
48,2716,28 25,152,783
49,2716,31 25,189,771
50,2716,58 26,155,222
51,2716,59 26,116,866
52,2716,61 26,137,379
53,2716,62 27,110,610
54,2716,65 27,115,708
55,2716,66 28,102,759
56,2716,70 29,151,588
57,2717,2 29,132,739
58,2717,8 29,138,437
59,2717,9 30,149,250
60,2717,10 31,159,980
61,2717,11 32,108,332
62,2717,17 32,198,758
63,2717,19 32,147,307
64,2717,20 33,171,519
65,2717,21 33,137,203
66,2717,23 33,183,353
67,2717,24 34,181,805
68,2717,25 34,153,262
69,2717,28 35,113,376
70,2717,31 36,185,474
71,2717,44 36,121,849
72,2717,45 36,129,137
73,2717,58 37,197,376
74,2717,59 37,129,708
75,2717,60 37,127,978
76,2717,61 38,103,646
77,2717,62 38,163,148
78,2717,65 38,116,271
79,2717,66 39,136,379
80,2717,67 40,198,799
81,2717,68 40,196,215
82,2718,8 40,162,352
83,2718,9 41,117,892
84,2718,10 41,194,665
85,2718,11 41,157,422
86,2718,17 42,122,738
87,2718,18 42,126,589
88,2718,19 43,147,138
89,2718,20 43,192,781
90,2718,23 43,125,966
91,2718,24 44,106,924
92,2718,28 44,135,784
93,2718,31 45,175,982
94,2718,58 45,186,242
95,2718,59 46,150,764
96,2718,61 46,157,674
97,2718,62 47,151,781
98,2718,65 48,107,152
99,2718,66 49,195,983
100,2718,70 50,129,758
101,32338,2 51,154,445
102,32338,15 51,200,573
103,32338,18 52,108,740
104,32338,20 52,157,733
105,32338,22 52,100,850
106,32338,23 53,100,371
107,32338,25 54,121,960
108,32338,27 55,128,319
109,32338,64 56,161,552
110,32338,67 56,175,317
111,32338,60 57,193,456
112,32338,65 58,109,861
113,32338,71 58,118,541
114,32338,2 58,195,868
115,32338,15 59,101,596
116,32338,18 59,191,995
117,32338,20 59,131,574
118,32338,22 60,150,526
119,32338,23 61,132,267
120,32338,25 62,145,997
121,32338,27 62,134,826
122,32338,64 62,180,189
123,32338,67 63,133,214
124,32338,60 63,106,295
125,32338,65 64,135,493
126,32338,71 65,148,198
127,32338,15 65,135,195
128,32338,18 65,123,762
129,32338,20 66,112,378
130,32338,22 66,188,966
131,32338,23 66,129,372
132,32338,25 67,185,496
133,32338,27 68,175,364
134,32338,32 68,170,895
135,32338,64 68,177,834
136,32338,67 69,184,583
137,32338,60 69,152,250
138,32338,65 69,115,668
139,32338,71 70,104,262
140,32338,15 70,186,832
141,32338,18 71,106,273
142,32338,20 72,149,894
143,32338,22 73,182,747
144,32338,23 73,164,441
145,32338,25 74,103,903
146,32338,27 75,138,190
147,32338,33 75,173,957
148,32338,64 76,157,759
149,32338,67 76,191,555
150,32338,60 77,176,447
151,32338,65 77,161,604
152,32338,71 77,162,607
153,32338,15 78,137,216
154,32338,18 79,160,914
155,32338,20 80,174,863
156,32338,22 81,119,540
157,32338,23 81,117,146
158,32338,25 81,148,625
159,32338,27 82,156,111
160,32338,34 82,173,835
161,32338,64 82,115,457
162,32338,67 83,107,797
163,32338,60 83,159,277
164,32338,65 84,162,244
165,32338,71 84,172,823
166,32338,15 84,176,831
167,32338,18 85,105,693
168,32338,20 85,168,914
169,32338,22 85,124,549
170,32338,23 86,164,245
171,32338,25 87,158,894
172,32338,27 87,148,560
173,32338,35 88,100,504
174,32338,64 88,154,617
175,32338,67 88,191,808
176,32338,60 89,173,557
177,32338,65 90,176,871
178,32338,71 91,171,650
179,32338,19 91,125,349
180,32338,20 91,133,537
181,32338,22 92,153,335
182,32338,23 93,156,500
183,32338,25 93,146,306
184,32338,28 93,200,952
185,32338,29 94,163,863
186,32338,27 94,197,905
187,32338,40 95,150,546
188,32338,60 95,197,407
189,32338,62 95,137,580
190,32338,63 96,155,500
191,32338,64 96,173,884
192,32338,65 97,165,304
193,32338,67 98,122,282
194,32338,68 98,179,194
195,32338,69 98,174,473
196,32338,71 99,126,192
197,32338,72 99,131,160
198,32338,19 99,150,502
199,32338,20 100,160,633
200,32338,22 100,120,937
201,32338,23 101,145,645
202,32338,25 101,148,177
203,32338,28 102,146,220
204,32338,29 103,180,125
205,32338,27 104,151,818
206,32338,38 104,146,738
207,32338,60 104,155,825
208,32338,62 105,125,625
209,32338,63 105,158,411
210,32338,64 106,114,291
211,32338,65 106,188,730
212,32338,67 106,200,127
213,32338,68 107,189,225
214,32338,69 107,143,636
215,32338,71
216,32338,72
217,32338,19
218,32338,20
219,32338,22
220,32338,23
221,32338,25
222,32338,28
223,32338,29
224,32338,27
225,32338,41
226,32338,60
227,32338,62
228,32338,63
229,32338,64
230,32338,65
231,32338,67
232,32338,68
233,32338,69
234,32338,71
235,32338,72
236,32338,19
237,32338,20
238,32338,22
239,32338,23
240,32338,25
241,32338,28
242,32338,29
243,32338,27
244,32338,39
245,32338,60
246,32338,62
247,32338,63
248,32338,64
249,32338,65
250,32338,67
251,32338,68
252,32338,69
253,32338,71
254,32338,72
255,32338,19
256,32338,20
257,32338,22
258,32338,23
259,32338,25
260,32338,28
261,32338,29
262,32338,27
263,32338,43
264,32338,60
265,32338,62
266,32338,63
267,32338,64
268,32338,65
269,32338,67
270,32338,68
271,32338,69
272,32338,71
273,32338,72
274,32338,19
275,32338,20
276,32338,22
277,32338,23
278,32338,25
279,32338,28
280,32338,29
281,32338,27
282,32338,42
283,32338,60
284,32338,62
285,32338,63
286,32338,64
287,32338,65
288,32338,67
289,32338,68
290,32338,69
291,32338,71
292,32338,72
293,36914,47
294,36914,49
295,36914,44
296,36914,15
297,36914,18
298,36914,20
299,36914,22
300,36914,23
301,36914,25
302,36914,31
303,36914,36
304,36914,64
305,36914,67
306,36914,60
307,36914,65
308,36914,71
309,36914,15
310,36914,18
311,36914,20
312,36914,22
313,36914,23
314,36914,25
315,36914,31
316,36914,64
317,36914,67
318,36914,60
319,36914,65
320,36914,71
321,36914,46
322,317589,8
323,317589,9
324,317589,10
325,317589,11
326,317589,12
327,317589,13
328,317589,14
329,317589,15
330,317589,16
331,317589,17
332,317589,18
333,317589,19
334,317589,20
335,317589,21
336,317589,22
337,317589,23
338,317589,24
339,317589,25
340,317589,26
341,317589,27
342,317589,28
343,317589,29
344,317589,30
345,317589,31
346,317589,37
347,317589,44
348,317589,45
349,317589,46
350,317589,47
351,317589,48
352,317589,49
353,317589,50
354,317589,51
355,317589,52
356,317589,53
357,317589,54
358,317589,55
359,317589,58
360,317589,59
361,317589,60
362,317589,61
363,317589,62
364,317589,63
365,317589,64
366,317589,65
367,317589,66
368,317589,67
369,317589,68
370,317589,69
371,317589,70
372,317589,71
373,317589,72
374,317589,73
375,317589,74
376,317589,90
377,317589,91
378,317589,92
379,317589,93
380,317589,94

1 产业id 制造产品id 制造量
2 0 2714 0 8 182 314
3 1 2714 1 9 152 869
4 2 2714 1 10 187 591
5 3 2714 2 11 132 559
6 4 2714 3 17 158 610
7 5 2714 3 18 141 575
8 6 2714 3 19 159 882
9 7 2714 4 20 163 604
10 8 2714 4 23 102 584
11 9 2714 4 24 150 746
12 10 2714 5 28 103 700
13 11 2714 5 31 159 113
14 12 2714 6 58 159 554
15 13 2714 6 59 143 608
16 14 2714 6 61 107 134
17 15 2714 7 62 105 665
18 16 2714 7 65 103 921
19 17 2714 8 66 143 261
20 18 2714 8 70 173 369
21 19 2715 9 8 179 848
22 20 2715 10 9 140 256
23 21 2715 11 10 107 571
24 22 2715 12 11 104 589
25 23 2715 12 17 140 127
26 24 2715 12 18 106 300
27 25 2715 13 19 198 783
28 26 2715 14 20 146 561
29 27 2715 15 23 108 306
30 28 2715 15 24 114 957
31 29 2715 15 28 141 991
32 30 2715 16 31 151 195
33 31 2715 16 58 103 833
34 32 2715 16 59 200 506
35 33 2715 17 61 158 342
36 34 2715 17 62 185 895
37 35 2715 17 65 165 781
38 36 2715 18 66 105 895
39 37 2715 19 70 196 484
40 38 2716 19 8 126 732
41 39 2716 20 9 171 510
42 40 2716 20 10 108 417
43 41 2716 21 11 143 763
44 42 2716 21 17 178 926
45 43 2716 22 18 161 596
46 44 2716 23 19 200 724
47 45 2716 23 20 155 180
48 46 2716 23 23 158 212
49 47 2716 24 24 195 324
50 48 2716 25 28 152 783
51 49 2716 25 31 189 771
52 50 2716 26 58 155 222
53 51 2716 26 59 116 866
54 52 2716 26 61 137 379
55 53 2716 27 62 110 610
56 54 2716 27 65 115 708
57 55 2716 28 66 102 759
58 56 2716 29 70 151 588
59 57 2717 29 2 132 739
60 58 2717 29 8 138 437
61 59 2717 30 9 149 250
62 60 2717 31 10 159 980
63 61 2717 32 11 108 332
64 62 2717 32 17 198 758
65 63 2717 32 19 147 307
66 64 2717 33 20 171 519
67 65 2717 33 21 137 203
68 66 2717 33 23 183 353
69 67 2717 34 24 181 805
70 68 2717 34 25 153 262
71 69 2717 35 28 113 376
72 70 2717 36 31 185 474
73 71 2717 36 44 121 849
74 72 2717 36 45 129 137
75 73 2717 37 58 197 376
76 74 2717 37 59 129 708
77 75 2717 37 60 127 978
78 76 2717 38 61 103 646
79 77 2717 38 62 163 148
80 78 2717 38 65 116 271
81 79 2717 39 66 136 379
82 80 2717 40 67 198 799
83 81 2717 40 68 196 215
84 82 2718 40 8 162 352
85 83 2718 41 9 117 892
86 84 2718 41 10 194 665
87 85 2718 41 11 157 422
88 86 2718 42 17 122 738
89 87 2718 42 18 126 589
90 88 2718 43 19 147 138
91 89 2718 43 20 192 781
92 90 2718 43 23 125 966
93 91 2718 44 24 106 924
94 92 2718 44 28 135 784
95 93 2718 45 31 175 982
96 94 2718 45 58 186 242
97 95 2718 46 59 150 764
98 96 2718 46 61 157 674
99 97 2718 47 62 151 781
100 98 2718 48 65 107 152
101 99 2718 49 66 195 983
102 100 2718 50 70 129 758
103 101 32338 51 2 154 445
104 102 32338 51 15 200 573
105 103 32338 52 18 108 740
106 104 32338 52 20 157 733
107 105 32338 52 22 100 850
108 106 32338 53 23 100 371
109 107 32338 54 25 121 960
110 108 32338 55 27 128 319
111 109 32338 56 64 161 552
112 110 32338 56 67 175 317
113 111 32338 57 60 193 456
114 112 32338 58 65 109 861
115 113 32338 58 71 118 541
116 114 32338 58 2 195 868
117 115 32338 59 15 101 596
118 116 32338 59 18 191 995
119 117 32338 59 20 131 574
120 118 32338 60 22 150 526
121 119 32338 61 23 132 267
122 120 32338 62 25 145 997
123 121 32338 62 27 134 826
124 122 32338 62 64 180 189
125 123 32338 63 67 133 214
126 124 32338 63 60 106 295
127 125 32338 64 65 135 493
128 126 32338 65 71 148 198
129 127 32338 65 15 135 195
130 128 32338 65 18 123 762
131 129 32338 66 20 112 378
132 130 32338 66 22 188 966
133 131 32338 66 23 129 372
134 132 32338 67 25 185 496
135 133 32338 68 27 175 364
136 134 32338 68 32 170 895
137 135 32338 68 64 177 834
138 136 32338 69 67 184 583
139 137 32338 69 60 152 250
140 138 32338 69 65 115 668
141 139 32338 70 71 104 262
142 140 32338 70 15 186 832
143 141 32338 71 18 106 273
144 142 32338 72 20 149 894
145 143 32338 73 22 182 747
146 144 32338 73 23 164 441
147 145 32338 74 25 103 903
148 146 32338 75 27 138 190
149 147 32338 75 33 173 957
150 148 32338 76 64 157 759
151 149 32338 76 67 191 555
152 150 32338 77 60 176 447
153 151 32338 77 65 161 604
154 152 32338 77 71 162 607
155 153 32338 78 15 137 216
156 154 32338 79 18 160 914
157 155 32338 80 20 174 863
158 156 32338 81 22 119 540
159 157 32338 81 23 117 146
160 158 32338 81 25 148 625
161 159 32338 82 27 156 111
162 160 32338 82 34 173 835
163 161 32338 82 64 115 457
164 162 32338 83 67 107 797
165 163 32338 83 60 159 277
166 164 32338 84 65 162 244
167 165 32338 84 71 172 823
168 166 32338 84 15 176 831
169 167 32338 85 18 105 693
170 168 32338 85 20 168 914
171 169 32338 85 22 124 549
172 170 32338 86 23 164 245
173 171 32338 87 25 158 894
174 172 32338 87 27 148 560
175 173 32338 88 35 100 504
176 174 32338 88 64 154 617
177 175 32338 88 67 191 808
178 176 32338 89 60 173 557
179 177 32338 90 65 176 871
180 178 32338 91 71 171 650
181 179 32338 91 19 125 349
182 180 32338 91 20 133 537
183 181 32338 92 22 153 335
184 182 32338 93 23 156 500
185 183 32338 93 25 146 306
186 184 32338 93 28 200 952
187 185 32338 94 29 163 863
188 186 32338 94 27 197 905
189 187 32338 95 40 150 546
190 188 32338 95 60 197 407
191 189 32338 95 62 137 580
192 190 32338 96 63 155 500
193 191 32338 96 64 173 884
194 192 32338 97 65 165 304
195 193 32338 98 67 122 282
196 194 32338 98 68 179 194
197 195 32338 98 69 174 473
198 196 32338 99 71 126 192
199 197 32338 99 72 131 160
200 198 32338 99 19 150 502
201 199 32338 100 20 160 633
202 200 32338 100 22 120 937
203 201 32338 101 23 145 645
204 202 32338 101 25 148 177
205 203 32338 102 28 146 220
206 204 32338 103 29 180 125
207 205 32338 104 27 151 818
208 206 32338 104 38 146 738
209 207 32338 104 60 155 825
210 208 32338 105 62 125 625
211 209 32338 105 63 158 411
212 210 32338 106 64 114 291
213 211 32338 106 65 188 730
214 212 32338 106 67 200 127
215 213 32338 107 68 189 225
216 214 32338 107 69 143 636
215 32338 71
216 32338 72
217 32338 19
218 32338 20
219 32338 22
220 32338 23
221 32338 25
222 32338 28
223 32338 29
224 32338 27
225 32338 41
226 32338 60
227 32338 62
228 32338 63
229 32338 64
230 32338 65
231 32338 67
232 32338 68
233 32338 69
234 32338 71
235 32338 72
236 32338 19
237 32338 20
238 32338 22
239 32338 23
240 32338 25
241 32338 28
242 32338 29
243 32338 27
244 32338 39
245 32338 60
246 32338 62
247 32338 63
248 32338 64
249 32338 65
250 32338 67
251 32338 68
252 32338 69
253 32338 71
254 32338 72
255 32338 19
256 32338 20
257 32338 22
258 32338 23
259 32338 25
260 32338 28
261 32338 29
262 32338 27
263 32338 43
264 32338 60
265 32338 62
266 32338 63
267 32338 64
268 32338 65
269 32338 67
270 32338 68
271 32338 69
272 32338 71
273 32338 72
274 32338 19
275 32338 20
276 32338 22
277 32338 23
278 32338 25
279 32338 28
280 32338 29
281 32338 27
282 32338 42
283 32338 60
284 32338 62
285 32338 63
286 32338 64
287 32338 65
288 32338 67
289 32338 68
290 32338 69
291 32338 71
292 32338 72
293 36914 47
294 36914 49
295 36914 44
296 36914 15
297 36914 18
298 36914 20
299 36914 22
300 36914 23
301 36914 25
302 36914 31
303 36914 36
304 36914 64
305 36914 67
306 36914 60
307 36914 65
308 36914 71
309 36914 15
310 36914 18
311 36914 20
312 36914 22
313 36914 23
314 36914 25
315 36914 31
316 36914 64
317 36914 67
318 36914 60
319 36914 65
320 36914 71
321 36914 46
322 317589 8
323 317589 9
324 317589 10
325 317589 11
326 317589 12
327 317589 13
328 317589 14
329 317589 15
330 317589 16
331 317589 17
332 317589 18
333 317589 19
334 317589 20
335 317589 21
336 317589 22
337 317589 23
338 317589 24
339 317589 25
340 317589 26
341 317589 27
342 317589 28
343 317589 29
344 317589 30
345 317589 31
346 317589 37
347 317589 44
348 317589 45
349 317589 46
350 317589 47
351 317589 48
352 317589 49
353 317589 50
354 317589 51
355 317589 52
356 317589 53
357 317589 54
358 317589 55
359 317589 58
360 317589 59
361 317589 60
362 317589 61
363 317589 62
364 317589 63
365 317589 64
366 317589 65
367 317589 66
368 317589 67
369 317589 68
370 317589 69
371 317589 70
372 317589 71
373 317589 72
374 317589 73
375 317589 74
376 317589 90
377 317589 91
378 317589 92
379 317589 93
380 317589 94

View File

@ -1,418 +1,224 @@
ID,UPID ID,UPID
38,47 36914,32338
39,49 36914,32440
40,44 36914,46505
41,15 36914,32446
41,18 36914,32433
41,20 36914,32443
41,22 36914,32435
41,23 36914,32439
41,25 36914,56321
41,31 36914,34525
41,36 36914,34527
41,60 36914,34526
41,64 36914,34530
41,65 36914,34531
41,67 32338,32338
41,71 32338,32440
42,15 32338,46505
42,18 32338,32446
42,20 32338,32433
42,22 32338,32443
42,23 32338,32435
42,25 32338,32438
42,31 32338,34525
42,60 32338,34527
42,64 32338,34526
42,65 32338,34530
42,67 32338,34531
42,71 32338,56320
43,46 32338,56322
44,15 32338,56319
44,18 32338,56323
44,7 32338,32449
44,20 32338,32447
44,22 32338,32436
44,23 32338,36914
44,25 32338,34537
44,27 32338,34534
44,60 32338,34539
44,64 32338,34528
44,65 32338,34524
44,67 9,2515
44,71 9,2514
45,15 2717,32338
45,18 2717,32445
45,7 2717,56341
45,20 2717,7
45,22 2717,46504
45,23 2717,32451
45,25 2717,32449
45,27 2717,32446
45,60 2717,32442
45,64 2717,32443
45,65 2717,32450
45,67 2717,32435
45,71 2717,32447
46,15 2717,32439
46,18 2717,9
46,20 2717,34535
46,22 2717,34526
46,23 2717,34529
46,25 2717,34537
46,27 2717,34530
46,32 2717,34533
46,60 2717,34527
46,64 2717,34539
46,65 2714,32445
46,67 2714,56341
46,71 2714,7
47,15 2714,46504
47,18 2714,32451
47,20 2714,46505
47,22 2714,32449
47,23 2714,32446
47,25 2714,32443
47,27 2714,32450
47,33 2714,32447
47,60 2714,32439
47,64 2714,9
47,65 2714,34535
47,67 2714,34529
47,71 2714,34537
48,15 2714,34530
48,18 2714,34533
48,20 2714,34543
48,22 2715,32445
48,23 2715,56341
48,25 2715,7
48,27 2715,46504
48,34 2715,32451
48,60 2715,46505
48,64 2715,32449
48,65 2715,32446
48,67 2715,32443
48,71 2715,32450
49,15 2715,32447
49,18 2715,32439
49,20 2715,9
49,22 2715,34535
49,23 2715,34529
49,25 2715,34537
49,27 2715,34530
49,35 2715,34533
49,60 2715,34543
49,64 2716,32445
49,65 2716,56341
49,67 2716,7
49,71 2716,46504
50,19 2716,32451
50,20 2716,46505
50,22 2716,32449
50,23 2716,32446
50,25 2716,32443
50,27 2716,32450
50,28 2716,32447
50,29 2716,32439
50,40 2716,9
50,60 2716,34535
50,62 2716,34529
50,63 2716,34537
50,64 2716,34530
50,65 2716,34533
50,67 2716,34543
50,68 2718,32445
50,69 2718,56341
50,71 2718,7
50,72 2718,46504
51,19 2718,32451
51,20 2718,46505
51,22 2718,32449
51,23 2718,32446
51,25 2718,32443
51,27 2718,32450
51,28 2718,32447
51,29 2718,32439
51,38 2718,9
51,60 2718,34535
51,62 2718,34529
51,63 2718,34537
51,64 2718,34530
51,65 2718,34533
51,67 2718,34543
51,68 317589,32445
51,69 317589,56341
51,71 317589,7
51,72 317589,46504
52,19 317589,32434
52,20 317589,32441
52,22 317589,32444
52,23 317589,32440
52,25 317589,32432
52,27 317589,32451
52,28 317589,46505
52,29 317589,32449
52,41 317589,32446
52,60 317589,32442
52,62 317589,32433
52,63 317589,32443
52,64 317589,32450
52,65 317589,32435
52,67 317589,32437
52,68 317589,32438
52,69 317589,32447
52,71 317589,32436
52,72 317589,32448
53,19 317589,32439
53,20 317589,8
53,22 317589,32338
53,23 317589,9
53,25 317589,34535
53,27 317589,34526
53,28 317589,34529
53,29 317589,34537
53,39 317589,34534
53,60 317589,34525
53,62 317589,34530
53,63 317589,34533
53,64 317589,34527
53,65 317589,34539
53,67 317589,34528
53,68 317589,34543
53,69 317589,34531
53,71 317589,34524
53,72 317589,34532
54,19 317589,34538
54,20 317589,2717
54,22 317589,2714
54,23 317589,2715
54,25 317589,2716
54,27 317589,2718
54,28 317589,513738
54,29 10,34550
54,43 10,34555
54,60 10,34553
54,62 10,34545
54,63 10,34552
54,64 10,34544
54,65 10,34546
54,67 10,34549
54,68 10,34558
54,69 10,34547
54,71 10,34551
54,72 10,34548
55,19 10,317589
55,20 10,513738
55,22 10,513740
55,23 10,513742
55,25 10,11
55,27 10,34573
55,28 10,34571
55,29 10,34567
55,42 10,34572
55,60 10,34566
55,62 10,34569
55,63 10,34568
55,64 10,34570
55,65 10,34574
55,67 513738,9
55,68 513740,34556
55,69 513740,317589
55,71 513742,34557
55,72 513742,317589
58,56 11,34554
58,57 11,317589
90,10
90,11
90,17
90,19
90,7
90,20
90,21
90,23
90,24
90,25
90,28
90,31
90,44
90,45
90,58
90,59
90,60
90,61
90,62
90,65
90,66
90,67
90,68
90,8
90,9
91,10
91,11
91,17
91,18
91,19
91,20
91,23
91,24
91,28
91,31
91,58
91,59
91,61
91,62
91,65
91,66
91,70
91,8
91,9
92,10
92,11
92,17
92,18
92,19
92,20
92,23
92,24
92,28
92,31
92,58
92,59
92,61
92,62
92,65
92,66
92,70
92,8
92,9
93,10
93,11
93,17
93,18
93,19
93,20
93,23
93,24
93,28
93,31
93,58
93,59
93,61
93,62
93,65
93,66
93,70
93,8
93,9
94,10
94,11
94,17
94,18
94,19
94,20
94,23
94,24
94,28
94,31
94,58
94,59
94,61
94,62
94,65
94,66
94,70
94,8
94,9
95,10
95,11
95,12
95,13
95,14
95,15
95,16
95,17
95,18
95,19
95,20
95,21
95,22
95,23
95,24
95,25
95,26
95,27
95,28
95,29
95,30
95,31
95,37
95,44
95,45
95,46
95,47
95,48
95,49
95,50
95,51
95,52
95,53
95,54
95,55
95,58
95,59
95,60
95,61
95,62
95,63
95,64
95,65
95,66
95,67
95,68
95,69
95,70
95,71
95,72
95,73
95,74
95,8
95,9
95,90
95,91
95,92
95,93
95,94
95,97
96,100
96,101
96,102
96,103
96,104
96,105
96,106
96,107
96,108
96,109
96,75
96,76
96,80
96,81
96,82
96,83
96,84
96,85
96,86
96,87
96,88
96,89
96,95
96,97
96,98
96,99
97,58
98,78
98,95
99,79
99,95
100,77
100,95

1 ID UPID
2 38 36914 47 32338
3 39 36914 49 32440
4 40 36914 44 46505
5 41 36914 15 32446
6 41 36914 18 32433
7 41 36914 20 32443
8 41 36914 22 32435
9 41 36914 23 32439
10 41 36914 25 56321
11 41 36914 31 34525
12 41 36914 36 34527
13 41 36914 60 34526
14 41 36914 64 34530
15 41 36914 65 34531
16 41 32338 67 32338
17 41 32338 71 32440
18 42 32338 15 46505
19 42 32338 18 32446
20 42 32338 20 32433
21 42 32338 22 32443
22 42 32338 23 32435
23 42 32338 25 32438
24 42 32338 31 34525
25 42 32338 60 34527
26 42 32338 64 34526
27 42 32338 65 34530
28 42 32338 67 34531
29 42 32338 71 56320
30 43 32338 46 56322
31 44 32338 15 56319
32 44 32338 18 56323
33 44 32338 7 32449
34 44 32338 20 32447
35 44 32338 22 32436
36 44 32338 23 36914
37 44 32338 25 34537
38 44 32338 27 34534
39 44 32338 60 34539
40 44 32338 64 34528
41 44 32338 65 34524
42 44 9 67 2515
43 44 9 71 2514
44 45 2717 15 32338
45 45 2717 18 32445
46 45 2717 7 56341
47 45 2717 20 7
48 45 2717 22 46504
49 45 2717 23 32451
50 45 2717 25 32449
51 45 2717 27 32446
52 45 2717 60 32442
53 45 2717 64 32443
54 45 2717 65 32450
55 45 2717 67 32435
56 45 2717 71 32447
57 46 2717 15 32439
58 46 2717 18 9
59 46 2717 20 34535
60 46 2717 22 34526
61 46 2717 23 34529
62 46 2717 25 34537
63 46 2717 27 34530
64 46 2717 32 34533
65 46 2717 60 34527
66 46 2717 64 34539
67 46 2714 65 32445
68 46 2714 67 56341
69 46 2714 71 7
70 47 2714 15 46504
71 47 2714 18 32451
72 47 2714 20 46505
73 47 2714 22 32449
74 47 2714 23 32446
75 47 2714 25 32443
76 47 2714 27 32450
77 47 2714 33 32447
78 47 2714 60 32439
79 47 2714 64 9
80 47 2714 65 34535
81 47 2714 67 34529
82 47 2714 71 34537
83 48 2714 15 34530
84 48 2714 18 34533
85 48 2714 20 34543
86 48 2715 22 32445
87 48 2715 23 56341
88 48 2715 25 7
89 48 2715 27 46504
90 48 2715 34 32451
91 48 2715 60 46505
92 48 2715 64 32449
93 48 2715 65 32446
94 48 2715 67 32443
95 48 2715 71 32450
96 49 2715 15 32447
97 49 2715 18 32439
98 49 2715 20 9
99 49 2715 22 34535
100 49 2715 23 34529
101 49 2715 25 34537
102 49 2715 27 34530
103 49 2715 35 34533
104 49 2715 60 34543
105 49 2716 64 32445
106 49 2716 65 56341
107 49 2716 67 7
108 49 2716 71 46504
109 50 2716 19 32451
110 50 2716 20 46505
111 50 2716 22 32449
112 50 2716 23 32446
113 50 2716 25 32443
114 50 2716 27 32450
115 50 2716 28 32447
116 50 2716 29 32439
117 50 2716 40 9
118 50 2716 60 34535
119 50 2716 62 34529
120 50 2716 63 34537
121 50 2716 64 34530
122 50 2716 65 34533
123 50 2716 67 34543
124 50 2718 68 32445
125 50 2718 69 56341
126 50 2718 71 7
127 50 2718 72 46504
128 51 2718 19 32451
129 51 2718 20 46505
130 51 2718 22 32449
131 51 2718 23 32446
132 51 2718 25 32443
133 51 2718 27 32450
134 51 2718 28 32447
135 51 2718 29 32439
136 51 2718 38 9
137 51 2718 60 34535
138 51 2718 62 34529
139 51 2718 63 34537
140 51 2718 64 34530
141 51 2718 65 34533
142 51 2718 67 34543
143 51 317589 68 32445
144 51 317589 69 56341
145 51 317589 71 7
146 51 317589 72 46504
147 52 317589 19 32434
148 52 317589 20 32441
149 52 317589 22 32444
150 52 317589 23 32440
151 52 317589 25 32432
152 52 317589 27 32451
153 52 317589 28 46505
154 52 317589 29 32449
155 52 317589 41 32446
156 52 317589 60 32442
157 52 317589 62 32433
158 52 317589 63 32443
159 52 317589 64 32450
160 52 317589 65 32435
161 52 317589 67 32437
162 52 317589 68 32438
163 52 317589 69 32447
164 52 317589 71 32436
165 52 317589 72 32448
166 53 317589 19 32439
167 53 317589 20 8
168 53 317589 22 32338
169 53 317589 23 9
170 53 317589 25 34535
171 53 317589 27 34526
172 53 317589 28 34529
173 53 317589 29 34537
174 53 317589 39 34534
175 53 317589 60 34525
176 53 317589 62 34530
177 53 317589 63 34533
178 53 317589 64 34527
179 53 317589 65 34539
180 53 317589 67 34528
181 53 317589 68 34543
182 53 317589 69 34531
183 53 317589 71 34524
184 53 317589 72 34532
185 54 317589 19 34538
186 54 317589 20 2717
187 54 317589 22 2714
188 54 317589 23 2715
189 54 317589 25 2716
190 54 317589 27 2718
191 54 317589 28 513738
192 54 10 29 34550
193 54 10 43 34555
194 54 10 60 34553
195 54 10 62 34545
196 54 10 63 34552
197 54 10 64 34544
198 54 10 65 34546
199 54 10 67 34549
200 54 10 68 34558
201 54 10 69 34547
202 54 10 71 34551
203 54 10 72 34548
204 55 10 19 317589
205 55 10 20 513738
206 55 10 22 513740
207 55 10 23 513742
208 55 10 25 11
209 55 10 27 34573
210 55 10 28 34571
211 55 10 29 34567
212 55 10 42 34572
213 55 10 60 34566
214 55 10 62 34569
215 55 10 63 34568
216 55 10 64 34570
217 55 10 65 34574
218 55 513738 67 9
219 55 513740 68 34556
220 55 513740 69 317589
221 55 513742 71 34557
222 55 513742 72 317589
223 58 11 56 34554
224 58 11 57 317589
90 10
90 11
90 17
90 19
90 7
90 20
90 21
90 23
90 24
90 25
90 28
90 31
90 44
90 45
90 58
90 59
90 60
90 61
90 62
90 65
90 66
90 67
90 68
90 8
90 9
91 10
91 11
91 17
91 18
91 19
91 20
91 23
91 24
91 28
91 31
91 58
91 59
91 61
91 62
91 65
91 66
91 70
91 8
91 9
92 10
92 11
92 17
92 18
92 19
92 20
92 23
92 24
92 28
92 31
92 58
92 59
92 61
92 62
92 65
92 66
92 70
92 8
92 9
93 10
93 11
93 17
93 18
93 19
93 20
93 23
93 24
93 28
93 31
93 58
93 59
93 61
93 62
93 65
93 66
93 70
93 8
93 9
94 10
94 11
94 17
94 18
94 19
94 20
94 23
94 24
94 28
94 31
94 58
94 59
94 61
94 62
94 65
94 66
94 70
94 8
94 9
95 10
95 11
95 12
95 13
95 14
95 15
95 16
95 17
95 18
95 19
95 20
95 21
95 22
95 23
95 24
95 25
95 26
95 27
95 28
95 29
95 30
95 31
95 37
95 44
95 45
95 46
95 47
95 48
95 49
95 50
95 51
95 52
95 53
95 54
95 55
95 58
95 59
95 60
95 61
95 62
95 63
95 64
95 65
95 66
95 67
95 68
95 69
95 70
95 71
95 72
95 73
95 74
95 8
95 9
95 90
95 91
95 92
95 93
95 94
95 97
96 100
96 101
96 102
96 103
96 104
96 105
96 106
96 107
96 108
96 109
96 75
96 76
96 80
96 81
96 82
96 83
96 84
96 85
96 86
96 87
96 88
96 89
96 95
96 97
96 98
96 99
97 58
98 78
98 95
99 79
99 95
100 77
100 95

View File

@ -9,14 +9,10 @@ from mesa.space import MultiGrid, NetworkGrid
from mesa.datacollection import DataCollector from mesa.datacollection import DataCollector
import numpy as np import numpy as np
from mesa_viz_tornado.modules import NetworkModule
from firm import FirmAgent from firm import FirmAgent
from orm import db_session, Result from orm import db_session, Result
from product import ProductAgent from product import ProductAgent
from mesa.visualization import ModularServer
class MyModel(Model): class MyModel(Model):
def __init__(self, params): def __init__(self, params):
@ -87,7 +83,6 @@ class MyModel(Model):
data = pd.read_csv('input_data/input_product_data/BomNodes.csv') data = pd.read_csv('input_data/input_product_data/BomNodes.csv')
data['Code'] = data['Code'].astype('string') data['Code'] = data['Code'].astype('string')
self.type2 = data self.type2 = data
self.id_code = data.groupby('Code')['Index'].apply(list)
# 设备c折旧比值 # 设备c折旧比值
### ###
@ -100,7 +95,7 @@ class MyModel(Model):
firm.fillna(0, inplace=True) 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 = pd.read_csv("input_data/firm_industry_relation.csv")
firm_industry_relation['Firm_Code'] = firm_industry_relation['Firm_Code'].astype('string') firm_industry_relation['Firm_Code'] = firm_industry_relation['Firm_Code'].astype('string')
@ -113,20 +108,8 @@ class MyModel(Model):
firm_attr['Product_Code'] = firm_attr['Code'].map(grouped) firm_attr['Product_Code'] = firm_attr['Code'].map(grouped)
firm_attr.set_index('Code', inplace=True) firm_attr.set_index('Code', inplace=True)
grouped = firm_industry_relation.groupby('Firm_Code')
self.firm_prod_labels_dict = {code: group['Product_Code'].tolist() for code, group in grouped}
# 遍历'Product_Code' 与 index 交换
for index, row in firm_attr.iterrows():
id_index_list = []
for i in row['Product_Code']:
for key_values in self.id_code.items():
if int(key_values[0]) == i:
for id in key_values[1]:
id_index_list.append(id)
firm_attr.at[index, 'Product_Code'] = id_index_list
self.G_Firm.add_nodes_from(firm["Code"]) self.G_Firm.add_nodes_from(firm["Code"])
# Assign attributes to the firm nodes # Assign attributes to the firm nodes
firm_labels_dict = {code: firm_attr.loc[code].to_dict() for code in self.G_Firm.nodes} firm_labels_dict = {code: firm_attr.loc[code].to_dict() for code in self.G_Firm.nodes}
nx.set_node_attributes(self.G_Firm, firm_labels_dict) nx.set_node_attributes(self.G_Firm, firm_labels_dict)
@ -137,20 +120,13 @@ class MyModel(Model):
firm_industry_relation = pd.read_csv("input_data/firm_industry_relation.csv") 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_industry_relation['Firm_Code'] = firm_industry_relation['Firm_Code'].astype('string')
firm_industry_relation['Product_Code'] = firm_industry_relation['Product_Code'].apply(lambda x: [x])
# 将 'firm_prod' 表中的每一行作为图中的节点 # 将 'firm_prod' 表中的每一行作为图中的节点
self.G_FirmProd.add_nodes_from(firm_industry_relation.index) self.G_FirmProd.add_nodes_from(firm_industry_relation.index)
# 为每个节点分配属性
# 遍历'Product_Code' 与 index 交换 # 为每个节点分配属性
for index, row in firm_industry_relation.iterrows(): grouped = firm_industry_relation.groupby('Firm_Code')
id_index_list = []
for i in row['Product_Code']: self.firm_prod_labels_dict = {code: group['Product_Code'].tolist() for code, group in grouped}
for key_values in self.id_code.items():
if int(key_values[0]) == i:
for id in key_values[1]:
id_index_list.append(id)
firm_industry_relation.at[index, 'Product_Code'] = id_index_list
firm_prod_labels_dict = {code: firm_industry_relation.loc[code].to_dict() for code in firm_prod_labels_dict = {code: firm_industry_relation.loc[code].to_dict() for code in
firm_industry_relation.index} firm_industry_relation.index}
@ -161,6 +137,15 @@ class MyModel(Model):
# Add edges to G_Firm according to G_bom # Add edges to G_Firm according to G_bom
for node in nx.nodes(self.G_Firm): for node in nx.nodes(self.G_Firm):
lst_pred_product_code = [] lst_pred_product_code = []
product_code = self.G_Firm.nodes[node].get('Product_Code')
# 打印值和类型
#print(f"节点 {node} 的 'Product_Code': {product_code}, 类型: {type(product_code)}")
# 如果 'Product_Code' 是 float 类型或单个值,将其转换为列表
if isinstance(product_code, float):
#print(f"警告: 节点 {node} 的 'Product_Code' 为浮点数,已转换为列表")
product_code = [product_code] # 将浮点数包装为列表
for product_code in self.G_Firm.nodes[node]['Product_Code']: for product_code in self.G_Firm.nodes[node]['Product_Code']:
lst_pred_product_code += list(self.G_bom.predecessors(product_code)) lst_pred_product_code += list(self.G_bom.predecessors(product_code))
lst_pred_product_code = list(set(lst_pred_product_code)) lst_pred_product_code = list(set(lst_pred_product_code))
@ -181,7 +166,7 @@ class MyModel(Model):
lst_pred_firm_size = [self.G_Firm.nodes[pred_firm]['Revenue_Log'] for pred_firm in lst_pred_firm] lst_pred_firm_size = [self.G_Firm.nodes[pred_firm]['Revenue_Log'] for pred_firm in lst_pred_firm]
# 检查 lst_pred_firm_size 是否为空或总和为 0 # 检查 lst_pred_firm_size 是否为空或总和为 0
if len(lst_pred_firm_size) == 0 or sum(lst_pred_firm_size) == 0: if len(lst_pred_firm_size) == 0 or sum(lst_pred_firm_size) == 0:
# print("警告: lst_pred_firm_size 为空或总和为 0无法生成概率分布") #print("警告: lst_pred_firm_size 为空或总和为 0无法生成概率分布")
lst_choose_firm = [] # 返回空结果,或根据需要处理 lst_choose_firm = [] # 返回空结果,或根据需要处理
else: else:
# 计算总和 # 计算总和
@ -190,7 +175,7 @@ class MyModel(Model):
lst_prob = [size / sum_pred_firm_size for size in lst_pred_firm_size] lst_prob = [size / sum_pred_firm_size for size in lst_pred_firm_size]
# 使用 np.isclose() 确保概率总和接近 1 # 使用 np.isclose() 确保概率总和接近 1
if not np.isclose(sum(lst_prob), 1.0): if not np.isclose(sum(lst_prob), 1.0):
# print(f"警告: 概率总和为 {sum(lst_prob)},现在进行修正") #print(f"警告: 概率总和为 {sum(lst_prob)},现在进行修正")
lst_prob = [prob / sum(lst_prob) for prob in lst_prob] lst_prob = [prob / sum(lst_prob) for prob in lst_prob]
# 确保没有负值或 0 # 确保没有负值或 0
lst_prob = [max(0, prob) for prob in lst_prob] lst_prob = [max(0, prob) for prob in lst_prob]
@ -200,6 +185,7 @@ class MyModel(Model):
# 直接进行随机选择 # 直接进行随机选择
lst_choose_firm = self.nprandom.choice(lst_pred_firm, n_pred_firm, replace=False) lst_choose_firm = self.nprandom.choice(lst_pred_firm, n_pred_firm, replace=False)
# Add edges from predecessor firms to current node (firm) # Add edges from predecessor firms to current node (firm)
lst_add_edge = [(pred_firm, node, {'Product': pred_product_code}) for pred_firm in lst_choose_firm] lst_add_edge = [(pred_firm, node, {'Product': pred_product_code}) for pred_firm in lst_choose_firm]
self.G_Firm.add_edges_from(lst_add_edge) self.G_Firm.add_edges_from(lst_add_edge)
@ -213,46 +199,21 @@ class MyModel(Model):
set_pred_succ_code = set(self.G_bom.successors(pred_product_code)) set_pred_succ_code = set(self.G_bom.successors(pred_product_code))
lst_use_pred_prod_code = list(set_node_prod_code & set_pred_succ_code) lst_use_pred_prod_code = list(set_node_prod_code & set_pred_succ_code)
if len(lst_use_pred_prod_code) == 0:
print("错误")
pred_node_list = []
for pred_firm in lst_choose_firm: for pred_firm in lst_choose_firm:
for n, v in self.G_FirmProd.nodes(data=True): pred_node = [n for n, v in self.G_FirmProd.nodes(data=True) if
for v1 in v['Product_Code']: v['Firm_Code'] == pred_firm and v['Product_Code'] == pred_product_code][0]
if v1 == pred_product_code and v['Firm_Code'] == pred_firm:
pred_node_list.append(n)
if len(pred_node_list) != 0:
pred_node = pred_node_list[0]
else:
pred_node = -1
current_node_list = []
for use_pred_prod_code in lst_use_pred_prod_code: for use_pred_prod_code in lst_use_pred_prod_code:
for n, v in self.G_FirmProd.nodes(data=True): current_node = [n for n, v in self.G_FirmProd.nodes(data=True) if
for v1 in v['Product_Code']: v['Firm_Code'] == node and v['Product_Code'] == use_pred_prod_code][0]
if v1 == use_pred_prod_code and v['Firm_Code'] == node:
current_node_list.append(n)
if len(current_node_list) != 0:
current_node = current_node_list[0]
else:
current_node = -1
if current_node != -1 and pred_node != -1:
self.G_FirmProd.add_edge(pred_node, current_node) self.G_FirmProd.add_edge(pred_node, current_node)
def connect_unconnected_nodes(self): def connect_unconnected_nodes(self):
""" Connect unconnected nodes in the firm network """ """ Connect unconnected nodes in the firm network """
for node in nx.nodes(self.G_Firm): for node in nx.nodes(self.G_Firm):
if self.G_Firm.degree(node) == 0: if self.G_Firm.degree(node) == 0:
current_node_list = []
for product_code in self.G_Firm.nodes[node]['Product_Code']: for product_code in self.G_Firm.nodes[node]['Product_Code']:
for n, v in self.G_FirmProd.nodes(data=True): current_node = [n for n, v in self.G_FirmProd.nodes(data=True) if
for v1 in v['Product_Code']: v['Firm_Code'] == node and v['Product_Code'] == product_code][0]
if v['Firm_Code'] == node and v1 == product_code:
current_node_list.append(n)
if len(current_node_list) != 0:
current_node = current_node_list[0]
else:
current_node = -1
lst_succ_product_code = list(self.G_bom.successors(product_code)) lst_succ_product_code = list(self.G_bom.successors(product_code))
for succ_product_code in lst_succ_product_code: for succ_product_code in lst_succ_product_code:
@ -266,24 +227,9 @@ class MyModel(Model):
if self.is_prf_size: if self.is_prf_size:
lst_succ_firm_size = [self.G_Firm.nodes[succ_firm]['Revenue_Log'] for succ_firm in lst_succ_firm_size = [self.G_Firm.nodes[succ_firm]['Revenue_Log'] for succ_firm in
lst_succ_firm] lst_succ_firm]
if len(lst_succ_firm_size) == 0 or sum(lst_succ_firm_size) == 0: lst_prob = [size / sum(lst_succ_firm_size) for size in lst_succ_firm_size]
# print("警告: lst_pred_firm_size 为空或总和为 0无法生成概率分布") lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False,
lst_choose_firm = [] # 返回空结果,或根据需要处理 p=lst_prob)
else:
# 计算总和
sum_pred_firm_size = sum(lst_succ_firm_size)
# 归一化生成 lst_prob
lst_prob = [size / sum_pred_firm_size for size in lst_succ_firm_size]
# 使用 np.isclose() 确保概率总和接近 1
if not np.isclose(sum(lst_prob), 1.0):
# print(f"警告: 概率总和为 {sum(lst_prob)},现在进行修正")
lst_prob = [prob / sum(lst_prob) for prob in lst_prob]
# 确保没有负值或 0
lst_prob = [max(0, prob) for prob in lst_prob]
lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False,
p=lst_prob)
else: else:
lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False) lst_choose_firm = self.nprandom.choice(lst_succ_firm, n_succ_firm, replace=False)
@ -292,19 +238,10 @@ class MyModel(Model):
self.G_Firm.add_edges_from(lst_add_edge) self.G_Firm.add_edges_from(lst_add_edge)
# Add edges to firm-product network # Add edges to firm-product network
succ_node_list = []
for succ_firm in lst_choose_firm: for succ_firm in lst_choose_firm:
for n, v in self.G_FirmProd.nodes(data=True): succ_node = [n for n, v in self.G_FirmProd.nodes(data=True) if
for v1 in v['Product_Code']: v['Firm_Code'] == succ_firm and v['Product_Code'] == succ_product_code][0]
if v1 == succ_product_code and v['Firm_Code'] == succ_firm: self.G_FirmProd.add_edge(current_node, succ_node)
succ_node_list.append(n)
if len(succ_node_list) != 0:
succ_node = succ_node_list[0]
else:
succ_node = -1
if current_node != -1 and succ_node != -1:
self.G_FirmProd.add_edge(current_node, succ_node)
self.sample.g_firm = json.dumps(nx.adjacency_data(self.G_Firm)) self.sample.g_firm = json.dumps(nx.adjacency_data(self.G_Firm))
self.firm_network = self.G_Firm # 直接使用 networkx 图对象 self.firm_network = self.G_Firm # 直接使用 networkx 图对象
@ -315,11 +252,22 @@ class MyModel(Model):
for ag_node, attr in self.product_network.nodes(data=True): for ag_node, attr in self.product_network.nodes(data=True):
# 产业种类 # 产业种类
# 利用 BomNodes.csv 转换产业 和 id 前提是 一个产业一个产品id 且一一对应
product_id = self.type2.loc[self.type2['Code'] == ag_node, 'Index']
type2 = self.type2.loc[product_id, '产业种类'].values[0]
type2 = self.type2[self.type2["Index"] == ag_node]["产业种类"]
# depreciation ratio 折旧比值 # depreciation ratio 折旧比值
# product_id = product_id.iloc[0] product_id = product_id.iloc[0]
product = ProductAgent(ag_node, self, name=attr['Name'], type2=type2)
j_comp_data_consumed = self.data_consumed[product_id]
j_comp_data_produced = self.data_produced[product_id]
product = ProductAgent(ag_node, self, name=attr['Name'], type2=type2,
j_comp_data_consumed=j_comp_data_consumed,
j_comp_data_produced=j_comp_data_produced,
)
self.add_agent(product) self.add_agent(product)
# self.grid.place_agent(product, ag_node) # self.grid.place_agent(product, ag_node)
##print(f"Product agent created: {product.name}, ID: {product.unique_id}") ##print(f"Product agent created: {product.name}, ID: {product.unique_id}")
@ -329,9 +277,9 @@ class MyModel(Model):
firm_id = self.Firm['Code'] == ag_node firm_id = self.Firm['Code'] == ag_node
n_equip_c = self.Firm.loc[firm_id, '设备数量'].values[0] n_equip_c = self.Firm.loc[firm_id, '设备数量'].values[0]
demand_quantity = self.data_consumed[self.data_consumed['Firm_Code'] == ag_node] demand_quantity = self.Firm.loc[firm_id, 'production_output'].values[0]
production_output = self.data_produced[self.data_consumed['Firm_Code'] == ag_node] production_output = self.Firm.loc[firm_id, 'demand_quantity'].values[0]
# c购买价格 数据预处理 # c购买价格 数据预处理
# c_price = self.Firm.loc[self.Firm['Code'] == ag_node, 'c_price'].values[0] # c_price = self.Firm.loc[self.Firm['Code'] == ag_node, 'c_price'].values[0]
@ -418,22 +366,16 @@ class MyModel(Model):
self.firm_resource_P = firm_resource_P self.firm_resource_P = firm_resource_P
def j_comp_consumed_produced(self): def j_comp_consumed_produced(self):
# 着重修改这 然后考虑逻辑 如何传递值 data_consumed = pd.read_csv('input_data/input_product_data/products_consumed_materials.csv')
data_consumed = pd.read_csv('input_data/input_firm_data/firms_materials.csv') data_produced = pd.read_csv('input_data/input_product_data/products_produced_products.csv')
data_produced = pd.read_csv('input_data/input_firm_data/firms_products.csv')
data_not_consumed = data_consumed.groupby('Firm_Code')[['消耗材料id', '材料数量']] \ data_consumed = (data_consumed.groupby('产业id')[['消耗材料id', '消耗量']]
.apply(lambda x: dict(zip(x['消耗材料id'], x['材料数量']))) \ .apply(lambda x: x.values.tolist()))
.reset_index(name='Material_not_Consumed') data_produced = (data_produced.groupby('产业id')[['制造产品id', '制造量']]
.apply(lambda x: x.values.tolist()))
# 这里简单设置为折半 考虑 企业的设备量
# 可以引入 换算率 也就是 材料——计算产品比例 通过上游产业 现在假设为 2:1 的比例
data_consumed = data_consumed.groupby('Firm_Code')[['消耗材料id', '材料数量']] \
.apply(lambda x: dict(zip(x['消耗材料id'], x['材料数量'] / 2))) \
.reset_index(name='Material_not_Consumed')
self.data_consumed = data_consumed self.data_consumed = data_consumed
self.data_produced = data_consumed / 2 self.data_produced = data_produced
def step(self): def step(self):
# 1. Remove edge to customer and disrupt customer up product # 1. Remove edge to customer and disrupt customer up product
@ -534,24 +476,36 @@ class MyModel(Model):
for C_list, C0_list in zip(firm.C, firm.C0): for C_list, C0_list in zip(firm.C, firm.C0):
C_list[1] = C0_list[1] # 赋值回去 C_list[1] = C0_list[1] # 赋值回去
C_list[2] = C0_list[2] C_list[2] = C0_list[2]
# 消耗资源过程 # 消耗资源过程
# 这里需要修改 consumed_material = []
for r_id, r_nums in firm.R.items(): for product in firm.indus_i:
for consumed_id, consumed_nums in firm.c_consumption: for sub_list_data_consumed in product.j_comp_data_consumed:
if consumed_id == r_id: consumed_material_id = sub_list_data_consumed[0]
r_nums = r_nums - consumed_nums consumed_material_num = sub_list_data_consumed[1]
consumed_material.append([consumed_material_id, consumed_material_num])
for sub_list_consumed_material in consumed_material:
for sub_list_material in firm.R:
if sub_list_material[0] == sub_list_consumed_material[0]:
sub_list_material[1] = sub_list_material[1] - sub_list_consumed_material[1]
# 生产产品过程 # 生产产品过程
for p_id, p_nums in firm.P.items(): produced_products = []
for product_id, product_nums in firm.c_consumption: for product in firm.indus_i:
if product_id == p_id: for sub_list_produced_products in product.j_comp_data_consumed:
p_nums = p_nums + product_nums produced_products_id = sub_list_produced_products[0]
produced_products_num = sub_list_produced_products[1]
produced_products.append([produced_products_id, produced_products_num])
for sub_list_data_produced_products in produced_products:
for sub_list_products in firm.P:
if sub_list_products[0] == sub_list_data_produced_products[0]:
sub_list_products[1] = sub_list_products[1] - sub_list_data_produced_products[1]
# 刷新 R状态
firm.refresh_R() firm.refresh_R()
# 刷新 C状态 # 刷新 C状态
firm.refresh_C() firm.refresh_C()
# 刷新 P状态 # 刷新 P状态
firm.refresh_P() firm.refresh_P()
# Increment the time step # Increment the time step
self.t += 1 self.t += 1

View File

@ -2,7 +2,7 @@ from mesa import Agent
class ProductAgent(Agent): class ProductAgent(Agent):
def __init__(self, unique_id, model, name, type2): def __init__(self, unique_id, model, name, type2, j_comp_data_consumed, j_comp_data_produced):
# 调用超类的 __init__ 方法 # 调用超类的 __init__ 方法
super().__init__(unique_id, model) super().__init__(unique_id, model)
@ -16,6 +16,9 @@ class ProductAgent(Agent):
# depreciation ratio 折旧比值 # depreciation ratio 折旧比值
# self.depreciation ratio # self.depreciation ratio
self.j_comp_data_produced = j_comp_data_produced
self.j_comp_data_consumed = j_comp_data_consumed
def a_successors(self): def a_successors(self):
# 从 product_network 中找到当前代理的后继节点 # 从 product_network 中找到当前代理的后继节点
successors = list(self.model.product_network.successors(self.unique_id)) successors = list(self.model.product_network.successors(self.unique_id))

View File

@ -52,4 +52,4 @@ urllib3==1.26.14
wincertstore==0.2 wincertstore==0.2
yapf @ file:///tmp/build/80754af9/yapf_1615749224965/work yapf @ file:///tmp/build/80754af9/yapf_1615749224965/work
zipp==3.15.0 zipp==3.15.0
mesa==2.1.5 mesa==2.1.5

60
可视化测试.py Normal file
View File

@ -0,0 +1,60 @@
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
from matplotlib import rcParams
# 设置中文字体和符号显示
rcParams['font.sans-serif'] = ['SimHei'] # 或者使用 ['Microsoft YaHei']
rcParams['axes.unicode_minus'] = False # 用来正常显示负号
# 定义节点和边
nodes = {
0: '原材料供应商',
1: '零部件制造商',
2: '产品制造商',
3: '分销商',
4: '零售商'
}
edges = [
(0, 1), # 原材料供应商 -> 零部件制造商
(1, 2), # 零部件制造商 -> 产品制造商
(2, 3), # 产品制造商 -> 分销商
(3, 4) # 分销商 -> 零售商
]
# 定义节点的三维坐标 (x, y, z)
positions = {
0: (0, 0, 0), # 原材料供应商
1: (1, 0, 1), # 零部件制造商
2: (2, 0, 2), # 产品制造商
3: (3, 0, 3), # 分销商
4: (4, 0, 4) # 零售商
}
# 创建3D图形
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
# 绘制节点
for node, (x, y, z) in positions.items():
ax.scatter(x, y, z, color='b', s=100) # 绘制每个节点
ax.text(x, y, z, nodes[node], size=12, zorder=1, color='k') # 添加节点标签
# 绘制边(箭头)
for start, end in edges:
start_pos = positions[start]
end_pos = positions[end]
ax.plot([start_pos[0], end_pos[0]],
[start_pos[1], end_pos[1]],
[start_pos[2], end_pos[2]], color='r') # 连接每对节点
# 设置坐标轴标签
ax.set_xlabel('X轴')
ax.set_ylabel('Y轴')
ax.set_zlabel('Z轴')
# 设置视角以便更好地观察3D图形
ax.view_init(elev=20., azim=-35) # 角度可根据需要调整
# 显示3D图形
plt.show()