|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ _% j: E6 u8 T% r7 ?6 H
5 R0 g; D! ^) b) I7 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 `/ z# u ~3 n0 V, W, ^
% R `5 u3 `5 E& X2 O% b% J
begin P_read arriving0 }9 c- N% r5 r& T! b7 X1 l
while 1=1 do begin" J- I& X6 ~: N6 _, b" L: S& b9 K
read A_tote from "data.txt" with delimiter "\n"7 D: }) e. I. U- E
read A_time from "data.txt" with delimiter "\n"
6 d+ ^6 f6 z& ?; W' ? read A_leave from "data.txt" with delimiter "\n"
+ i; G7 J8 N& s* G. u2 w- H" j read A_picks from "data.txt" with delimiter "\n", ~6 W- m% n9 j2 Y" r. y! n
set load type to A_tote
$ V( T4 W2 N' I" B |! x if A_tote="tote 1" then set A_induct to 1" q& Q0 {7 p+ m" l& \3 P. F
else if A_tote="tote 2" then set A_induct to 2# a4 W. J7 `" ?; u9 D* B
else set A_induct to 3 7 N& Y% H& ?4 \5 A+ N0 R5 N( \! @( c
set A_i to 0% h- p3 t: U9 Q5 x. p8 B
clone 1 load to P_induction
/ b0 A3 Q! }1 j" J G# o) H wait for A_time sec8 o( h* E& d" p: v+ J. j
end# g# E0 x5 _; t% j& N
end3 N+ D9 U" ^ R) S
, ~( }. k2 L8 ~0 s0 R
begin P_induction arriving
/ Q5 q. N" n: Z+ y) H0 B" Q7 _; y5 m _ if A_induct=1 then clone 1 load to P_pick17 {/ _' ]7 `- Q' h3 a; t+ G
else if A_induct=2 then clone 1 load to P_pick21 _3 ~9 U+ ^) {* H
else clone 1 load to P_pick3
6 z8 [; Z S6 Z- Z! r9 Uend$ }- c" i- L2 M: w
8 U/ _) \: u0 W. dbegin P_pick1 arriving
+ U1 h) Q& y" ?7 }! I& X* |+ h set A_i to 1. I2 r* \* b9 Q
move into Q_induct16 F: U% ]# z c, e% {
move into pickaisle.induct1' W: {! W% n, I: h% q. N- n
while A_i<=30 do begin1 `$ V- @. x1 L; C, g/ m: s! u& D
travel to pickaisle.con(A_i)
- n( z. u a) P7 D! j1 R7 L1 Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 t; \/ q z; e. K1 o# Z8 e
else wait for 10 sec
6 u% B) ] B* S w# | if A_i=A_leave then send to die
% b9 t, p: m% Q else inc A_i by 1
* G( r: r. {: L4 M/ T6 b end
+ ^9 r$ C% e e' Wend
3 S# o/ k/ n. \+ i- v
+ n, d/ o6 m. Z$ i% D' ?begin P_pick2 arriving
i2 N* `$ E3 s- | set A_i to 11. ^, w- {9 g5 @+ Q+ B
move into Q_induct2) ^: c8 W. N a- L# c1 F) P4 i/ x6 V
move into pickaisle.induct2
* f& h4 H4 M; W+ E while A_i<=30 do begin0 U- Y* ~) H/ }( ?; F- w
travel to pickaisle.con(A_i)
6 w6 K9 [ E% q! w1 g$ r1 U. M6 [, o* o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" c# |9 O: J) y$ m7 B
else wait for 10 sec
5 R: l" j# e" q+ N5 U/ h$ R if A_i=A_leave then send to die$ i8 j9 F; D: ]+ n( }6 P, P! s
else inc A_i by 1) \1 b& y% E* |! W6 f7 ~
end. D7 X# |2 h# d! Y' I
end1 q: H* u3 Z5 d" M& {2 {% H5 `
: G: t# s6 W0 M9 X' p
begin P_pick3 arriving e# K# ?1 @8 J
set A_i to 214 o8 e5 {. D7 F! A w
move into Q_induct3
7 ^/ K z5 n v! U move into pickaisle.induct3
# p. r. h$ Q5 ] while A_i<=30 do begin
8 H/ Z* m2 s" E$ f4 ^- O travel to pickaisle.con(A_i)% s1 E G+ D8 A) ?* G) p x9 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ Q4 o% W+ k) s, Y7 {4 a
else wait for 10 sec
, u5 ~% r! G7 d' [9 M if A_i=A_leave then send to die
/ G7 [) x$ i0 e$ _2 x4 X else inc A_i by 1
; m, l- |( M1 E, G) e+ J end
1 X8 l! `. o/ L4 v. [9 Q' r, Mend |
最佳答案
查看完整内容
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,其它按你的 ...
|