|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ B# R2 H. _+ p# ^0 ` o y' j/ T1 r! ~% T' {- b1 _& N5 y* C9 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# R* u& E! @8 u+ E' ^8 M* L4 w
% `3 ] [" M( E& F7 hbegin P_read arriving+ ]0 t6 U7 v S( H+ U" l J: X
while 1=1 do begin" o! v }0 _2 J6 c3 b
read A_tote from "data.txt" with delimiter "\n"3 }5 S) F) ]" h
read A_time from "data.txt" with delimiter "\n"2 T D) @* C+ N: a" G8 h; j% M
read A_leave from "data.txt" with delimiter "\n"1 D& g8 h$ L: y% @- }
read A_picks from "data.txt" with delimiter "\n"3 P- }8 e/ ^* h( M* T# f. q
set load type to A_tote9 E9 h( w# F8 S/ C8 ?
if A_tote="tote 1" then set A_induct to 1
0 u+ f; D% \. z$ A1 Q else if A_tote="tote 2" then set A_induct to 28 o6 E; o0 F, A( [' T
else set A_induct to 3
: ]3 a5 X4 Q) j! e+ y" Z0 d set A_i to 0 s @ p; N# t: f5 p
clone 1 load to P_induction
' R7 l- B' F' R8 H' V! N% d wait for A_time sec
! H) X/ M" O( v$ N/ J5 T! [+ ^9 ~ end
3 N. P- b0 _3 O# [end
, A5 \) t% ]- N9 f# _" Z: M2 ?$ v- R
begin P_induction arriving
) q8 L. o7 p( }# G- z if A_induct=1 then clone 1 load to P_pick19 ^& a! l' B% E- k' v" R
else if A_induct=2 then clone 1 load to P_pick2% m1 \6 u5 Z+ U9 E! I3 O
else clone 1 load to P_pick3
# i7 @( Y+ E3 H7 W( ^end' J* o+ t) E- ^. h3 U
% }/ O$ A2 A3 B5 E/ Q9 Zbegin P_pick1 arriving
+ w! o' F( x: r# E7 {# D; z set A_i to 11 v) I& F6 }0 v. v! D
move into Q_induct18 v4 ]& U4 ]; M4 T
move into pickaisle.induct1! X- a) c; `. O% i, d
while A_i<=30 do begin
) i9 I' ^8 n8 Y( _4 V travel to pickaisle.con(A_i) y- t' C) P9 ?' k w- R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- i- h; @. U) f6 Z
else wait for 10 sec
1 Z/ _7 R: J: u% E* ~ if A_i=A_leave then send to die! t. E1 X) s" e, b3 s" F% ]' u
else inc A_i by 1
# s4 L6 g8 |* G; A* d; O* Q" h end
3 e6 M U5 J2 r0 v# _9 C% m$ Hend
( } [& c! L8 g. L; K, B& c5 ]7 V2 B+ y4 j% [7 ?
begin P_pick2 arriving
9 ~$ L# j* x* l+ R% m* I6 s set A_i to 116 V2 r: z7 E% B' n% L
move into Q_induct23 N* D7 D- C0 k& i" k
move into pickaisle.induct2
" `: n4 l0 ]6 M' O0 q) }) `' n$ Z while A_i<=30 do begin" r2 h* M) u. l: I- ?. a: h
travel to pickaisle.con(A_i), B" s0 ~. i5 E& i- p5 J# G; w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, E y' n7 x4 |, _' q1 @0 Y
else wait for 10 sec) Y0 v: u* h6 y. q+ i
if A_i=A_leave then send to die5 g2 v' A4 `* ?% ^
else inc A_i by 1; z' K1 K4 ^$ Y% G: l
end- x' \* Z. T5 ?. w/ }
end
. L3 M. a7 V& f+ k I$ f8 k# c; U) ~! k
begin P_pick3 arriving
0 @ B/ ~' t, C1 @5 T' b" F: y8 q' h set A_i to 21. E$ q. q& y+ @. h: k
move into Q_induct3; [, w7 t# `' P' U: P E
move into pickaisle.induct3- x, z/ X: }: X' P _
while A_i<=30 do begin
% S+ B( Q0 Q4 _$ r2 I5 T/ ~/ t% F8 [ travel to pickaisle.con(A_i)0 n9 b& j7 u" }' W- N3 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ W5 {# e; V+ H( C! e3 H
else wait for 10 sec
: Q2 x1 Y- S0 }* f3 T if A_i=A_leave then send to die
9 M2 A- \: j3 ^2 X; b9 E: J else inc A_i by 13 l$ B9 h0 D1 C* @& |' X
end& M) D+ r- S7 i# w$ R& j6 ^
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,其它按你的 ...
|