|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; |8 z" V: ^) E' y/ U9 t5 B& \1 ~+ n5 \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% q T7 q b7 ~+ h
' |+ A* k3 [: y3 i" f! c$ e0 |begin P_read arriving; U! z" w) m/ v: D
while 1=1 do begin, w4 }2 `6 n& t9 Z
read A_tote from "data.txt" with delimiter "\n"
|$ y) J8 M9 I' o- `" E* {# e2 u read A_time from "data.txt" with delimiter "\n"
- Q2 E/ V* t5 b. T X read A_leave from "data.txt" with delimiter "\n"0 N3 o Z' z" t8 l
read A_picks from "data.txt" with delimiter "\n"! B' E! P8 P% n6 l4 K
set load type to A_tote
6 Z1 T- U3 W" X if A_tote="tote 1" then set A_induct to 1
" s" t- r# A1 V& w else if A_tote="tote 2" then set A_induct to 2' t( N9 v0 K( v& S1 Y, K
else set A_induct to 3
7 v V2 K! f4 i2 U5 }8 l U3 M set A_i to 0
7 z$ f4 L" f5 o2 N/ j" u, A clone 1 load to P_induction5 j2 B s. B7 f5 f
wait for A_time sec
$ s6 K- w6 ~# h" A& U& h end! l# J, q1 |3 G2 p
end
& u( q4 k% g9 F1 Q. C! ?" R A- E5 c* X8 q
begin P_induction arriving% \: Y- f5 _5 \+ D% @$ x8 `: a0 }- p" `
if A_induct=1 then clone 1 load to P_pick1
4 s! ?( i c* e0 \) p& i0 P2 J B else if A_induct=2 then clone 1 load to P_pick2
: F/ p& h# F9 Q; Y else clone 1 load to P_pick3( @ c9 n4 p2 G- b
end
1 z& H) }) B& {1 J( X J( `7 C6 `, D; M6 M& |7 p8 F" g ^% }
begin P_pick1 arriving
0 a" y/ N T# a3 I. ^ set A_i to 1& x, u7 m( U/ _6 v; p" D3 Q4 e
move into Q_induct1, C5 J/ u& w0 F% q$ Q& {
move into pickaisle.induct1" y% |% X- ~ g2 `( ~/ k
while A_i<=30 do begin
. B$ U- }9 O6 t+ w2 W, R( }$ u travel to pickaisle.con(A_i)* g, v0 D6 h, ^! c2 p( K9 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% V$ m) H5 e6 N9 a: @$ C6 l% H& y
else wait for 10 sec
( x' D0 L X$ L5 }4 s, w if A_i=A_leave then send to die- G+ u# x# r* y1 i8 X/ D
else inc A_i by 12 W+ d% I; c! n4 A1 X7 l- ?
end
% r& o& x8 }4 j; C) oend
' y# @ h/ e: T
; O% d4 y- k& q/ V( s6 Zbegin P_pick2 arriving( Q3 M9 }! x; S: Z6 y
set A_i to 11
7 k. ?# B+ L7 G' x, _ move into Q_induct2
1 j2 }& @8 Q9 o/ p8 Y move into pickaisle.induct2& t# F! W. c: T' L* D* P' j
while A_i<=30 do begin
5 X" z0 U2 v0 S5 N travel to pickaisle.con(A_i)# X3 Z: J2 Y u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 J8 R6 ~. }; H% v1 f
else wait for 10 sec( C, c {6 d. m- z/ C" R. F6 L5 H% J
if A_i=A_leave then send to die. }: l7 E4 ]1 ?* E
else inc A_i by 15 a0 a& c; ~6 r" V& K8 ?
end
4 b9 ^5 W" V4 g( e3 _6 a7 L$ cend
0 @# F$ A7 h2 {7 l# d! V( h3 l, v9 Y; e' X: W
begin P_pick3 arriving
9 F" F2 Y6 J9 E3 l+ | set A_i to 21! p/ s! H5 c/ Y* S
move into Q_induct3 Y8 W! `( F1 y
move into pickaisle.induct3
/ u' h) u" C' W( F4 [4 Y while A_i<=30 do begin$ Z7 o2 V! W4 ]: b, L8 e
travel to pickaisle.con(A_i)2 b& i$ Q: [: [4 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 [8 k% c+ e" H8 C* r- X9 w- N
else wait for 10 sec
! ?0 X @( T3 j* g1 w2 K! I if A_i=A_leave then send to die& ~" l! Q/ k& x1 x3 U
else inc A_i by 1
/ B9 [: J! [3 b; U& r7 W) a0 t end4 U! t9 k8 D$ H- O+ @" b* \4 s
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,其它按你的 ...
|