把里面的废弃物产生点的全部数据带入到文中的代码里
时间: 2024-12-20 09:19:43 浏览: 2
地方废物回收机构系统代码 java地方废物回收机构系统代码
为了将废弃物产生点的数据带入到文中的代码中,我们需要确保每个产生点的信息被正确地添加到 `data` 字典中的 `"waste_production"` 列表内。以下是完整的代码示例:
```python
import numpy as np
import pandas as pd
from scipy.spatial.distance import cdist
# 读取数据
data = {
"nodes": [
{"name": "分类回收节点1", "lat": 107.381715, "lon": 31.469126, "fixed_cost": 150000, "var_cost": 65, "carbon_emission": 7.4, "recycling_rate": 0.87},
{"name": "分类回收节点2", "lat": 107.520675, "lon": 31.374130, "fixed_cost": 160000, "var_cost": 60, "carbon_emission": 6.8, "recycling_rate": 0.88},
# ... 添加所有分类回收节点
{"name": "再制造中心1", "lat": 107.095849, "lon": 30.759173, "fixed_cost": 300000, "var_cost": 200, "carbon_emission": 102, "recycling_rate": 0.87},
# ... 添加所有再制造中心
{"name": "填埋场1", "lat": 107.063886246, "lon": 31.3623822568, "var_cost": 54, "carbon_emission": 6.23},
# ... 添加所有填埋场
],
"waste_production": [
{"name": "达川区石桥镇", "lat": 107.118101, "lon": 31.298319, "waste_amount": 2.86},
{"name": "百节镇", "lat": 107.454102, "lon": 31.023069, "waste_amount": 0.87},
{"name": "万家镇", "lat": 107.623465, "lon": 30.956475, "waste_amount": 3.71},
{"name": "南岳镇", "lat": 107.502044, "lon": 31.215063, "waste_amount": 1.52},
{"name": "大树镇", "lat": 107.633019, "lon": 30.903638, "waste_amount": 3.39},
{"name": "景市镇", "lat": 107.552492, "lon": 31.012362, "waste_amount": 0.97},
{"name": "平滩镇", "lat": 107.512259, "lon": 30.933431, "waste_amount": 1.55},
{"name": "赵家镇", "lat": 107.416361, "lon": 30.962931, "waste_amount": 1.24},
{"name": "双庙镇", "lat": 107.367131, "lon": 30.984120, "waste_amount": 1.61},
{"name": "渡市镇", "lat": 107.277676, "lon": 31.059865, "waste_amount": 1.62},
{"name": "罐子镇", "lat": 107.301602, "lon": 31.135825, "waste_amount": 1.81},
{"name": "管村镇", "lat": 107.311350, "lon": 31.182932, "waste_amount": 2.35},
{"name": "大堰镇", "lat": 107.332680, "lon": 31.236690, "waste_amount": 0.93},
{"name": "赵固镇", "lat": 107.280691, "lon": 31.240285, "waste_amount": 0.75},
{"name": "石梯镇", "lat": 107.160852, "lon": 31.228216, "waste_amount": 3.64},
{"name": "桥湾镇", "lat": 107.202620, "lon": 31.261140, "waste_amount": 3.18},
{"name": "堡子镇", "lat": 107.303139, "lon": 31.344459, "waste_amount": 1.68},
{"name": "复兴镇", "lat": 107.431603, "lon": 31.224379, "waste_amount": 0.27},
{"name": "蒲家镇", "lat": 107.520675, "lon": 31.374130, "waste_amount": 0.34},
{"name": "罗江镇", "lat": 107.534480, "lon": 31.305442, "waste_amount": 0.63},
{"name": "双龙镇", "lat": 107.449080, "lon": 31.283549, "waste_amount": 0.36},
{"name": "东岳镇", "lat": 107.487468, "lon": 31.316087, "waste_amount": 0.29},
{"name": "磐石镇", "lat": 107.597372, "lon": 31.230389, "waste_amount": 0.36},
{"name": "北山镇", "lat": 107.304557, "lon": 31.473063, "waste_amount": 0.35},
{"name": "江陵镇", "lat": 107.262289, "lon": 31.374115, "waste_amount": 0.67},
{"name": "碑庙镇", "lat": 107.381715, "lon": 31.469126, "waste_amount": 0.43},
{"name": "金石镇", "lat": 107.379460, "lon": 31.402340, "waste_amount": 0.38},
{"name": "梓桐镇", "lat": 107.361585, "lon": 31.505554, "waste_amount": 0.42},
{"name": "青宁镇", "lat": 107.442087, "lon": 31.496649, "waste_amount": 0.32},
{"name": "南坝镇", "lat": 108.005914, "lon": 31.358845, "waste_amount": 1.37},
{"name": "普光镇", "lat": 107.708737, "lon": 31.504251, "waste_amount": 2.12},
{"name": "胡家镇", "lat": 107.662229, "lon": 31.559861, "waste_amount": 0.84},
{"name": "天生镇", "lat": 107.752983, "lon": 31.257788, "waste_amount": 2.51},
{"name": "君塘镇", "lat": 107.568291, "lon": 31.356867, "waste_amount": 1.25},
{"name": "马渡关镇", "lat": 107.481080, "lon": 31.595353, "waste_amount": 1.16},
{"name": "红峰镇", "lat": 107.626512, "lon": 31.684639, "waste_amount": 0.93},
{"name": "柏树镇", "lat": 107.653829, "lon": 31.163978, "waste_amount": 1.13},
{"name": "黄金镇", "lat": 107.849845, "lon": 31.607142, "waste_amount": 0.88},
{"name": "清溪镇", "lat": 107.792071, "lon": 31.415139, "waste_amount": 0.85},
{"name": "土黄镇", "lat": 108.195121, "lon": 31.586505, "waste_amount": 0.86},
{"name": "下八镇", "lat": 107.934038, "lon": 31.355846, "waste_amount": 0.65},
{"name": "新华镇", "lat": 107.994594, "lon": 31.739576, "waste_amount": 1.02},
{"name": "大成镇", "lat": 107.558691, "lon": 31.424846, "waste_amount": 0.56},
{"name": "茶河镇", "lat": 108.062908, "lon": 31.374234, "waste_amount": 1.21},
{"name": "厂溪镇", "lat": 107.947871, "lon": 31.686818, "waste_amount": 0.86},
{"name": "华景镇", "lat": 108.104058, "lon": 31.561272, "waste_amount": 0.68},
{"name": "芭蕉镇", "lat": 107.676969, "lon": 31.034146, "waste_amount": 1.03},
{"name": "樊哙镇", "lat": 108.246289, "lon": 31.635397, "waste_amount": 1.91},
{"name": "毛坝镇", "lat": 107.748143, "lon": 31.615537, "waste_amount": 1.51},
{"name": "上峡镇", "lat": 108.024139, "lon": 31.301981, "waste_amount": 0.56},
{"name": "峰城镇", "lat": 107.956094, "lon": 31.481515, "waste_amount": 0.89},
{"name": "五宝镇", "lat": 108.062990, "lon": 31.477050, "waste_amount": 0.74},
{"name": "白马镇", "lat": 108.098518, "lon": 31.623465, "waste_amount": 1.01},
{"name": "桃花镇", "lat": 107.955130, "lon": 31.480754, "waste_amount": 1.05},
{"name": "塔河镇", "lat": 108.074450, "lon": 31.351670, "waste_amount": 0.68},
{"name": "庙安镇", "lat": 107.638492, "lon": 31.240581, "waste_amount": 0.65},
{"name": "南坪镇", "lat": 107.964139, "lon": 31.602092, "waste_amount": 0.54},
{"name": "新宁镇", "lat": 107.865317, "lon": 31.084636, "waste_amount": 1.19},
{"name": "普安镇", "lat": 107.807500, "lon": 31.106122, "waste_amount": 0.78},
{"name": "回龙镇", "lat": 107.771015, "lon": 31.172891, "waste_amount": 1.86},
{"name": "永兴镇", "lat": 107.884520, "lon": 31.142662, "waste_amount": 2.29},
{"name": "灵岩镇", "lat": 107.977251, "lon": 31.196791, "waste_amount": 1.06},
{"name": "讲治镇", "lat": 107.950456, "lon": 31.030836, "waste_amount": 1.83},
{"name": "甘棠镇", "lat": 107.869738, "lon": 30.967549, "waste_amount": 2.18},
{"name": "任市镇", "lat": 107.788644, "lon": 30.902817, "waste_amount": 1.41},
{"name": "广福镇", "lat": 107.843240, "lon": 30.860538, "waste_amount": 0.53},
{"name": "长岭镇", "lat": 107.874677, "lon": 30.897389, "waste_amount": 1.06},
{"name": "八庙镇", "lat": 107.911753, "lon": 30.917595, "waste_amount": 0.74},
{"name": "中华镇", "lat": 107.177017, "lon": 30.769182, "waste_amount": 1.63},
{"name": "乌木镇", "lat": 107.267710, "lon": 30.710460, "waste_amount": 1.59},
{"name": "团坝镇", "lat": 107.505802, "lon": 31.210219, "waste_amount": 1.51},
{"name": "杨家镇", "lat": 107.231971, "lon": 30.851727, "waste_amount": 3.43},
{"name": "清河镇", "lat": 107.237532, "lon": 30.906921, "waste_amount": 1.08},
{"name": "柏林镇", "lat": 107.250535, "lon": 30.952828, "waste_amount": 1.13},
{"name": "石河镇", "lat": 107.330816, "lon": 30.872058, "waste_amount": 3.39},
{"name": "月华镇", "lat": 107.294933, "lon": 30.803319, "waste_amount": 4.24},
{"name": "石桥铺镇", "lat": 107.443078, "lon": 30.772700, "waste_amount": 2.41},
{"name": "永胜镇", "lat": 107.457577, "lon": 30.818119, "waste_amount": 1.17},
{"name": "观音镇", "lat": 107.452200, "lon": 30.673779, "waste_amount": 2.51},
{"name": "周家镇", "lat": 107.363174, "lon": 30.612327, "waste_amount": 1.99},
{"name": "高明镇", "lat": 107.347334, "lon": 30.546790, "waste_amount": 1.65},
{"name": "石子镇", "lat": 107.300830, "lon": 30.436623, "waste_amount": 1.31},
{"name": "四合镇", "lat": 107.255518, "lon": 30.404623, "waste_amount": 1.98},
{"name": "天城镇", "lat": 107.341415, "lon": 30.499131, "waste_amount": 1.14},
{"name": "文星镇", "lat": 107.249910, "lon": 30.503279, "waste_amount": 1.33},
{"name": "童家镇", "lat": 107.299498, "lon": 30.536495, "waste_amount": 1.45},
{"name": "高穴镇", "lat": 107.189827, "lon": 30.608337, "waste_amount": 1.63},
{"name": "妈妈镇", "lat": 107.148174, "lon": 30.564627, "waste_amount": 1.16},
{"name": "庙坝镇", "lat": 107.102218, "lon": 30.600076, "waste_amount": 2.04},
{"name": "欧家镇", "lat": 107.063548, "lon": 30.515789, "waste_amount": 2.04},
{"name": "清水镇", "lat": 107.130434, "lon": 30.677090, "waste_amount": 1.09},
{"name": "合力镇", "lat": 107.010545, "lon": 30.761962, "waste_amount": 0.56},
{"name": "渠北镇", "lat": 106.963688, "lon": 30.876893, "waste_amount": 0.58},
{"name": "青龙镇", "lat": 106.919115, "lon": 30.888598, "waste_amount": 0.67},
{"name": "万寿镇", "lat": 106.937162, "lon": 30.973417, "waste_amount": 0.56},
{"name": "临巴镇", "lat": 107.063378, "lon": 30.893397, "waste_amount": 0.77},
{"name": "土溪镇", "lat": 107.056366, "lon": 31.041071, "waste_amount": 0.79},
{"name": "东安镇", "lat": 107.130933, "lon": 30.979729, "waste_amount": 1.49},
{"name": "李馥镇", "lat": 107.012041, "lon": 30.944996, "waste_amount": 0.79},
{"name": "三汇镇", "lat": 107.150945, "lon": 31.031017, "waste_amount": 0.75},
{"name": "文崇镇", "lat": 107.172132, "lon": 31.185103, "waste_amount": 0.81},
{"name": "丰乐镇", "lat": 107.137620, "lon": 31.107014, "waste_amount": 1.07},
{"name": "涌兴镇", "lat": 107.077411, "lon": 31.124230, "waste_amount": 0.85},
{"name": "贵福镇", "lat": 106.985951, "lon": 31.133471, "waste_amount": 0.84},
{"name": "岩峰镇", "lat": 106.971372, "lon": 31.061791, "waste_amount": 1.12},
{"name": "三板镇", "lat": 106.961374, "lon": 30.996846, "waste_amount": 0.77},
{"name": "静边镇", "lat": 106.837473, "lon": 31.012512, "waste_amount": 0.75},
{"name": "清溪场镇", "lat": 106.827981, "lon": 30.892694, "waste_amount": 0.67},
{"name": "龙凤镇", "lat": 106.755759, "lon": 30.938577, "waste_amount": 0.63},
{"name": "宝城镇", "lat": 106.765051, "lon": 30.838877, "waste_amount": 0.87},
{"name": "新市镇", "lat": 106.697042, "lon": 30.845795, "waste_amount": 0.73},
{"name": "有庆镇", "lat": 106.838522, "lon": 30.804417, "waste_amount": 0.82},
{"name": "定远镇", "lat": 106.791018, "lon": 30.801988, "waste_amount":
阅读全文