山大公交线路上优化路径的查询实验报告 - 图文

2026/4/30 2:41:43

int all=wholeRoad.Length(); numIndex=new int[all+1]; numIndex[0]=0; RChainNode *temp=wholeRoad.getFirst(); for(int i=1; i<=all; i++) { numIndex[i]=temp->py; if(i!=all) temp=temp->next; } } void numIndexOutPut() { for(int i=1; i<=range; i++) cout<station; if(i!=wholeRoad.Length()) temp=temp->next; } } void nameIndexOutPut() { for(int i=1; i<=range; i++) cout<

13

} return false; } void getPriceIndex()//得到价格索引 { priceIndex=new int[number+1]; priceIndex[0]=0; for(int i=1; i<=number; i++) { priceIndex[i]=Bus[i-1].getPrice(); } } void getlPriceIndex()//得到处理后价格 { lpriceIndex=new int[number+1]; lpriceIndex[0]=0; for(int i=1; i<=number; i++) lpriceIndex[i]=priceIndex[i]*i*i; } void priceIndexOutPut() { for(int i=1; i<=number; i++) cout<

14

void getArea()//依此得到各站点中可能出现的边 { int bound=2*(wholeRoad.Length()-number)+1; area=new int[bound]; int i=1,ii=1; int sign=0; while(i<=bound-1) { for(int j=0; j2*(roadNumber[j]-j)&&i<=2*(roadNumber[j+1]-j-1))

15

return j+1; } } void getDistanceMap()//得到以距离为权值的邻接矩阵 { DistanceMap=new double *[range+1]; for(int i=0; i<=range; i++) DistanceMap[i]=new double[range+1]; RChainNode *tem=wholeRoad.getFirst(); for(int i=0; i<=range; i++) { for(int j=0; j<=range; j++) { DistanceMap[i][j]=NoEdge; } } for(int i=1; i<=wholeRoad.Length()-1; i++) { DistanceMap[numIndex[i]][numIndex[i+1]]=tem->px; DistanceMap[numIndex[i+1]][numIndex[i]]=tem->px; tem=tem->next; } } void dMapOutPut()//打印出以距离为权值的邻接矩阵 { for(int i=1; i<=range; i++) { for(int j=1; j<=range; j++) printf(\ cout<

16


山大公交线路上优化路径的查询实验报告 - 图文.doc 将本文的Word文档下载到电脑
搜索更多关于: 山大公交线路上优化路径的查询实验报告 - 图文 的文档
相关推荐
相关阅读
× 游客快捷下载通道(下载后可以自由复制和排版)

下载本文档需要支付 10

支付方式:

开通VIP包月会员 特价:29元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:xuecool-com QQ:370150219