第一范文网 - 专业文章范例文档资料分享平台

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

来源:用户分享 时间:2025/5/20 4:36:47 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

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文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c8e55d5i9t42xzhv2l5b8_4.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top