|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 o1 w# n0 Q4 H2 M
3 Z1 W) a# u1 b; t我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# l3 M! F% Z& U& r, |3 ^- ?, F9 {4 D4 o; g$ F& T
begin P_read arriving
* j7 O! a0 w8 f' Y3 N: S while 1=1 do begin
1 ^8 M" W0 p3 ~" O- R read A_tote from "data.txt" with delimiter "\n"
+ _+ \) K' C8 |+ B read A_time from "data.txt" with delimiter "\n"
- ]7 \4 V/ N+ }% z) q& z, Z( N read A_leave from "data.txt" with delimiter "\n"$ g9 h. o- n9 \1 X' ]6 P
read A_picks from "data.txt" with delimiter "\n"
: _$ H8 s6 ?+ K+ m; W1 o set load type to A_tote
# r4 s" U/ k, [9 Z9 O+ l' k5 v if A_tote="tote 1" then set A_induct to 1' A$ v* U- a, K' y$ ^
else if A_tote="tote 2" then set A_induct to 2$ l" w3 u% o. \: z% l( o
else set A_induct to 3
; }, G/ ?. B3 O1 M2 f0 P8 ~5 k set A_i to 0
5 b% k& a& F/ w9 J u' z6 p! V clone 1 load to P_induction
; ^3 n8 `2 L# k5 a3 ^) F wait for A_time sec
, |3 U8 {2 F2 e# S end: u* H( `* K3 v. p% x& a, ^
end
' `8 x2 t* H& g2 B& [$ V9 S3 l6 h3 D
begin P_induction arriving7 b" B: z+ `- c; X
if A_induct=1 then clone 1 load to P_pick1' A+ A/ a( c8 r# b u6 m& p
else if A_induct=2 then clone 1 load to P_pick2
. o1 ~8 w0 c9 E. T6 G else clone 1 load to P_pick3( b3 r: P2 n$ f" M' `
end2 Y+ }" }) R! M6 @. n C3 m/ B
- H' p) u! l6 F8 x' S4 Q' q. O
begin P_pick1 arriving
% u) R4 |5 I4 H. l set A_i to 1
6 p/ T3 |& f* l: `! H move into Q_induct1 {/ Y( e6 r0 C, o
move into pickaisle.induct1( e3 C: ?' V( W, a
while A_i<=30 do begin
; v6 c6 `3 I5 A( c# Z travel to pickaisle.con(A_i)+ X2 Z( F$ E; N# y, u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 E, Y& @! |% ?( e
else wait for 10 sec' u9 D5 Y H w: q" t9 S1 S
if A_i=A_leave then send to die
! |3 w9 {4 L- R! m" L# ]( o else inc A_i by 1 X/ `4 ]# ]3 q, v* a' e
end+ x( O/ ^- t" z+ {
end
" N y1 k' b" ?- O
. e# e5 H1 h' W5 Obegin P_pick2 arriving
5 p2 O& [7 ^% J9 J set A_i to 11- q5 g% J8 F. ]( W5 R
move into Q_induct2
- Q L5 K1 S0 K+ E5 _& U$ V( o move into pickaisle.induct2
3 ?9 k" N* h+ v* g* j. E while A_i<=30 do begin
, |! B2 c' H, \ travel to pickaisle.con(A_i)( M1 T" ~+ y6 z, Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, u" b; E% W, s9 N
else wait for 10 sec* m0 ?% Y+ P- o" F. y
if A_i=A_leave then send to die. d4 ?) Y3 u% D) o1 p
else inc A_i by 16 {9 R9 f1 k0 x
end0 S. l6 R# S1 I$ H% E! V# C
end& G9 a2 a' ^( i2 {- G( k
: S3 F5 C' N4 d1 q5 L5 Y
begin P_pick3 arriving6 i" c/ H3 j1 A8 V
set A_i to 21
% Z' [3 N& d. s+ M3 G move into Q_induct3: [ ]/ J1 m. i9 ]% T
move into pickaisle.induct3
' ?0 F$ R1 j4 L while A_i<=30 do begin$ c7 t J2 B B- ?* c
travel to pickaisle.con(A_i)
3 `1 g4 \/ R- J& T6 A( k# i- P8 \8 p. b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ z& P- L" d' b7 i0 ^9 o. k! n6 T else wait for 10 sec
9 C0 J- a+ Z- o: I* E+ S if A_i=A_leave then send to die
$ o' e# P3 \# x1 R# Y! ? else inc A_i by 16 \: G! e0 k2 P$ U7 t$ R8 c
end9 _* M$ } d5 k" D8 U, U
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,其它按你的 ...
|