|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( l0 ~4 t9 m; n9 m3 e7 ^
6 B P8 R8 [+ J/ a& j2 @( k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 P& f7 N8 o1 |4 X/ b* p) h! v" {7 R2 Y+ S) Z8 f' b8 v
begin P_read arriving, ^. `( p- I" a2 J
while 1=1 do begin7 m# \: M+ @# e. W
read A_tote from "data.txt" with delimiter "\n"" P* K, W; ^3 T) A) O$ b
read A_time from "data.txt" with delimiter "\n"6 p: i+ [% z8 v# l. H
read A_leave from "data.txt" with delimiter "\n"
& N J+ U1 {: M1 M8 t6 f8 o o4 } read A_picks from "data.txt" with delimiter "\n"
" p9 F6 K- ]- c3 L) L set load type to A_tote
, G% n6 |4 S- V I7 O8 Y0 h# _ if A_tote="tote 1" then set A_induct to 11 f# q+ \7 X& V& O& K$ m0 W
else if A_tote="tote 2" then set A_induct to 2
# r; a% i8 O0 T4 w else set A_induct to 3 ; k- U: p7 x- N2 I$ x8 B
set A_i to 05 k/ o2 V4 S! I- R1 C4 m
clone 1 load to P_induction
& V( F6 E Y+ `( y* f& V- |0 ~0 N& n wait for A_time sec
2 X& \2 O0 N' z6 |/ ]. B$ u end% m* M- M" ~& |
end& y; W4 ~% G O f6 ?7 K0 M$ i
# W- _9 e# K7 V
begin P_induction arriving4 a3 m7 q! O! z1 q+ a
if A_induct=1 then clone 1 load to P_pick1+ p- r# m; B" v/ M' Q- F
else if A_induct=2 then clone 1 load to P_pick2
* E) j* F$ Q$ v' ~. m else clone 1 load to P_pick3# }4 }, B0 Y4 X6 o: z, w* ~
end
# O4 Z y5 _- M- t' j; X
# u5 {0 ~3 C" A' X! wbegin P_pick1 arriving' J: N% e& N, V
set A_i to 1
; M4 N% A* d/ `4 g$ X move into Q_induct1
% `0 l7 l0 N' F3 h& M8 y: P$ G, u move into pickaisle.induct17 s7 G( U( V5 @0 n5 C
while A_i<=30 do begin
1 j2 }9 j. {6 ~3 x travel to pickaisle.con(A_i)
5 c8 L+ _$ w6 O0 j" T; q) w/ | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 a( H! Y8 X# F( Q6 k else wait for 10 sec( P% A0 M5 j L/ _# i) I
if A_i=A_leave then send to die
4 R- ]* v: b9 n; I; {0 I else inc A_i by 1! a/ D+ r: A7 M3 D9 _) M
end* R9 \ g& t$ {+ P
end, z4 e% K* m( D$ w9 M
( V0 H- r/ F. Gbegin P_pick2 arriving' Z& R& S+ j% N9 ~' f
set A_i to 115 z( F! h5 ?* k$ q
move into Q_induct2
) C2 o. m3 n3 @$ ?+ ?7 o move into pickaisle.induct2
# `, z$ L# z% M6 z1 M% U8 c: r while A_i<=30 do begin+ H4 X: Q3 |0 ^' I& I2 M
travel to pickaisle.con(A_i)4 _. D8 X+ b& ]' l# P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. {' ], W/ V, W
else wait for 10 sec. M4 o8 R8 T, q& ?, F" C# x! v
if A_i=A_leave then send to die% R+ l: ]' v/ f+ p6 y1 `, e
else inc A_i by 1
) D1 D& g1 |6 N/ E7 {( I6 W end
! N! R! K6 ?# j( j8 xend- j; { [. z, l$ X( H' {. U, [7 u# K
" y& d/ Q: O5 J
begin P_pick3 arriving
6 g ^! D1 H9 I6 ]" p; ]: ?* _ set A_i to 21
" o; \6 t8 m0 V move into Q_induct39 H& f2 h1 z5 W" z* }' g' [
move into pickaisle.induct3
\3 f( _- R; x) @ while A_i<=30 do begin
- L7 |+ j7 x( D( W travel to pickaisle.con(A_i)! c" M4 N7 O! a% Y F; m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 H* F+ O8 {" m
else wait for 10 sec
5 h- [. ?6 T/ ?2 V9 l5 O if A_i=A_leave then send to die$ q! |4 W3 n& I; R7 R, d
else inc A_i by 1' U F% z+ e: J& d, \8 e
end( Y0 f+ r9 ]! `& S
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,其它按你的 ...
|