|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% v5 K7 }- v% `: I
! ]* R3 B" X3 W& R I G8 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中的数值,不知道会不会有什么不妥。
0 c; v: m; H9 p8 G4 p& ?) z' e& N1 b0 n! e
begin P_read arriving8 l' m9 M" s* {, u/ j8 |
while 1=1 do begin3 v" J5 g. V* h. I1 V7 X9 ~6 W
read A_tote from "data.txt" with delimiter "\n"7 x) \0 t1 J e# `2 ?. e& Q/ R
read A_time from "data.txt" with delimiter "\n"- E4 f4 c* G* \/ @ I5 V" a9 {! t
read A_leave from "data.txt" with delimiter "\n"9 \/ Y& }$ w/ z
read A_picks from "data.txt" with delimiter "\n"+ i% M. D4 p! m6 y
set load type to A_tote
4 [8 n! r& S0 K8 a& O+ K3 I if A_tote="tote 1" then set A_induct to 1
; n- z' Y5 E. m0 k else if A_tote="tote 2" then set A_induct to 2
3 O6 n3 I; T1 Q9 \! T" f else set A_induct to 3 ; C. A1 U U- p `8 W [
set A_i to 02 g# {6 L& M$ Q
clone 1 load to P_induction" n/ P2 u) i7 B& j
wait for A_time sec
- Z- I, Z7 O9 @3 ~0 V end3 ^1 n6 W- [. P# {3 O t
end
& X- K& s R( m! H: w$ m$ K3 a; O9 j7 ^6 d
begin P_induction arriving
) Q# u. l+ R' \5 [1 K& ?1 D if A_induct=1 then clone 1 load to P_pick12 V8 \ r* ^$ r
else if A_induct=2 then clone 1 load to P_pick2; e: M; B9 K8 i
else clone 1 load to P_pick3
; p, \7 M8 e8 N) O, iend, g! a9 s8 n4 O' [7 K- [2 ^
1 m' V! W7 u2 V9 l. x( Dbegin P_pick1 arriving. m( q6 v: t. F; O" i( n
set A_i to 11 b% F9 P+ v/ K/ r- J
move into Q_induct1
. K. R, E2 B6 [. L: D9 G* p: h. M move into pickaisle.induct19 v+ P. w* ^& O& I" |% h( }
while A_i<=30 do begin1 I' v! R5 T0 k1 B* k
travel to pickaisle.con(A_i)3 X+ ?! E0 j% x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 V: x5 Y& U/ I
else wait for 10 sec6 N+ u z& C) w: @2 o. g( w
if A_i=A_leave then send to die
, I! W d& c. I else inc A_i by 1; R- R# z4 C& t( F2 r9 Z
end* L, Y: h- W" B. q% R; o! s8 C
end1 ?- x( S6 Q1 c$ E' _4 Y& ]
5 `: K' A9 n8 M0 y3 B; Mbegin P_pick2 arriving' Z* g& |( H& {3 C8 T1 `
set A_i to 11, X* T2 D2 C" I3 A- d( ?% c! a
move into Q_induct2 x. t5 c! A- l( `6 n- G: T
move into pickaisle.induct2
/ V6 J* b8 H* ?9 h! _0 y while A_i<=30 do begin
9 w/ h; [+ x7 s7 i# {$ w2 N6 ` travel to pickaisle.con(A_i)) w5 j) J# C$ }$ o. F( x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) p- A4 ?( \# b" a' a3 [& P5 T else wait for 10 sec
+ ^# P9 X4 {/ w7 W if A_i=A_leave then send to die2 }5 s/ K: |7 {6 K8 F+ B! S" Q
else inc A_i by 1
) F, ?% P3 ~* [! z: j end
/ B2 ^7 j/ v* `! aend
) @% f* W' \4 L' G6 m, D5 F% }. |/ g; o
begin P_pick3 arriving# W4 ?5 e2 U1 n3 G
set A_i to 21' U# e: K0 X; a/ K% H
move into Q_induct39 J! G8 H/ D! _- C x
move into pickaisle.induct37 }9 C# W2 s: `- ~8 a+ f
while A_i<=30 do begin
$ t1 V$ w+ _8 o% p/ W& j travel to pickaisle.con(A_i)/ g- ] c2 y4 _3 @8 m. ~0 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! \* v v) t; }3 b- i0 q* ~; g else wait for 10 sec
' q" e( f4 s% W( s! i if A_i=A_leave then send to die# K5 m! d' z( m0 j, D" r
else inc A_i by 1$ f9 }( I3 U- {/ s( f
end$ q3 p8 K- w4 ~8 ^$ n7 X0 Z3 Q& d
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,其它按你的 ...
|