|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 n; [& ~, D& I5 x
3 s8 u/ o: O0 R: ?* h3 F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ k( `- q! j, b! ^+ k
7 k2 U3 x; P1 k( n4 Obegin P_read arriving
& ^; } ~& R, @7 p while 1=1 do begin
- ?% Y. i4 ^' f* l- D read A_tote from "data.txt" with delimiter "\n"
# P- S9 a' v% o9 t0 u9 ~ read A_time from "data.txt" with delimiter "\n"
& `; q0 r# B* S9 F) P1 G. p read A_leave from "data.txt" with delimiter "\n"" Y% R/ b0 T9 {) r
read A_picks from "data.txt" with delimiter "\n"
, [, K( D1 O8 W( S. f set load type to A_tote# ]$ V$ Z( `% T+ L$ S
if A_tote="tote 1" then set A_induct to 1
: y* F# j3 w+ R1 H. T) o2 `2 A7 L; o else if A_tote="tote 2" then set A_induct to 2
$ B! M3 L& b& G else set A_induct to 3
" w0 L9 R5 `6 j6 U8 L0 ? set A_i to 0
$ y& K% A7 w$ B* i* s0 [) _8 l, N clone 1 load to P_induction1 k( j9 D$ B5 u- v
wait for A_time sec4 p" _" x9 T) q
end3 q- S' H2 q" ]+ i
end3 L* t( f9 G7 I5 s8 s1 z
" o6 Y, H: y* r4 L( P( s
begin P_induction arriving
0 Z* G3 Q4 F3 P9 k) M% K if A_induct=1 then clone 1 load to P_pick1
& S; S% u' h! _/ _5 ` else if A_induct=2 then clone 1 load to P_pick2! ^$ S" A0 f4 a- d/ g$ ?4 r: Y [
else clone 1 load to P_pick3' Q* s+ n1 G P+ E* Y1 V- a
end
. F* {0 ~8 Z8 I! p4 f+ w* i R" z9 n& r' r: u
begin P_pick1 arriving
# z' x8 s3 a. x set A_i to 1 G- V( w% d# p; x1 E
move into Q_induct14 h1 b5 S; w/ K% v, K1 ~4 }% m
move into pickaisle.induct1+ z" H7 I, y% S2 h" _. \
while A_i<=30 do begin
( o! d' d( @. O; y travel to pickaisle.con(A_i)* J: S4 ^% @7 ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' J! W0 T0 R9 q8 U* ]: j: i+ {9 m else wait for 10 sec
" ]9 m3 \2 }8 F" c" E if A_i=A_leave then send to die
* n4 j8 F) [9 o& g" x: }4 q else inc A_i by 1* Z. e* S( W/ I+ v
end
, \5 @+ A. D4 K$ K& jend
Q' t x2 s8 `) t/ B$ W+ D" a; _5 t' U1 L5 ?2 k; k
begin P_pick2 arriving
7 {" K9 C1 Y0 h z9 Q% d set A_i to 115 B: Z* z6 \5 d! b; h0 [
move into Q_induct2$ n7 D, f3 P" m6 ^* a& z
move into pickaisle.induct25 z. F5 d) w( Q" H( M3 J' w; H/ W1 s! l
while A_i<=30 do begin
( |" l/ b0 o" {+ o5 B2 s travel to pickaisle.con(A_i)6 Q. d7 ^2 f( f" {1 i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ V, ]8 [/ R/ B4 M else wait for 10 sec# @7 d( ]' B6 m; ^+ T
if A_i=A_leave then send to die
$ f: |, l V# i1 O# v# Q else inc A_i by 1
1 Y& U- ]4 X- B T4 l# }6 V& P end
" X1 o. h. Y* B2 C6 jend$ w) ], o0 w; h$ a/ o$ k
! Q1 b I0 b C0 i' g
begin P_pick3 arriving
% Y. I: m8 T9 ~5 m$ L set A_i to 21! ~9 u( a% p5 C
move into Q_induct38 y0 n& n5 Z" F4 U7 d
move into pickaisle.induct38 R; `1 \* s8 |$ I
while A_i<=30 do begin
: n. {) |2 T8 q travel to pickaisle.con(A_i)
) V5 d" q% ] ^/ C4 J0 O0 J; p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; K: h9 `- {1 D8 h
else wait for 10 sec
1 W. \, f( ]/ J( D, f* ] if A_i=A_leave then send to die8 J% }6 D3 m6 s
else inc A_i by 1
" C/ @( K& ?0 @- ^* S: A* K end7 d8 i4 l& F8 v
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,其它按你的 ...
|