|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 z% u, s9 ?8 ^$ U8 }
& T u& r1 F9 V# U0 F c我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 v- y, r- O8 e: ?
+ F2 p8 C- O9 U$ n6 U8 T
begin P_read arriving
- M. G2 {2 r0 {8 ]' ~ while 1=1 do begin& }8 W! a J7 W# W4 ^
read A_tote from "data.txt" with delimiter "\n"
9 m' W) @" c/ U9 T' I% s& B4 F read A_time from "data.txt" with delimiter "\n"
8 u1 M/ S: H `0 K read A_leave from "data.txt" with delimiter "\n"' Q0 g& D. [. B" g% ^# f* N
read A_picks from "data.txt" with delimiter "\n"
* `. N8 h& ?4 z0 X2 ` K set load type to A_tote$ f& Q) B) Q- h7 X
if A_tote="tote 1" then set A_induct to 1
- R% |: Z* ]+ U+ M' D: T else if A_tote="tote 2" then set A_induct to 22 d. D' l: G- b7 F, }9 m+ R# c
else set A_induct to 3 % d/ W6 i7 e& U8 z/ G% c$ }. z/ E3 t
set A_i to 0' p. b+ o4 G/ `8 I+ j: t
clone 1 load to P_induction
5 K! U/ g; P& b6 E wait for A_time sec
6 p3 j5 k$ P: | end
: n( d6 F, y/ b4 w) v& Aend) h2 J; X7 g. E2 G" w) k" m' p, D3 [
/ c7 R" |6 y8 }# H" {7 Y9 n
begin P_induction arriving
' u- W$ Z- e; X9 z& k' [/ i6 E, g if A_induct=1 then clone 1 load to P_pick1
' x/ g* h* X& C2 {7 W else if A_induct=2 then clone 1 load to P_pick2$ {% }4 z( } p% D( m. ~
else clone 1 load to P_pick3
9 H) D$ C- L! a+ K J, J) ^end. e' R- B* t/ q: l
* v* b: }- k9 A4 w" dbegin P_pick1 arriving
, u* S4 Z1 I& \ set A_i to 1% ~0 t; @3 ~: R7 Q& N
move into Q_induct1
: E" F1 N4 @ s move into pickaisle.induct1
: E& ^8 U% {. | while A_i<=30 do begin2 O! G, G! d/ f+ Q' s# h% S n
travel to pickaisle.con(A_i)/ L8 f( f3 |( U/ w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec N# y! ?* `; J5 L' T g: }9 ]& O+ Y
else wait for 10 sec
& m; R2 s+ `/ z, K7 b if A_i=A_leave then send to die
0 s" j) U0 L3 T6 R; G- i else inc A_i by 1; z1 K2 O. ]4 _2 d/ X
end
: C& D M! G0 c6 ~9 j& G1 gend5 @1 U7 T7 S+ o9 \% N2 f
! A3 \8 N4 W6 q6 P7 o; j/ }
begin P_pick2 arriving2 @. A# c* B& \) O" I" d
set A_i to 11
1 ?* j( J- c; M, t& Z' X! ^7 Q move into Q_induct2
0 j! @0 A! U5 t( ^1 V e: H5 } move into pickaisle.induct2/ _# ~$ d4 H# r/ [% E" X) y! u9 `- q
while A_i<=30 do begin
; G+ `& M, c, i* R travel to pickaisle.con(A_i)& Y( |+ E/ U( x8 A( y; V/ F1 T+ E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. S8 u! i9 \6 \$ p. L
else wait for 10 sec' d5 S1 N+ \( I$ o& x% a
if A_i=A_leave then send to die
, z6 C7 Z& U7 f* U else inc A_i by 1
6 } Y3 \% U+ X: a7 ^ end
3 w3 j; _- e/ F* A+ L$ ]end. q) u# l, y: W6 w4 ]
5 n P( x+ R5 p* d$ p+ l5 z( C
begin P_pick3 arriving
1 [. X. R) [+ }3 i set A_i to 21
& K! P- \2 i& T! l3 | move into Q_induct3
* A* s) z( k4 l* a move into pickaisle.induct3, Y5 R( C6 P9 d1 H. l8 O
while A_i<=30 do begin7 l& U5 j k4 X$ F
travel to pickaisle.con(A_i)
; B9 V; r9 W* q6 P6 N" ~) G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]! Y; I' |7 G else wait for 10 sec; B/ B: h' _% U
if A_i=A_leave then send to die
" I( M3 z% G1 ~ else inc A_i by 1
. w; a7 t* Z3 j) p; W& K end
; v! U# P6 O3 `$ Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|