应用介绍
此项目是2018年数学建模B题RCV智能调度仿真的代码。
下面展示小部分代码:
import random
cnc_sign={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
cnc_set={"cnk_1":1,"cnk_2":1,"cnk_3":2,"cnk_4":2,"cnk_5":3,"cnk_6":3,"cnk_7":4,"cnk_8":4}
cnc_time={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
rgv_set=1
total_time=0
rgv_move1=18
rgv_move2=32
rgv_move3=46
cnc_one=545
rgv_ji=27
rgv_ou=32
rgv_clear=25
work=0
rgv_time=0
wl_time=0
aim=False
aim_wl=False
aim_made=False
ok=False
huai={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
huai_time={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
rand_tag=False
wl={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
finish={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
xiu={"cnk_1":0,"cnk_2":0,"cnk_3":0,"cnk_4":0,"cnk_5":0,"cnk_6":0,"cnk_7":0,"cnk_8":0}
def inp():
try:
global rgv_move1
global rgv_move2
global rgv_move3
global cnc_one
global rgv_ji
global rgv_ou
global rgv_clear
rgv_move1=eval(input("RGV移动1个单位所需时间"))
rgv_move2=eval(input("RGV移动2个单位所需时间"))
rgv_move3=eval(input("RGV移动3个单位所需时间"))
cnc_one=eval(input("CNC加工完成一个一道工序的物料所需时间"))
rgv_ji=eval(input("RGV为CNC1#,3#,5#,7#一次上下料所需时间"))
rgv_ou=eval(input("RGV为CNC2#,4#,6#,8#一次上下料所需时间"))
rgv_clear=eval(input("RGV完成一个物料的清洗作业所需时间"))
except:
print("输入有误")
inp()
inp()
while True:
if total_time>=8*60*60:
print("8小时完成数:{}".format(work))
break
else:
for i in cnc_sign:
if wl[i]==1:
if total_time-cnc_time[i]>=cnc_one:
aim_made=True
finish[i]=1
if cnc_sign[i]==0:
cnc_sign[i]=1
if abs(cnc_set[i]-rgv_set)==1:
rgv_time=total_time
while total_time-rgv_time<rgv_move1:
total_time+=1
rgv_set=cnc_set[i]
cnc_sign[i]=1
ok=True
if total_time-rgv_time==rgv_move1 and ok==True:
ok= False
aim=True
......................想了解更多请下载附件。
©版权声明:本文内容由互联网用户自发贡献,版权归原创作者所有,本站不拥有所有权,也不承担相关法律责任。如果您发现本站中有涉嫌抄袭的内容,欢迎发送邮件至: www_apollocode_net@163.com 进行举报,并提供相关证据,一经查实,本站将立刻删除涉嫌侵权内容。
转载请注明出处: apollocode » rcv智能调度仿真代码
文件列表(部分)
名称 | 大小 | 修改日期 |
---|---|---|
附件1.py | 1.20 KB | 2019-03-23 |
附件2.py | 1.92 KB | 2019-03-23 |
附件3.py | 1.07 KB | 2019-03-23 |
附件4.py | 1.95 KB | 2019-03-23 |
2018mathematical-modeling-code | 0.00 KB | 2020-09-23 |
发表评论 取消回复