|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 {6 k* \! G! X5 ]& Q$ ?
) l# I& A; v" m1 U( C7 u9 L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. a1 x; b9 p5 Z8 U, _) L3 }6 q4 S8 m4 `0 k5 x
begin P_read arriving
' y2 p8 {$ x6 @# E while 1=1 do begin
' H: _" B- p2 a4 C: I1 L: V5 l1 U read A_tote from "data.txt" with delimiter "\n"
0 k& o3 j5 i5 u read A_time from "data.txt" with delimiter "\n"9 y' E! K; b2 r
read A_leave from "data.txt" with delimiter "\n"4 V d9 l4 G s$ v t2 m/ O
read A_picks from "data.txt" with delimiter "\n"
5 B4 r' N; {6 _2 K8 ? set load type to A_tote: ]+ h. c" s' |/ n$ p
if A_tote="tote 1" then set A_induct to 1
2 k% F' X% @2 W( q: P$ r else if A_tote="tote 2" then set A_induct to 2
, b9 D' w8 ~: n+ d else set A_induct to 3 7 e% u* R0 M/ q7 `1 M6 Q) d( S* k
set A_i to 0
, e3 S6 P5 U/ a" u2 _ clone 1 load to P_induction+ C) b; W- c! D d1 X
wait for A_time sec
9 G0 D3 N c8 F _7 p end) p* {6 L! H$ m1 Z- q# r. N9 \
end
: Q8 k* |3 l& D8 s4 t; [9 E7 `. E1 }2 c; b& V" z. F7 j
begin P_induction arriving
: @& R, B' `6 Y, M' b0 y if A_induct=1 then clone 1 load to P_pick1
# s: I" R: @2 m. P6 p( | else if A_induct=2 then clone 1 load to P_pick29 Z; L) L8 y) b+ [/ v9 I. ~
else clone 1 load to P_pick35 o$ B5 y& W8 X4 A0 d
end
4 ^; ?, D& U9 `* W! H7 V5 e
+ E0 l" c: `0 u2 ubegin P_pick1 arriving
& C7 m0 a3 m" a set A_i to 1
" N) h, I$ R2 K" ?; L# ~8 ]9 X move into Q_induct1
- Q8 q, P! c* t& u( E1 B move into pickaisle.induct1
% t! \1 L& p9 E3 ?1 N! ^2 a; ~ while A_i<=30 do begin0 U! N8 D9 d7 g
travel to pickaisle.con(A_i)
- T9 {) m8 b5 ^! J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% |" u4 ~2 n9 P( \3 }
else wait for 10 sec
' |$ a+ S6 r& O if A_i=A_leave then send to die* `) B8 u% p3 D, o1 C! L, r
else inc A_i by 1
" G2 ~% m) T/ W) @, e- G, Z end
" W9 k4 I: Z" N X. ?2 vend2 o5 X7 q* I" W' {( h
1 F4 ]/ n) ]7 y' \, ^0 Gbegin P_pick2 arriving
& T) ^8 G6 o& ~" E- h; O% ] W" w, k set A_i to 11
/ t% l; I6 C. v0 S. J; B move into Q_induct2
1 [! ?$ `% e+ A% f move into pickaisle.induct2% o& J: \5 s' r0 s/ @, b
while A_i<=30 do begin
$ Y8 j; S, Y* _2 x* c" [ travel to pickaisle.con(A_i)
) X, m- |# E. Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' d. }# r# M! q5 N else wait for 10 sec
; S/ H3 {. ~* P4 ~% `. k8 _ if A_i=A_leave then send to die% g+ T p$ G% n$ j
else inc A_i by 12 g% ?/ l9 I: K4 g
end- A" K4 e% r$ U
end& X% t6 l' O1 s/ d
o6 B( H5 K5 H" f0 {1 I
begin P_pick3 arriving
7 u: `, z# q2 ]- x; k set A_i to 21' H, ?- F+ Z2 H5 t
move into Q_induct3
! X; l# t8 ?2 t+ S4 X move into pickaisle.induct34 L! H7 O# S( N# D! e
while A_i<=30 do begin
/ u. f8 D4 M2 Y& x: _$ q travel to pickaisle.con(A_i)% } Y( k" R& N8 ~ F/ F! Q5 S9 R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( t9 ]5 q3 D# f0 t2 \
else wait for 10 sec
5 y/ G* ]5 r! o/ E$ T if A_i=A_leave then send to die
# b8 o0 P# S3 K else inc A_i by 16 c# x' n, t: C0 k1 [
end
9 M$ r% @$ B4 T: c- U. z1 Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|