Automod Syntax 编译的一个问题
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
begin P_read arriving
while 1=1 do begin
read A_tote from "data.txt" with delimiter "\n"
read A_time from "data.txt" with delimiter "\n"
read A_leave from "data.txt" with delimiter "\n"
read A_picks from "data.txt" with delimiter "\n"
set load type to A_tote
if A_tote="tote 1" then set A_induct to 1
else if A_tote="tote 2" then set A_induct to 2
else set A_induct to 3
set A_i to 0
clone 1 load to P_induction
wait for A_time sec
end
end
begin P_induction arriving
if A_induct=1 then clone 1 load to P_pick1
else if A_induct=2 then clone 1 load to P_pick2
else clone 1 load to P_pick3
end
begin P_pick1 arriving
set A_i to 1
move into Q_induct1
move into pickaisle.induct1
while A_i<=30 do begin
travel to pickaisle.con(A_i)
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
else wait for 10 sec
if A_i=A_leave then send to die
else inc A_i by 1
end
end
begin P_pick2 arriving
set A_i to 11
move into Q_induct2
move into pickaisle.induct2
while A_i<=30 do begin
travel to pickaisle.con(A_i)
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
else wait for 10 sec
if A_i=A_leave then send to die
else inc A_i by 1
end
end
begin P_pick3 arriving
set A_i to 21
move into Q_induct3
move into pickaisle.induct3
while A_i<=30 do begin
travel to pickaisle.con(A_i)
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
else wait for 10 sec
if A_i=A_leave then send to die
else inc A_i by 1
end
end pickaisle.induct1/2/3是个什么东东?
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
begin P_induction arriving
clone 1 load to P_pick(A_induct)
end最大的系
begin P_pick arriving
set A_i to procindex * 10 + 1
move into Q_induct(procindex)
move into pickaisle.induct(procindex)
/*check the type of pickaisle.induct(i), for your last problem.*/
while A_i<=30 do begin
travel to pickaisle.con(A_i)
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
else wait for 10 sec
if A_i=A_leave then send to die
else inc A_i by 1
end
end
其中的procindex为整形,代表当前process的序号。
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。 你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
页:
[1]