|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 w2 ^1 s% F9 u. n7 ~- o! E R
; ]0 x! H) O1 j! J) f3 u% Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; Y' ?' V* Y: `" W
- F& T" x5 j$ xbegin P_read arriving* ]' W- C8 [2 C) b/ K' j. y4 o
while 1=1 do begin
! x0 Z' a6 T" F9 F. L' s" A7 k read A_tote from "data.txt" with delimiter "\n"1 _$ w) ?; `( v8 [' E1 z
read A_time from "data.txt" with delimiter "\n"
, ?! g$ t T2 }" c, r read A_leave from "data.txt" with delimiter "\n"& R. d! W4 g0 y* K
read A_picks from "data.txt" with delimiter "\n"; e+ A: c2 P2 {9 ]- @$ C$ `; X- W' v
set load type to A_tote1 [* S& d; j4 x$ Y
if A_tote="tote 1" then set A_induct to 1
4 B4 v- n2 L0 y) A, m else if A_tote="tote 2" then set A_induct to 2! ~& I: @$ p, r- z( i6 a" q
else set A_induct to 3 ! v6 f0 x& x, }3 G7 {7 e8 m
set A_i to 0
! ?4 Q- B1 Y* w3 q9 \' E2 s* t clone 1 load to P_induction' g$ r* b* ?2 t7 W% ~* F+ j" w
wait for A_time sec$ G1 {' A" h7 W! C
end2 A5 i' Z1 |# P! E. H; [) u4 Z
end
; m9 D5 C! O$ g* M2 ?* E4 S6 e& q8 W" G
begin P_induction arriving" g# } ^# z- \# I" [' O2 l
if A_induct=1 then clone 1 load to P_pick1
; y* {$ v5 h9 O9 [) P6 o else if A_induct=2 then clone 1 load to P_pick2
; w! p9 \: j9 V1 C, e else clone 1 load to P_pick3 S) W3 O0 `0 y p# K" y7 {/ \
end
" r/ ^4 }5 [0 x; P! p# @% y' E! I
begin P_pick1 arriving
# h' J0 w" D2 Z set A_i to 1
5 }$ ]2 r1 w `* p2 c- h) { move into Q_induct1* @7 y* [) _7 {: [. n- c7 F
move into pickaisle.induct12 R% v. C7 k; N$ |
while A_i<=30 do begin& O+ R- Y$ \1 y8 j
travel to pickaisle.con(A_i)
! u3 Y# h3 E* U6 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 m3 S: g! q. e$ Q" \ C else wait for 10 sec
' l6 g+ ]. Q$ [ if A_i=A_leave then send to die
# N; {( N5 s" K3 ?7 G& `1 v$ \" \ else inc A_i by 1
9 K: a8 G) k5 m$ `# q; L% U end7 a( a0 ^; ~9 i+ `5 b- [
end
0 Q0 k5 l. D; P# U3 e
z% Y$ q" |! hbegin P_pick2 arriving, W) K! D s) R
set A_i to 113 `6 P; J" e, B- a$ m! C
move into Q_induct2( f1 t7 H5 L6 `
move into pickaisle.induct24 P. U4 q5 X( S4 t
while A_i<=30 do begin
6 s8 A+ N6 ~5 d2 b travel to pickaisle.con(A_i)5 W: x* f+ V' w4 K$ S; q; W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 e0 q3 v8 W* J# l {" O/ L else wait for 10 sec
; J- |4 T; Z0 j/ T! Y6 t/ m if A_i=A_leave then send to die
; F9 v- q9 z& \& J1 s else inc A_i by 1
* f9 ^ a$ u4 q, v end" Q) t, J# K, W1 E. L# O8 n
end
) K2 ~# | y" W$ N2 @. N7 ]) O2 o) v1 `* k9 w, }1 o
begin P_pick3 arriving
# P. R4 b; J5 ], j y set A_i to 21' d$ O' f$ u! W" ?% O
move into Q_induct3
4 O" G, x9 A! u' s5 ` ` B move into pickaisle.induct3, S( N: ]$ G5 W' C, [4 [3 R( h
while A_i<=30 do begin
1 [: g% {" x7 Z" T& w! m travel to pickaisle.con(A_i)2 ?8 w( [/ l" j: l. x5 P6 s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( m8 C$ y" o+ `6 G4 A
else wait for 10 sec
1 G4 w% | ?2 w1 v6 y if A_i=A_leave then send to die) |3 d h3 |& H+ G9 I/ W! `* m
else inc A_i by 1# ^6 t6 Q; B/ }3 A9 s
end
) O+ k# k9 x/ m7 t3 send |
最佳答案
查看完整内容
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,其它按你的 ...
|