|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) n5 u0 _. p W* s9 s; Z) A, N L& c/ V5 i* Q
我的问题是,在每个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 k8 _! c7 l2 s
5 y' n8 y- T' I# jbegin P_read arriving, g- P, V0 U3 w+ o
while 1=1 do begin" J- V& B3 G5 v# w1 b
read A_tote from "data.txt" with delimiter "\n"
% H X/ o1 O4 ?% }9 w, N read A_time from "data.txt" with delimiter "\n"3 B0 ~; {' b& @ g @' K" Q
read A_leave from "data.txt" with delimiter "\n"
6 Q) F ]: j2 Y read A_picks from "data.txt" with delimiter "\n"' y8 p) v) j a n0 I2 A" H
set load type to A_tote
: H4 A) V' H1 L, f6 u if A_tote="tote 1" then set A_induct to 1( L7 N7 V0 H2 R6 [, [
else if A_tote="tote 2" then set A_induct to 2
- {2 ^7 \) \9 @" y) W else set A_induct to 3 9 T* ^7 [+ ]; l9 J
set A_i to 06 W y( g5 I5 |
clone 1 load to P_induction/ _: Z. e6 k. J, m1 d' r/ O- J) T
wait for A_time sec
; h* Y3 c$ l5 [+ M8 W A3 D3 r end
* S3 f" Y3 b* `6 w) [/ y0 | uend
3 V* ~$ W' D( P" Q: k! W, z$ @6 G6 T! T8 j% [/ _( Z5 H
begin P_induction arriving5 ^+ T. F D0 _/ T. u. F' t/ ~6 V
if A_induct=1 then clone 1 load to P_pick1 Y- k& G1 i: l' K3 @
else if A_induct=2 then clone 1 load to P_pick2
' {$ j$ y. P9 u* _" l. a3 B else clone 1 load to P_pick3) j. x5 S* V% A0 O3 p
end1 r# u% ]7 {. b3 ~4 ]& j! S
8 E' ?. Z+ x2 O. y. w7 X( Ibegin P_pick1 arriving9 Q. _7 y/ F- u
set A_i to 1
4 n D6 l+ i9 } move into Q_induct1, i* V* A+ o8 q9 @5 v, \4 p( x
move into pickaisle.induct15 s6 E7 e. ]5 h8 a
while A_i<=30 do begin$ }, c" A0 R. R: W0 A
travel to pickaisle.con(A_i)
+ E: {( z0 @$ `2 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% L5 D2 N: A; H0 v( {! ]8 D else wait for 10 sec
8 a* d6 d, U$ X% ?7 b if A_i=A_leave then send to die
" K }* B. M& c1 d else inc A_i by 1
4 m& M3 Z2 P7 O0 z% P0 ? end
. |1 q9 P. A9 g" x4 m& ^' \4 i; tend& X) _ r! z# A* b$ ?# Y! W3 `
# m/ l* O8 d7 E" y$ `( _ `begin P_pick2 arriving
/ C9 K" t- S2 u2 q set A_i to 11- }) W C; w9 o
move into Q_induct2
/ D) i; C7 s0 R4 l move into pickaisle.induct2
1 t e/ L5 A5 \3 c' ? while A_i<=30 do begin9 |$ @9 I4 X. V& }" o
travel to pickaisle.con(A_i)
$ L( c, s' K* }' |0 ?8 g. {+ ^$ N3 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! m& y, v5 q+ c3 J& [ else wait for 10 sec
) }9 v; ~+ A9 q0 }5 S! m) f4 ] if A_i=A_leave then send to die0 J6 `4 ^9 z6 \ X0 w
else inc A_i by 1( r5 U; B. W% [4 j/ k$ g- n
end. @; P4 x8 n) a# [, ?8 U8 O
end
1 K# R; [& ^7 E. l" N G- p
: J- Y2 q' l& x) m- U1 n% Gbegin P_pick3 arriving W# W3 F& c- \1 }' k: l+ }
set A_i to 217 ?2 V h" x: T( F* J
move into Q_induct3
# g* `: e- c! J0 H, W move into pickaisle.induct32 z4 f8 c) P: f7 A; G- G
while A_i<=30 do begin
: a' Q8 N/ G# M: s3 a# J travel to pickaisle.con(A_i)
! _! ^: G3 b% l( D' A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c i$ j8 P* l, f
else wait for 10 sec
0 B4 ~) k9 R7 |! u6 \" B! k if A_i=A_leave then send to die: @0 r1 R4 a' A1 ^: J" m
else inc A_i by 1
: o# y2 h- @0 o. Y4 ~( k end
5 o6 e7 u4 L2 i4 s! f$ Cend |
最佳答案
查看完整内容
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,其它按你的 ...
|