|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# m* X3 D% Q/ ~6 S
3 g+ h* X+ E4 J0 ~! s2 l$ S我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 d* \, o% S$ h' J/ h0 k
+ Y3 ~9 _. c/ o( I( }; j- x; lbegin P_read arriving) _5 Q6 I/ L1 Y. A
while 1=1 do begin
" r1 o) g" i3 b6 f" y read A_tote from "data.txt" with delimiter "\n"8 C* |; w$ B' {+ i7 b
read A_time from "data.txt" with delimiter "\n"
4 u% q$ M- V, r! A0 p1 g" c2 s read A_leave from "data.txt" with delimiter "\n"5 Z; ^, p( d$ _' E y. Z: B6 G1 O
read A_picks from "data.txt" with delimiter "\n"
( u# K: v+ }2 y* T! x set load type to A_tote' w$ e; x5 i. z; C6 E: m
if A_tote="tote 1" then set A_induct to 1
* ~" s- y; F; \2 S9 k4 b( t else if A_tote="tote 2" then set A_induct to 2, i% n6 N; w( `" N ?
else set A_induct to 3
* X& i# _9 a% y$ G4 {( W- a set A_i to 01 q3 ^, c* h2 c
clone 1 load to P_induction* L# N+ w6 \' L3 |% M
wait for A_time sec6 Q+ k e2 E- f
end; X3 }5 f/ p! m M0 I6 d: d
end
6 L/ R4 ^1 b; j. |' T; W1 K( A$ E. H+ ?: |/ W
begin P_induction arriving
* \2 S% l' {' {3 }. \ if A_induct=1 then clone 1 load to P_pick1
( L9 |+ ?! S2 H# _- T- k else if A_induct=2 then clone 1 load to P_pick2
% ~. Q! p- V& ^8 ?$ u# Y; r4 H else clone 1 load to P_pick3+ g4 c* O) K T: P" Y0 x! ~. n
end
" w# t8 m$ m$ y( b( y( T- ~' J. n `, X' a- b2 b8 n
begin P_pick1 arriving
7 { j" x9 d2 r( n* u set A_i to 1
/ v; R: o: V Y/ d move into Q_induct1
" E% o4 i4 I( \# h- P* }. r move into pickaisle.induct1# l j$ u' R' p+ H- b1 z
while A_i<=30 do begin
8 S- Q E1 Y6 m1 N5 P: w travel to pickaisle.con(A_i)
# j) z0 u+ S5 h% C* q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 i) K6 _. m5 {; A8 S else wait for 10 sec
+ A3 V1 L/ a; G1 e/ z" h8 F if A_i=A_leave then send to die( E, F G/ B' A+ X
else inc A_i by 1
b6 {2 F1 q$ P) I end& T4 |; _4 M, x
end
2 F+ B- e$ K' ^% ~2 P% U: O& m9 y8 Q5 O$ C
begin P_pick2 arriving
" g1 g5 L& ^% e set A_i to 11! u1 f! U: R; B5 z1 ?4 V% \
move into Q_induct2; m/ j" S+ d" s6 U2 k
move into pickaisle.induct21 j3 Z4 P. b" W7 s$ i' ?% d' g
while A_i<=30 do begin3 T# Q& P" F# g! o
travel to pickaisle.con(A_i)+ L4 Z& c+ j8 ?" l6 D. o; r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; K) ~5 R# {" _1 _% o; E1 u else wait for 10 sec) M F" M: S7 y/ y) X' q
if A_i=A_leave then send to die2 q; i( i5 Q* x- D* l/ ]. d4 h0 s
else inc A_i by 15 U B- V, }( H) ?
end: J- T* ? F' R; j& |
end
$ U; g1 L$ ]" `" x9 o4 |" c$ p. n8 D% ~6 L, ^' T, H- R; V4 G% _- Q
begin P_pick3 arriving, d5 @. V9 O3 w8 e! F2 D0 G5 c
set A_i to 21$ ?. E# E6 ~# F0 \/ r8 I2 u
move into Q_induct3
& r, c0 p& @1 P move into pickaisle.induct38 t* B, M; u h$ w. n/ w) ~# X
while A_i<=30 do begin- @" y2 H3 ~% `9 a2 e* [! F* T# z
travel to pickaisle.con(A_i) v5 y" d7 K! i; T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) q% x* Q; h7 o. ]! a! q: L
else wait for 10 sec; |6 N! Q- t/ B, |5 R) E
if A_i=A_leave then send to die
$ n* C- Q6 _. G/ v2 i, a- A else inc A_i by 1) L- T5 n8 Y, t5 L6 \
end
# T6 i) C8 n& Q, fend |
最佳答案
查看完整内容
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,其它按你的 ...
|