|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) |- i" _0 `( p/ }- B, c
5 K! x q, I4 J; Z9 d, x& }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 H! s8 m% a4 k9 G4 \2 N5 e& O; ?; d! z/ y! n( o* I# B
begin P_read arriving: k4 c7 X7 o6 d7 T$ B+ f; b
while 1=1 do begin x, }8 c5 @: D. ]+ i* [5 _( w
read A_tote from "data.txt" with delimiter "\n"" b! K2 M2 G" P
read A_time from "data.txt" with delimiter "\n"
/ |* m: M9 u: Z7 | read A_leave from "data.txt" with delimiter "\n"% p8 J9 D6 F1 W1 D" g
read A_picks from "data.txt" with delimiter "\n"
( Y* k' }- c) w9 ]# _5 b set load type to A_tote
; {- P* h' W* G if A_tote="tote 1" then set A_induct to 16 I# l! t6 h9 M4 o% G
else if A_tote="tote 2" then set A_induct to 2
6 v) u/ J, r3 v& z. e" x else set A_induct to 3
# s# Y5 N$ D1 x% ?3 o6 E set A_i to 0
! Q- W3 T: a0 K1 g* v clone 1 load to P_induction4 }# B8 ~- J1 F4 }0 p; @1 r" K
wait for A_time sec
7 ~1 F) b' ?; m& `% v end6 J7 V7 H3 i' P
end) @0 x8 h9 P+ X& n9 Y' u# o& Q
0 q# S @7 G" Z0 i. N" g
begin P_induction arriving/ v5 o9 I- e8 U4 O
if A_induct=1 then clone 1 load to P_pick15 O/ J# [, }2 M- W
else if A_induct=2 then clone 1 load to P_pick2
4 ~4 X* G# }6 v! y6 i else clone 1 load to P_pick32 w8 v8 Y: x/ y O y- t
end. f3 ~: R: n/ J f: j" y; E
3 S. J6 [$ m- X( ?4 l1 Q9 Hbegin P_pick1 arriving
) J. \( q! {0 r, c Q! N& u' p0 I% r set A_i to 1
Y( ^/ `. y9 M* z move into Q_induct14 _2 c8 j" |+ b% H! Y
move into pickaisle.induct17 b+ E6 N" s' ]& ^7 G& R
while A_i<=30 do begin
4 J) C5 a/ t, ^* L travel to pickaisle.con(A_i)5 O( x: }7 \$ I4 T' S/ U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ c1 q5 I% \ E) v
else wait for 10 sec
; k0 a2 }3 M" J4 D2 } if A_i=A_leave then send to die
" n: K. U" O- D: ?! J+ s" L else inc A_i by 1
# l5 H- x/ N: _: { end
1 A* g5 b) V) `8 a/ G- u6 aend
' F* R8 u9 g% ~' V# ^- }0 t# k! O# D! `" s: L) [+ f6 [3 Q9 u: E; A/ y5 o
begin P_pick2 arriving
5 X) u4 ~$ c* _0 b# `1 v set A_i to 11
: J0 n6 L- A( @3 Y/ l" c) K4 H move into Q_induct2
" i& H2 s0 X$ X! K: W) x move into pickaisle.induct2
' e" x$ k. N; g" ^ while A_i<=30 do begin
, Y/ n" I: H( i$ k+ I travel to pickaisle.con(A_i)( A' p( l9 p u$ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* a( K& ?9 l5 @: n" I5 ] else wait for 10 sec
) v- q/ l8 l7 F* y& V" r# u: w" ~6 k if A_i=A_leave then send to die
* \& v+ F7 U( ~6 {% M/ y else inc A_i by 10 f( y( N9 e3 J. C: s. ?
end
9 }" u9 \' p5 t% ^6 nend4 Y; [% X8 p7 x- p! \& Z
5 P! g+ ~- s0 F* v$ u" V
begin P_pick3 arriving4 x% @: M* z: |2 C8 G! ?
set A_i to 21
4 Y( Z; v! a" s1 F9 k move into Q_induct3! i# l8 k0 L! C" `7 S
move into pickaisle.induct3
' a7 D0 H. o% \$ t z while A_i<=30 do begin7 ?5 M5 q9 X X+ s
travel to pickaisle.con(A_i)
, v8 x- N' c6 I, Y+ x; G5 S: m) R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
l; ?( k! x# Z! c$ N7 O% N& H else wait for 10 sec% r$ U- v/ i: V
if A_i=A_leave then send to die- v" T, I, z3 d8 G& A
else inc A_i by 1
3 L; F. Q7 H$ F end1 k7 s) _( ?) z6 r$ B9 @
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,其它按你的 ...
|