|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. d) m! t4 u4 J( K" O1 ^4 x0 K- Y1 e2 B0 Q; [+ V
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 n; v+ i7 j. g0 Z' ~* v6 w w
2 ]# J( o/ u' C0 h8 _
begin P_read arriving3 o; k# Z, }0 ]+ r! ~; ]
while 1=1 do begin
& p: N2 ]5 w% E+ S' ~& Q read A_tote from "data.txt" with delimiter "\n"
- T- c$ h7 j; v9 N. n6 r9 P read A_time from "data.txt" with delimiter "\n"* o0 P/ l. ~' u; O3 L. K$ i8 [7 ]
read A_leave from "data.txt" with delimiter "\n"
# T; w* p$ s& W5 W: A. r read A_picks from "data.txt" with delimiter "\n"
9 v# n: \: D* _, a4 s: K set load type to A_tote7 _& z. S( l. P' W" w
if A_tote="tote 1" then set A_induct to 1( }2 n9 J! g- Z9 ]) ^- G
else if A_tote="tote 2" then set A_induct to 2% w p D/ n7 Q) A3 U0 V
else set A_induct to 3
9 |1 ^% G- Q' O3 c set A_i to 0
; Y% Z, z D. X+ m5 V M- A0 q+ d clone 1 load to P_induction
( b2 B# S* N4 y# R. J wait for A_time sec
# O2 |% w. ?) G* B5 X E0 n end
0 m8 I$ w+ y3 I! Q9 V- s! Xend
* ]2 N g0 `# T! t/ G# `; Y% F& y) m3 _) |: M/ Z
begin P_induction arriving
8 [9 i1 f' g3 ]% V' U if A_induct=1 then clone 1 load to P_pick1
/ \0 p; L q; y4 L. W" I else if A_induct=2 then clone 1 load to P_pick2/ D* V! x6 D8 P0 g# F# k
else clone 1 load to P_pick3' L. h+ V% [# R6 K
end
9 |7 Z8 O% J5 h, A3 T( ?7 J- b5 Q' R
begin P_pick1 arriving
$ Z9 E/ _% F2 e) g set A_i to 1
' m& @" O E# w1 P: U3 W move into Q_induct1' z1 l j2 j* h; y) V; E
move into pickaisle.induct17 ^" M/ X) L' J5 N
while A_i<=30 do begin: H1 g% B! u, K
travel to pickaisle.con(A_i)% R2 R G t9 A' V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ u# \- M# h2 @ else wait for 10 sec
& S7 u4 P4 U9 s if A_i=A_leave then send to die
8 A+ N& d3 L0 a" _3 c+ x else inc A_i by 1
8 }, Q. e$ x0 [" S0 ]* Q% P' z2 a& j end
0 }0 b' i5 y* W; |( ?% A- h1 Dend
; [4 y6 x, p$ e' v; [3 ?" l( `0 H& n& {6 R( T/ v/ c, v0 A' t2 P- T
begin P_pick2 arriving" Q; U, k& @, g$ U
set A_i to 11
5 Y8 z0 b" ^, d8 V- C move into Q_induct2
/ ]6 t2 S" \: `6 f8 p move into pickaisle.induct2
/ z& V& R9 I. F" y& X# a% v while A_i<=30 do begin
3 ^. E$ f$ s* X travel to pickaisle.con(A_i), @6 J3 C" q! }: {+ ]( ]( ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x$ N$ r- e, R; ] else wait for 10 sec
' B# ^+ ^% W5 g/ y# w2 n& c7 V if A_i=A_leave then send to die5 Q) N T7 ]8 P& t
else inc A_i by 1
" B( J6 J* ?7 ?. V end- y6 ]. f6 X7 S
end# }: w9 Y9 s4 T" b5 M- B
1 q7 C" U* P5 n. n- W, k: Y
begin P_pick3 arriving. y: l" X. y6 m; e" k# z
set A_i to 21
) |' p. E! K! h( Y move into Q_induct3 d% V* ]2 Z; d
move into pickaisle.induct3, I& ]4 Y( O! t) ?9 K4 [2 G5 }
while A_i<=30 do begin$ t' G6 I6 q U8 R; R% ]' H
travel to pickaisle.con(A_i)- z! l; D; O. Z0 s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 L# r, Y5 P0 J1 M" S else wait for 10 sec, n- c1 [& v/ r7 Y
if A_i=A_leave then send to die
5 ~# q0 c, Q/ |! {* S. E7 x. ^' e6 B else inc A_i by 1
* X8 B7 ~6 S J; a end# z) L* K1 B+ V* i
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,其它按你的 ...
|