|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& S, P' P! R" h6 P
Y( C3 Y6 z6 K: H. E+ e, 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中的数值,不知道会不会有什么不妥。+ y3 d* J w" s
9 R1 H n# m. j Z3 q
begin P_read arriving: h$ T d- ]6 R5 H( N2 o
while 1=1 do begin
F% ?3 y% B' I- G2 }4 z H6 I read A_tote from "data.txt" with delimiter "\n"( S. o1 M3 {( u) F1 W9 K
read A_time from "data.txt" with delimiter "\n"
( M/ i$ f) u( ~7 N ] read A_leave from "data.txt" with delimiter "\n"1 f6 t! k& t5 A9 m* v; o! R
read A_picks from "data.txt" with delimiter "\n"
* K0 Q6 r! o" S+ U: K, E set load type to A_tote
' u: R: |5 ~* K0 r' i if A_tote="tote 1" then set A_induct to 1
9 r7 e: o# m& K* z6 o1 k0 E else if A_tote="tote 2" then set A_induct to 2# |0 _- Q. s/ [& I7 d1 r
else set A_induct to 3 1 R& \& h% ]# o! A
set A_i to 0
* H. S. q- i7 d% Z clone 1 load to P_induction
% a% l! i3 F6 Q$ ~' | wait for A_time sec& y: v% E: F& o0 R# _2 w
end
# M4 ]* s5 a& send ?" h8 C9 n, ]
9 O6 l/ a& P1 ]0 Fbegin P_induction arriving- j- |- k( J( h6 P) R
if A_induct=1 then clone 1 load to P_pick1
6 g+ |, X `) ] else if A_induct=2 then clone 1 load to P_pick2
' n- n7 M! o3 P M2 o! Q else clone 1 load to P_pick35 u0 F6 W W3 A3 y
end6 c* }0 u" t$ o% X0 X% L; [
; k, i5 a9 Q/ P E9 @% h, Hbegin P_pick1 arriving+ o! C5 { Y# k/ V1 _8 h: h4 [' v
set A_i to 1% j) y: d4 C; [/ R
move into Q_induct1
7 |5 i+ v$ X9 `) y8 X4 G move into pickaisle.induct1
. n# a4 f- J0 a$ t- i while A_i<=30 do begin" e, R7 @' ~0 `! T; q' u
travel to pickaisle.con(A_i)
: y$ C9 \0 d" B( @5 E( p+ m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ P% k: N" d! X+ _$ R1 r
else wait for 10 sec8 z: E. e1 V* Q# g
if A_i=A_leave then send to die
& U5 h0 ~3 i7 n. [ else inc A_i by 1
$ X% [" ^- M% u end" O, d$ j K1 Z* ?, d
end9 c+ j& O7 U: }" |
4 H: r4 w1 p' C1 cbegin P_pick2 arriving
; W! I+ U8 T% \" s T set A_i to 11- B" D( `( n* \- U
move into Q_induct2! N* T }1 S) X! I6 e y7 D9 t& C
move into pickaisle.induct2' v4 u6 m8 j' Q- r/ }4 S5 g* z. y
while A_i<=30 do begin
0 Y @4 W; a) F/ f travel to pickaisle.con(A_i)
" [3 y, O& @8 L v" M8 d6 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* q4 g/ `8 b. r* F8 U% G3 k else wait for 10 sec
* ?; x' [. @% E ^' n% w if A_i=A_leave then send to die
+ Z1 L9 |7 m, J% d: ]% v8 [ else inc A_i by 1
9 S$ O! `8 H9 H& c, l" V0 N0 T; Q end' h. O: r5 j; ]/ h
end
7 Z9 {& U* Z \% Q: [ B. y) c5 G
begin P_pick3 arriving2 v; W+ U* W7 s# A. ^. G7 V
set A_i to 21* N* N5 ^8 f- d
move into Q_induct3" q |. C; T2 W8 o8 X: s+ l1 U$ w7 _
move into pickaisle.induct3
) i8 N/ _; Y* `: A while A_i<=30 do begin
4 V1 O2 ^) a4 I travel to pickaisle.con(A_i)) x' \' J, c6 l8 E( P9 _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! l4 c" A2 @9 ~8 n z# x8 n( v else wait for 10 sec
- ~9 [0 L; |' B. |5 P n% M O if A_i=A_leave then send to die
9 N5 V6 c" b6 }9 ^: r4 k1 n* s1 v5 [ else inc A_i by 1
: o+ P$ A. v1 F0 l0 l end
0 x. e4 Z. a/ q) 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,其它按你的 ...
|