|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 |1 O1 L" h. M: o1 d
+ Z Z( p& `; r: o+ ]5 O1 Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! g P, z3 q' t$ i
& s% |2 t* |2 `
begin P_read arriving
6 `6 s" G9 _! o1 G! ] while 1=1 do begin" m1 g& S2 h1 Y3 ~
read A_tote from "data.txt" with delimiter "\n"$ s& s) L. x0 Q |( l* G( k
read A_time from "data.txt" with delimiter "\n"! ~8 @( C' a1 ~, o: M
read A_leave from "data.txt" with delimiter "\n"
( J# ?. t( H( Q$ o- C read A_picks from "data.txt" with delimiter "\n"4 _, @ e- A5 n
set load type to A_tote D* w: W( Z/ U. ^/ z8 b& f+ z
if A_tote="tote 1" then set A_induct to 1: e0 ~, V* a0 l5 s! f
else if A_tote="tote 2" then set A_induct to 2( n' ]$ n1 ?: f% c( E
else set A_induct to 3
, h4 c* _ k) k* N' V: Z set A_i to 09 k) u# X$ ^" ^9 x& O( Q3 b* e! _
clone 1 load to P_induction
: ~ e* ~/ U+ A* Y2 H/ [ wait for A_time sec
1 n9 q8 t6 _1 K; ~" @7 w8 L% Z end
: G; ~ |6 [- G4 ?end
( ?* O. X m: X- Q, _' n- ~& q1 ?) ^. O6 r
begin P_induction arriving A8 n1 h. O# q7 D% M" K
if A_induct=1 then clone 1 load to P_pick1 g) a: d8 u( {3 J, v% H$ a
else if A_induct=2 then clone 1 load to P_pick2 ~9 s$ z, q1 x1 |1 o7 ^- Z8 d- b
else clone 1 load to P_pick3
/ L& `' O) M! M+ H Q3 c) u3 k. \end
$ d6 g7 @9 Y. D/ V ^$ I0 T, [" K A& q6 `$ i
begin P_pick1 arriving9 i2 S4 e9 G) \3 @ E1 N
set A_i to 1
& @5 o5 x9 D9 V9 h move into Q_induct1
/ {! @( C5 l; n1 S1 p e6 m: m) w$ k move into pickaisle.induct10 [; {+ N% k4 y5 j, q8 u
while A_i<=30 do begin
) h( I$ ^/ \6 a, _6 A* f* G) u travel to pickaisle.con(A_i)6 S6 S3 k5 `& Y% c7 {0 Z- Q( h1 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ d3 c8 {2 D- H, H
else wait for 10 sec6 n; W/ \* J5 q, E6 x3 K1 Y
if A_i=A_leave then send to die% ~3 }6 m8 }+ B5 k* H/ m0 g0 Z
else inc A_i by 1
' f( p8 V( M0 M5 \) c$ P9 u end
, ^" N) D5 J% Pend: ?) i* k, ]2 E' o- F
4 v: V3 `/ X4 `$ ~$ i$ @begin P_pick2 arriving) `* x9 D3 s6 ~$ u, [
set A_i to 111 @8 ?7 v! S- y& F0 p; I/ w+ N$ e
move into Q_induct2$ |* u- h" `* g
move into pickaisle.induct2$ J, q4 d) Q, R2 P. b
while A_i<=30 do begin
. B8 T# K8 |& b$ g travel to pickaisle.con(A_i)
7 B6 C$ x% t( U6 [. a, ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' I) |$ a8 B' @0 H0 u
else wait for 10 sec0 H# j5 T5 {: C, \. R& m) M+ B
if A_i=A_leave then send to die
2 z/ [+ c `. T% R else inc A_i by 1
$ M4 J2 [, C) i& C% _ end- ~+ `: m3 |. \
end% J; |& k/ d5 C* Z
6 j1 p! W! U% j5 T9 Z
begin P_pick3 arriving* F0 i2 R7 _. |/ } J
set A_i to 212 q- o9 U, Z# o$ A4 x. q0 x
move into Q_induct38 ?! i5 g a8 i& v% k
move into pickaisle.induct3
0 E$ J( }! d( A/ m8 m/ Z+ M while A_i<=30 do begin
I0 r' n: w' n+ F0 j. R) X travel to pickaisle.con(A_i)' l& d% F. ], D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! x! g. v- P: C/ ~5 K$ F7 c0 t8 Y else wait for 10 sec
: b9 l' f$ ]7 v6 p" O3 w6 p if A_i=A_leave then send to die/ a0 c- J; F7 }# X
else inc A_i by 1
4 [% B' C% B7 {8 F) Y( O end6 e7 J4 ]( r- L% q: B3 K6 m4 B
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,其它按你的 ...
|