|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# H! z& T+ |% d2 [1 v
! e* U* V# ^, l/ U我的问题是,在每个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 ], T' o/ A7 [; c. d" t# a. K
! R0 C6 _% g3 L o3 j0 J! G0 @begin P_read arriving6 g7 V, N! j7 g' {
while 1=1 do begin: p4 n% g- K- ?3 d
read A_tote from "data.txt" with delimiter "\n"
7 f1 u" T% Z' T( X# `. D2 x4 T read A_time from "data.txt" with delimiter "\n"
2 ]$ y- E7 B" H2 |3 n- G7 Q a read A_leave from "data.txt" with delimiter "\n"
+ `6 n2 f/ w7 ^2 I% R, D1 F; y5 ?% B read A_picks from "data.txt" with delimiter "\n"
/ y! E. n8 a3 F6 g* J" j set load type to A_tote6 A) L4 _$ n) g
if A_tote="tote 1" then set A_induct to 1
' ~ j# }; a m; W2 V7 ? else if A_tote="tote 2" then set A_induct to 2
$ e! z+ N4 T, [$ O else set A_induct to 3
' U3 i5 \4 G! c9 s1 B set A_i to 0
5 V9 |& u' ^0 g* g clone 1 load to P_induction8 Y0 d# R* v: }
wait for A_time sec
8 C6 R8 A% r5 ]9 Z- x t8 \' ` end
" T% D2 e% w. g3 ^: x/ u: fend5 o; I0 ]0 K9 c: A1 c, p4 j( c
8 S) s6 ^& ^: r, G6 K+ Mbegin P_induction arriving
9 g4 q# m5 N ]# n' X2 Y/ R/ Z if A_induct=1 then clone 1 load to P_pick19 O( N1 L; l$ f+ j, ^' M8 p
else if A_induct=2 then clone 1 load to P_pick2
/ W$ H$ V0 ?: Z6 M/ @) I1 \4 h5 A else clone 1 load to P_pick3
5 W, x2 U6 l! k D, \% T! Dend, F t& I+ r9 z" b+ o2 i# c
$ T, l% G5 N) {
begin P_pick1 arriving' D0 o! [$ x3 H. g
set A_i to 1
3 E {% X1 L( d+ N move into Q_induct1# @; A( H+ u" g* h. x2 \
move into pickaisle.induct1
1 J- B7 J* {! |& G, V8 C- m while A_i<=30 do begin( j A( L: x4 Q8 N
travel to pickaisle.con(A_i)
8 b( `/ J( P$ R _- z! R+ V8 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% g- h) K# q+ i; b6 D& ?
else wait for 10 sec
0 R) N% }+ F' I0 l1 p1 C% d% L/ m if A_i=A_leave then send to die
~) u, n$ n* Y else inc A_i by 1
- H1 N' D. |4 ~/ z* h* ?! a* A' a end
6 R* Z3 y Z8 T: @1 Mend
: ^5 v8 E/ A1 [( N& L9 p
& o* D; }# R* [" @3 bbegin P_pick2 arriving+ J+ f0 N1 A# j( i* s
set A_i to 11# q. a+ R4 V" \0 D6 r I8 u
move into Q_induct2
! `, _# |# `+ S8 u move into pickaisle.induct2
! {5 ?. d. R- Y. _ while A_i<=30 do begin u: O9 [3 C% l
travel to pickaisle.con(A_i)
# f( M, V5 A1 q. Z b F( N! F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; O- T: q+ K9 y3 r- \5 U% X else wait for 10 sec
) G: {/ Z% i/ a ]3 Y. N* d+ l8 k" ? if A_i=A_leave then send to die
% D' W6 M% b8 [" y$ `! F, [ else inc A_i by 12 z: c3 {% c- G& I
end) w9 f# X4 \3 H/ x, @( L# j: G
end& a( _, I$ }3 v5 Z1 _! W/ O
7 p2 T% C+ o6 U) ~) @0 }' mbegin P_pick3 arriving- P+ \( f$ t* Y& e, v) n9 z
set A_i to 21: L2 K N1 q5 C# g- ?
move into Q_induct3
- L: W, k; g" v/ r move into pickaisle.induct3( a0 }6 i3 q F3 M& ^
while A_i<=30 do begin
( Z2 F% V; h) d6 K4 B# e travel to pickaisle.con(A_i)8 M6 |( W& _9 x4 V4 h$ ?9 V' X. [2 S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 o! D# C# g2 o" M; @7 J
else wait for 10 sec
$ m1 |) P0 F" a3 t5 G. @. P. m if A_i=A_leave then send to die
7 E7 x* l- k: J+ X else inc A_i by 1
" r! O% ^$ l9 x5 r6 ?1 h end
+ }. o7 j" v6 T- I1 tend |
最佳答案
查看完整内容
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,其它按你的 ...
|