• 大小: 0.2M
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-12
  • 语言: 其他
  • 标签: 其他  

资源简介

张晓峰UE报告.zip

资源截图

代码片段和文件信息

“““
**********************
#寻找路径
**********************
“““
import networkx as nx
import matplotlib.pyplot as plt
from collections import  Counter
graph=nx.DiGraph()
nodes_list=[123456789101112131415161718192021222324]
edges_list=[(12)(13)(21)(26)(31)(312)(34)(43)(411)(45)(54)(59)(56)(65)(62)(68)(78)(718)
            (86)(89)(87)(816)(95)(910)(98)(1011)(109)(1015)(1016)(1017)(114)(1110)(1112)(1114)
            (123)(1211)(1213)(1312)(1324)(1411)(1415)(1423)(1510)(1514)(1522)(1519)(168)(1610)(1617)(1618)
            (1710)(1716)(1719)(187)(1816)(1820)(1915)(1917)(1915)(1920)(2018)(2019)(2021)(2022)(2120)(2122)(2124)
            (2215)(2223)(2220)(2221)(2314)(2322)(2324)(2413)(2421)(2423)]
#edges_list=[(12)(13)(26)(34)(45)(56)(59)(68)(78)(89)]
edge_length = [1 + 0.1*i for i in range(len(edges_list))]
for i e in enumerate(edges_list): graph.add_edge(*e weight = edge_length[i])

#graph.add_edge()
for n in nodes_list:
    graph.add_node(n)
nx.draw_networkx(graph)
plt.draw()
plt.show()

path_iter=nx.all_simple_paths(graph110)
pathes = []
for p in path_iter:
    pathes.append(p)
print(pathes)
print(len(pathes[1]))
m1=[0]*76
print(m1)
path_matrix=[]
print(len(pathes)-1)

for i in range(0len(pathes)-1):
    for j in range(0len(pathes[i])-1):
        if pathes[i][j]==1 and pathes[i][j+1]==2:
            m1[0]=1
        elif pathes[i][j]==1 and pathes[i][j+1]==3:
            m1[1]=1
        elif pathes[i][j]==2 and pathes[i][j+1]==1:
            m1[2]=1
        elif pathes[i][j]==2 and pathes[i][j+1]==6:
            m1[3]=1
        elif pathes[i][j]==3 and pathes[i][j+1]==1:
            m1[4]=1
        elif pathes[i][j]==3 and pathes[i][j+1]==4:
            m1[5]=1
        elif pathes[i][j]==3 and pathes[i][j+1]==12:
            m1[6]=1
        elif pathes[i][j]==4 and pathes[i][j+1]==3:
            m1[7]=1
        elif pathes[i][j]==4 and pathes[i][j+1]==5:
            m1[8]=1
        elif pathes[i][j]==4 and pathes[i][j+1]==11:
            m1[9]=1
        elif pathes[i][j]==5 and pathes[i][j+1]==4:
            m1[10]=1
        elif pathes[i][j]==5 and pathes[i][j+1]==6:
            m1[11]=1
        elif pathes[i][j]==5 and pathes[i][j+1]==9:
            m1[12]=1
        elif pathes[i][j]==6 and pathes[i][j+1]==2:
            m1[13]=1
        elif pathes[i][j]==6 and pathes[i][j+1]==5:
            m1[14]=1
        elif pathes[i][j]==6 and pathes[i][j+1]==8:
            m1[15]=1
        elif pathes[i][j]==7 and pathes[i][j+1]==8:
            m1[16]=1
        elif pathes[i][j]==7 and pathes[i][j+1]==18:
            m1[17]=1
        elif pathes[i][j]==8 and pathes[i][j+1]==6:
            m1[18]=1
        elif pathes[i][j]==8 and pathes[i][j+1]==7:
            m1[19]=1
        elif pat

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-09-25 08:18  张晓峰UE报告\
     目录           0  2018-09-24 17:16  张晓峰UE报告\UE代码\
     文件       10652  2018-09-24 21:33  张晓峰UE报告\UE代码\ue.py
     文件      180106  2018-09-24 21:43  张晓峰UE报告\UE算法.docx
     目录           0  2018-09-25 08:17  张晓峰UE报告\参考代码\
     目录           0  2018-09-25 08:17  张晓峰UE报告\参考代码\matlab\
     文件       26112  2017-01-02 17:13  张晓峰UE报告\参考代码\matlab\1.xls
     文件        1157  2016-12-30 15:26  张晓峰UE报告\参考代码\matlab\Dijkstra.m
     文件        1130  2017-01-13 23:34  张晓峰UE报告\参考代码\matlab\book.m
     文件        1464  2017-01-07 23:28  张晓峰UE报告\参考代码\matlab\example1.m
     文件        1303  2017-01-07 23:45  张晓峰UE报告\参考代码\matlab\example2.m
     文件        2598  2018-09-22 15:35  张晓峰UE报告\参考代码\matlab\example3.m
     文件        6253  2018-09-24 08:38  张晓峰UE报告\参考代码\用户平衡寻找路径.py
     目录           0  2018-09-24 17:14  张晓峰UE报告\数据表格\
     文件        9746  2018-09-23 10:35  张晓峰UE报告\数据表格\单车道通行能力.xlsx
     文件        9651  2018-09-23 10:42  张晓峰UE报告\数据表格\自由流时间.xlsx
     文件        9056  2018-09-14 20:36  张晓峰UE报告\数据表格\节点信息纯表.xlsx
     文件        9755  2018-09-23 10:34  张晓峰UE报告\数据表格\路段信息表.xlsx

评论

共有 条评论