|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! o" @% s x" D& _4 O0 T2 M/ j, f( ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 k3 w- L% t5 E
+ Y) T* w, M9 {0 m1 m0 K1 Sbegin P_read arriving
2 M8 \, j# H& `. W while 1=1 do begin
$ z2 Z5 _9 o& }+ K- H. C( u+ ~8 a, y5 w read A_tote from "data.txt" with delimiter "\n"8 _6 m' M- B o5 o
read A_time from "data.txt" with delimiter "\n", ?9 [; w8 _! [
read A_leave from "data.txt" with delimiter "\n"( g% P- U$ o8 S$ D: m/ h# B8 N
read A_picks from "data.txt" with delimiter "\n". D( }4 T. Q9 z4 M1 t) `# l
set load type to A_tote) k7 W- n n( u' v7 o w
if A_tote="tote 1" then set A_induct to 1- x. |6 ], |% ]4 C i
else if A_tote="tote 2" then set A_induct to 27 {- z' i* u- m: ?- f
else set A_induct to 3 ! a2 Q0 y! I% D/ O( K8 r
set A_i to 0- ~% N- Q/ P4 [3 c0 b
clone 1 load to P_induction
0 L$ r$ i! R' n wait for A_time sec+ ]9 H. Z6 R7 f% _
end
2 G3 y2 y: E& S4 ]. q7 qend
3 s% ]# y3 x* g! s, G8 m0 K4 ?8 S% }
begin P_induction arriving7 I2 \, l0 O" d a
if A_induct=1 then clone 1 load to P_pick1% g+ |5 d' _( Q
else if A_induct=2 then clone 1 load to P_pick2
5 Y$ g; P7 n! M: I else clone 1 load to P_pick33 v$ [7 ^2 x# l9 h9 J, }
end& F. L! i# ]. d7 m/ `9 _
: B+ |3 N$ ?8 Dbegin P_pick1 arriving3 G) H# K: q! j
set A_i to 1
/ s2 g/ O+ ]. D! s3 T move into Q_induct1
& ], j& m+ W4 U( g move into pickaisle.induct12 B8 h8 x9 K$ O% u
while A_i<=30 do begin- A# n2 X7 @3 _$ O1 }
travel to pickaisle.con(A_i)
0 Z" H2 R1 O8 d. }$ X0 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 V0 c% P- h- O2 K j, V4 `
else wait for 10 sec: U$ A! e8 l* l4 \8 l8 `! g1 |, b
if A_i=A_leave then send to die
6 p- {: V0 F0 E; J else inc A_i by 12 ~. @. K. u2 D' `' |& p
end
# @! h! F P! H vend
* j3 ~7 u1 _- d( X& ]: J8 | l% [$ I5 s" Q
begin P_pick2 arriving- F# n4 e/ S" j `/ B
set A_i to 11' V. q& z9 p" V* a) C: c
move into Q_induct24 u5 D0 T2 I4 u Q) t" z
move into pickaisle.induct24 R4 X8 G9 q( {
while A_i<=30 do begin
: p9 ^7 Y% y1 j travel to pickaisle.con(A_i)
# Y7 A& N5 u c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 D/ g4 `& _4 ~6 |4 w; H2 ]
else wait for 10 sec
' Q8 M+ G0 Z4 G if A_i=A_leave then send to die
- w! g7 o1 H/ z0 \; { else inc A_i by 1
; ^/ R$ L8 D1 b1 i3 T6 H, p end) v3 a$ e2 Y% l/ o
end
9 W6 ~) ]) f# h: O: Z
& |& x9 Y% v) @7 `2 J/ dbegin P_pick3 arriving. J. N( ]0 {% Q) D
set A_i to 21, ~9 X" I5 C5 @$ R5 g6 w) b$ o" O
move into Q_induct3, P) n! ?, R7 }" F3 V
move into pickaisle.induct3
6 g/ e% a H5 O9 \) K( ?* A while A_i<=30 do begin8 t% n6 i. m: F- }
travel to pickaisle.con(A_i)( x$ m) M, s% r/ ~2 _4 N( t; A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* M; C! [3 D7 v" ]& B# J% q3 C else wait for 10 sec9 {& X# j/ b* y9 l4 Y
if A_i=A_leave then send to die
1 W( ]# d- R+ h( ? else inc A_i by 1
2 a; X+ [$ a$ n8 G; Q8 e* v end" e' K1 [7 ^3 h; w8 W
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,其它按你的 ...
|