|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ U1 ]" A& \) v8 C/ [
! R0 F7 R1 d- Q0 ]1 S( e5 R我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% f( p4 \, j E3 k" w, P) d. G
7 |( f: q/ S3 C7 G8 Wbegin P_read arriving
2 m7 ]+ F+ Q* T9 G$ Q while 1=1 do begin7 f& A' G) j) l* c7 X( k9 y
read A_tote from "data.txt" with delimiter "\n"% Y8 U: L8 _ W. t1 F- \- P. p
read A_time from "data.txt" with delimiter "\n"
8 M' b# w0 x1 ^& p read A_leave from "data.txt" with delimiter "\n"
8 |6 k1 B$ B( D' `, r9 s read A_picks from "data.txt" with delimiter "\n"
3 R0 s" Q0 d8 X$ M; v set load type to A_tote; I( M+ k, [( Y
if A_tote="tote 1" then set A_induct to 14 d% t" Q; I1 ^
else if A_tote="tote 2" then set A_induct to 2$ K9 e% a8 T& p1 c: Y& ]3 ~
else set A_induct to 3
3 [3 w& y* }4 K y/ ^5 A set A_i to 0& Q+ o; Q0 A1 g5 n$ w7 L
clone 1 load to P_induction
, G- F) v# m( H8 e% q wait for A_time sec; ?) j" `- a8 B; z: C" m( ^
end' a. I/ p y: V6 d5 S; w! h' D
end
$ f4 T7 }! q4 W) y6 E0 ^
3 b) ~( \0 c0 U6 G; G( h) P3 _begin P_induction arriving: w. _. Y( W0 o& s
if A_induct=1 then clone 1 load to P_pick1
' N2 O2 h) v% u* g% d% t) p) Z else if A_induct=2 then clone 1 load to P_pick2
H; v/ L# r; p6 X! Y) C; w# ^. X else clone 1 load to P_pick33 D2 c' s; B8 N$ }3 y2 v
end. J6 _; M2 f, h! y% T/ N7 J0 |
. s: V V7 Z2 \8 W/ H% {' h
begin P_pick1 arriving
' m9 `. T0 X8 e0 |1 _& \! N set A_i to 1' S% n) ~( l) l4 {( V
move into Q_induct14 }' q( O8 P! Z0 n& U" c- k- I! ?
move into pickaisle.induct1+ [9 Y& }! Y* p6 g
while A_i<=30 do begin4 [4 N1 A" @" V0 e; {7 \
travel to pickaisle.con(A_i)
! T! A( w" @6 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% F6 l8 m) B/ m
else wait for 10 sec7 I9 t9 W) K0 n% E
if A_i=A_leave then send to die
& x5 A- T) {4 Q/ m a else inc A_i by 1
2 f4 T& K. ^. x% ~4 {' I# j/ k end% {% p2 Y) O% R
end
, N3 i3 f. g3 z) }6 |; e; f+ u2 j, L! I7 l/ k) q
begin P_pick2 arriving
# D: D9 e0 a; U% ]% S' f set A_i to 11
3 h% |% g# S7 ]% D- O; g move into Q_induct2
! Y2 `4 g9 N' g9 @) n3 P/ F move into pickaisle.induct2/ f' x7 K9 c- A% \1 @$ L R
while A_i<=30 do begin9 V) N; Z: j/ u7 e) F" G
travel to pickaisle.con(A_i): a, W% G2 { B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 n& m5 F% m. c( L$ B3 y) Y& F
else wait for 10 sec: [. q0 [* C$ d: K+ B
if A_i=A_leave then send to die! \# U# G7 k. F6 [" s% b
else inc A_i by 1) R: `, p1 \& O k* y
end0 |1 A" Q- L2 t; r1 @
end
: m5 F' c/ h; ?( s7 ]" i b0 i: C7 \4 `
begin P_pick3 arriving
! k5 L4 k" _# \5 \! o set A_i to 21- t r' G9 {4 n/ k4 {: z
move into Q_induct3: `( L. P* i- K# x- I/ N
move into pickaisle.induct3
6 d/ C" C' p; `) `- Q; ? while A_i<=30 do begin( \0 v8 ^! h P& `
travel to pickaisle.con(A_i)8 Q* e6 ^3 w0 R' w/ h5 N& r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% D, _- S6 X: M else wait for 10 sec
6 K. q3 N: M: a1 B if A_i=A_leave then send to die, p$ {9 A6 S. b! ~
else inc A_i by 1
5 A8 I" ?! N1 g end$ q3 n6 p4 U u# y" r7 t- m2 @& E, b
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,其它按你的 ...
|