|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' Y, B: |4 l, N7 F
% A; Q) h8 O, _! d$ @9 e0 l8 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中的数值,不知道会不会有什么不妥。; Y, h) f; ]# Z
$ K/ v1 m, V" [! p* Ibegin P_read arriving- h# ^/ B* H6 s2 S! @
while 1=1 do begin: y1 m9 Y& Q/ M% N! Q' z
read A_tote from "data.txt" with delimiter "\n"
# t* M% k! P6 b+ D# z9 B read A_time from "data.txt" with delimiter "\n"
& ], m6 ~; B7 q read A_leave from "data.txt" with delimiter "\n"" x- O% c# T7 n1 ]. g
read A_picks from "data.txt" with delimiter "\n"
: m8 H6 L; t5 x1 t set load type to A_tote" |4 d( s9 D& _- }+ y9 s3 f2 O
if A_tote="tote 1" then set A_induct to 1 Q$ J) S* K# U0 Z2 B
else if A_tote="tote 2" then set A_induct to 2
; h0 h! c. J* _' ^ else set A_induct to 3 1 [. d+ \( B3 n2 E/ ]/ q! i
set A_i to 05 y1 r$ S: P2 V2 f9 @
clone 1 load to P_induction
) ?! z s" r3 x Q* z wait for A_time sec/ q1 q, Z+ s. m5 r& v2 O: o
end
. q8 i8 h* Y4 L1 rend
, a% n1 \" S/ S1 e8 O
4 n/ V+ R4 _0 p1 u$ R2 ~0 Z+ xbegin P_induction arriving
& y! t; E; o3 l/ w8 L if A_induct=1 then clone 1 load to P_pick1! M/ Q% d2 ?& F6 @8 c; s. n
else if A_induct=2 then clone 1 load to P_pick2# M/ `/ ~) r6 s! s% L: ?/ g5 l; T- P
else clone 1 load to P_pick3
6 r% V5 S! c3 a0 l# Y4 v# g3 iend1 Y- {( v1 u7 Z+ M* r7 C8 R# c7 k
) x% u! N) s. w* p. h+ Ybegin P_pick1 arriving4 J- `$ g) I9 C* z9 s/ z
set A_i to 13 u6 W! _, N3 i* J* A
move into Q_induct1
6 G/ G1 r0 @& N* j, D move into pickaisle.induct1! o$ p& R) w' s) k' o
while A_i<=30 do begin
" I9 m( z# Q- X) _ travel to pickaisle.con(A_i)
7 |7 x4 p/ ]" m' H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' v; [# |! N4 x( r, i) j8 {" i else wait for 10 sec) C! q+ w! W! o+ d
if A_i=A_leave then send to die) u# K0 U/ M: L
else inc A_i by 1
0 g: J- g/ i8 T, T; E" C end& h- V+ Y& b- Q& X+ K2 ]
end; a, _4 T" J) Q
0 H& e2 P2 C! B; ^9 @begin P_pick2 arriving" x) e) C- C O+ i/ i$ F
set A_i to 11
# |8 c" f5 a& G% L: L2 i move into Q_induct2
% f( O. w/ m' B6 k/ R- G. v5 q5 y move into pickaisle.induct2
" |1 b( e! U9 I) ` while A_i<=30 do begin
9 P- @2 w. Y& i/ q( r! I3 X) v travel to pickaisle.con(A_i); `2 y' v: T( }& t$ _; d% b$ I+ v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
a2 m. J2 l9 i7 x' A' B else wait for 10 sec8 ~4 D$ ^ y- W' a& @9 T
if A_i=A_leave then send to die
/ m* j2 g- E0 p else inc A_i by 17 f8 y" E3 f" u- h
end. t! _& Q. z% n5 u
end4 z* o4 q& F: h) N: z
. ^* \* w8 ^/ r
begin P_pick3 arriving
* L4 E' g/ L1 q5 a+ ^ G3 W set A_i to 21
) X6 G; O" ]8 i$ I; ^ Q) q move into Q_induct3& \! T/ Q# z! R
move into pickaisle.induct3
* {1 f+ F5 n: J9 i X2 w+ x while A_i<=30 do begin
) h/ G! E/ F4 O- o5 P& [ travel to pickaisle.con(A_i)% R5 \. j* u- |) {' a. D) r- Y- W7 u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( y. M2 ]4 l; u
else wait for 10 sec- h; I/ a* \! y# o" J2 i+ K
if A_i=A_leave then send to die
, D" V: e7 H5 |& ?) S6 d8 ? else inc A_i by 1
, G; B5 E3 L$ R7 L: z- G end0 Q- T$ h/ f) d4 J- D1 \
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,其它按你的 ...
|