|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, J3 u5 f" d; d+ J6 q$ o( n
7 t8 o( |- F/ w我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* t' m$ j, _3 W$ C- \
/ j4 W1 P. W: X; Zbegin P_read arriving
1 y$ _+ v! t) v2 y' w1 g- G7 X while 1=1 do begin# j9 r9 l& P1 o8 |; e, A
read A_tote from "data.txt" with delimiter "\n") P+ N+ e* u: a/ h+ a
read A_time from "data.txt" with delimiter "\n"2 D o! V) `( E; C/ ~$ b! x h5 A
read A_leave from "data.txt" with delimiter "\n"3 c; b! Y+ p: g9 x" u3 N
read A_picks from "data.txt" with delimiter "\n") W$ u% e2 D0 W# `
set load type to A_tote
) M O% r2 f/ L' D2 Y+ y- E) [6 Z if A_tote="tote 1" then set A_induct to 1. }) S9 E8 P* \0 t \
else if A_tote="tote 2" then set A_induct to 2
+ r$ [: ~ T2 w* Q3 M else set A_induct to 3
$ {/ I& k+ S: F' i& g( | set A_i to 0
) }# ^+ Q8 k+ u. d clone 1 load to P_induction$ ]( Q; J! F! b% P
wait for A_time sec
) H. k+ x* j$ F end/ k6 `. _# m/ D, P
end
! I6 Q n* y5 t; i' z; S
! L8 G, |0 @5 K. @: Gbegin P_induction arriving4 q! }$ ^0 W4 d
if A_induct=1 then clone 1 load to P_pick1! N9 U" \4 A. }; Z( p8 n7 K
else if A_induct=2 then clone 1 load to P_pick2
5 X# {0 _- ^& O: v% E4 L9 X' A else clone 1 load to P_pick31 \, }8 t) W; v
end* o0 ^1 w" p$ a+ c) v2 F7 i7 ^2 m
9 X- F5 Y5 Q+ j$ K0 d' @/ O% c4 Ebegin P_pick1 arriving
6 Q. I! ]: M4 _% }' v1 o. u set A_i to 1; T( h& V5 z# J$ ]
move into Q_induct1) H8 i% t& {( l7 A6 z
move into pickaisle.induct1 T- J- z/ q* ^" u
while A_i<=30 do begin
* m+ o# r [/ p4 m# Q+ S5 U# j travel to pickaisle.con(A_i)5 P9 y" R D* S" X% `8 K. W. }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# U" U+ O2 N; D0 h else wait for 10 sec+ v6 a! {( e$ i: p0 k; b
if A_i=A_leave then send to die; X. y* ]! G/ S( f( a
else inc A_i by 1: C- W: l' L$ }6 S' P+ T
end
/ M6 l1 }, I8 ]( \+ Kend; {4 w: _- R& g6 F& B. O$ O. B
2 j" q9 O& j) s9 V
begin P_pick2 arriving9 y# t' x$ c; X0 x* t; o
set A_i to 11% r3 f- I6 t1 u& w
move into Q_induct2& V; _- ? [' _( L" j
move into pickaisle.induct2
3 Z% O3 ?/ |: N, ]8 H; Q9 F while A_i<=30 do begin
8 |9 n! l. u1 l; e' m travel to pickaisle.con(A_i)
9 y. Q9 e2 }- H/ k( ~4 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- ^) P5 n: k8 v* j4 H" {/ r else wait for 10 sec L$ v# g2 g+ ]6 @* ^5 @
if A_i=A_leave then send to die
. r/ h9 U( x; m" \ else inc A_i by 1/ `6 N. c4 }' f( P3 ^7 n
end& E& ?& f! d9 M* i. A5 N9 B
end0 n2 \8 O, G- R, U) p% u; K
: ?3 c8 E* X" n1 r9 ]; k; N" G: E* t
begin P_pick3 arriving$ l( z5 j# ?6 t; R# b: n
set A_i to 217 D3 J7 S2 m! b9 ^
move into Q_induct36 N0 n" L3 k: ?5 \! v
move into pickaisle.induct3
" m" E1 l# H2 a4 o, |5 o) f3 G' [ while A_i<=30 do begin
; V" [ X/ H. s5 I1 R: z" y+ { travel to pickaisle.con(A_i)
4 g5 T9 e+ l' ^% s/ h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h) ^4 Z- P g$ P% R else wait for 10 sec
B! M6 I+ P- q% x8 {2 l- d1 l if A_i=A_leave then send to die0 u: ?$ p1 Y' q+ k$ x. n2 t
else inc A_i by 1: ?) L& V6 p! }; n5 R: @
end
: h: b4 g! x% ]: B' \5 F3 ~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,其它按你的 ...
|