|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 K5 Q9 r5 ^2 b+ i; |
# w8 l) G% M# K+ U3 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中的数值,不知道会不会有什么不妥。
2 E/ w; d- e2 W! a, A" A+ g" K1 e' l
' m7 K/ ~" u. i: z! bbegin P_read arriving m! s9 u( O9 Q. {
while 1=1 do begin
" g- P! \* Y+ `# V, D read A_tote from "data.txt" with delimiter "\n"
. c, T$ P( q& o read A_time from "data.txt" with delimiter "\n"9 g# {* @. z+ q3 J+ x k7 R
read A_leave from "data.txt" with delimiter "\n"2 S2 x7 r# G+ ~8 O* O; a( z9 @
read A_picks from "data.txt" with delimiter "\n". _4 ?$ W6 T. k
set load type to A_tote
+ R) V& p; b( {- ^$ E D0 f if A_tote="tote 1" then set A_induct to 1; J3 A2 R* b+ U4 ^1 N3 t8 _
else if A_tote="tote 2" then set A_induct to 2
3 t, D" ]- g( o. f6 V0 E7 A2 V" Z else set A_induct to 3 0 S, C8 a6 n$ y' A! [$ m) k
set A_i to 0, F1 { k3 J! g' B( i
clone 1 load to P_induction$ W' t H4 G* l" ?' \# _$ h
wait for A_time sec
" F/ t/ s9 j& S; p: b; W& n end
; P5 O) s; V, w9 {9 d3 @3 b7 s |8 ^end
4 x9 V3 j+ n+ r8 T4 M& W
7 a1 w' v* [2 ibegin P_induction arriving
# w" p& J* s/ v8 r# Z if A_induct=1 then clone 1 load to P_pick1
: G/ m7 R, M. ~6 M# Q9 f( {8 X else if A_induct=2 then clone 1 load to P_pick2! w, i0 m+ [! b
else clone 1 load to P_pick3
8 k& y/ [7 Y; h5 Z6 B: T. |( mend
7 B( e' [) e+ j2 K
5 y* n7 F9 r$ c& y# J7 o! T& S& Zbegin P_pick1 arriving
6 s5 h- e/ U6 L% H. F% J set A_i to 1
# Z2 h2 n% l+ c' R& u+ v move into Q_induct1
* U) v) F$ M7 P& L4 Z$ r4 R move into pickaisle.induct14 g4 r3 x& P; \, W% Q) {
while A_i<=30 do begin
2 U3 H! y3 c! z0 \* C- T travel to pickaisle.con(A_i)
, c0 J; V; [6 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 _9 g2 Z* K+ u2 a8 e else wait for 10 sec% b- c# f9 e* `
if A_i=A_leave then send to die! q/ n. n9 K! v* ]5 N! w1 p
else inc A_i by 1 u3 Z0 f% B% I8 {3 H3 \5 ]$ E% K
end$ N8 R1 b' D! u* \5 D
end
: w; p- H+ l3 M [1 x. g8 N! x! ]+ @' f3 R8 J5 `' ~
begin P_pick2 arriving. T/ v. w0 {$ Z# a% S% s7 Q
set A_i to 11
! B$ x$ W# ^: m6 ]' F8 J move into Q_induct2
8 g' W& o6 h( O+ R: K7 I# g move into pickaisle.induct2
m$ y0 |1 R/ L while A_i<=30 do begin1 r% x. M4 C% s, n4 z* Y$ H
travel to pickaisle.con(A_i)
2 q* F. P/ O( x( e& M- b0 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, k/ }" @" g& Z1 C" G1 @4 k else wait for 10 sec
; P" q6 w1 g+ j2 B if A_i=A_leave then send to die
4 S6 s' N( w9 S( I3 ~# z else inc A_i by 1
/ A4 l9 O, e& ]' ? end& o7 C- o/ s3 w9 w- m, B. L
end
2 ?0 u4 l; k" [' P
( N* V0 ?8 I' f+ F8 N5 w( ~! j, Qbegin P_pick3 arriving
( @ p) E9 \) |: v* E set A_i to 21
6 X3 X3 |( h7 D |+ w: U move into Q_induct3
: o0 S/ J& H6 z. T move into pickaisle.induct32 n4 A0 R( d3 [' D, T( d' w; W
while A_i<=30 do begin
8 J8 A* J2 j0 I travel to pickaisle.con(A_i)
% k+ ?$ m* ^: M0 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# [/ {2 ?# H; z: L0 }4 W" h else wait for 10 sec
) T* p( v C" y, C t8 F if A_i=A_leave then send to die' W$ l! x; J P' f
else inc A_i by 1
6 S4 J! e3 P6 u5 G" u end; i. o) h2 M# H
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,其它按你的 ...
|