矩形排料问题-组合优化问题.docx

矩形排料问题-组合优化问题.docx

ID:59460578

大小:16.18 KB

页数:10页

时间:2020-11-02

矩形排料问题-组合优化问题.docx_第1页
矩形排料问题-组合优化问题.docx_第2页
矩形排料问题-组合优化问题.docx_第3页
矩形排料问题-组合优化问题.docx_第4页
矩形排料问题-组合优化问题.docx_第5页
资源描述:

《矩形排料问题-组合优化问题.docx》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库

1、《二维矩形条带装箱问题的底部左齐择优匹配算法_蒋兴波》matlab的实现,不包括遗传算法部分。functionarea=PackingAlgorithm(length,width,length1,width1,length2,width2,length3,width3,restrict1,restrict2)area=0;frameCount=1;count1=0;count2=0;runLLABF;functionrunLLABFrectBig.length=length;rectBig.width=width;rectSmall(1

2、).length=length1;rectSmall(1).width=width1;rectSmall(1).color='r';rectSmall(2).length=length2;rectSmall(2).width=width2;rectSmall(2).color='b';rectSmall(3).length=length3;rectSmall(3).width=width3;rectSmall(3).color='g';edges(1).x=0;edges(1).y=0;edges(1).length=rectBig.l

3、ength;edges(2).x=-100;edges(2).y=10000;edges(2).length=0;edges(3).x=rectBig.length+100;edges(3).y=10000;edges(3).length=0;while(1)flag=-1;if(flag<0)[sortedEdges,lowestEdge,id]=edgesSort(edges);[edges,flag]=FullFitFirst(sortedEdges,lowestEdge,id,rectSmall);if(flag<0)[sort

4、edEdges,lowestEdge,id]=edgesSort(edges);[edges,flag]=WidthFitFirst(sortedEdges,lowestEdge,id,rectSmall);endif(flag<0)[sortedEdges,lowestEdge,id]=edgesSort(edges);[edges,flag]=HeightFitFirst(sortedEdges,lowestEdge,id,rectSmall);endif(flag<0)[sortedEdges,lowestEdge,id]=edg

5、esSort(edges);[edges,flag]=PlaceabelFirst(sortedEdges,lowestEdge,id,rectSmall);endif(flag<0)[sortedEdges,lowestEdge,id]=edgesSort(edges);[edges,flag]=cannotPalce(sortedEdges,lowestEdge,id,rectSmall,flag)endendifcount1>=restrict1rectSmall(1).length=;rectSmall(1).width=;en

6、difcount2>=restrict2rectSmall(2).length=;rectSmall(2).width=;endsortRect=sort([rectSmall(1).length,rectSmall(1).width,...rectSmall(2).length,rectSmall(2).width,...rectSmall(3).length,rectSmall(3).width]);minRect=sortRect(1);minRect2=sortRect(2);[sortedEdges,lowestEdge,id

7、]=edgesSort(edges);[~,h]=size(sortedEdges);fori=1:hif(sortedEdges(i).y+minRect<=width)break;endendifi==hbreak;endifi==h-1&&lowestEdge.x+minRect2>lengthbreakendifframeCount>300break;endendendfunctioninitialrectBig.length=30;rectBig.width=20;rectSmall(1).length=4;rectSmall

8、(1).width=3;rectSmall(2).length=3;rectSmall(2).width=3;rectSmall(3).length=4;rectSmall(3).width=1;edges

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。