|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( x. Y8 X0 ?% J) ]) V4 s1 U
; y2 J% D" Q5 a7 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% z5 h; \4 f9 s2 J* o- O0 P
0 f6 D! V" [$ gbegin P_read arriving" f9 d( j9 M3 ?: r2 K% v( r/ E
while 1=1 do begin
+ A) R& o. e( s, z1 L/ } read A_tote from "data.txt" with delimiter "\n"
# u2 Y! Z9 t4 x1 s i% A' q4 C read A_time from "data.txt" with delimiter "\n"
7 r/ t" V$ o; H2 O# Y8 F+ r: D read A_leave from "data.txt" with delimiter "\n"9 P0 ^& ~& O* V! k
read A_picks from "data.txt" with delimiter "\n"6 p2 }8 ~& }# f3 u' s! c
set load type to A_tote
- _& ~0 k5 ]1 ^ if A_tote="tote 1" then set A_induct to 14 ^7 S' A0 ~; Q, f& H
else if A_tote="tote 2" then set A_induct to 2$ T9 q; H$ [3 c
else set A_induct to 3 8 u$ D2 \9 F2 Y' B
set A_i to 0
& z/ ?6 H! P7 {1 s) U" y clone 1 load to P_induction! z$ r5 w/ J/ r' `8 w2 r! V8 |
wait for A_time sec9 q: t0 L% k# N2 v q- {
end. n. v4 I- A( ?8 F! |
end) |% v5 W: p5 b3 r& Q
) I5 _# Y. ~& u c+ `5 D# \( v: \5 R
begin P_induction arriving
' o: H9 Q6 Q) f: O! i V3 T if A_induct=1 then clone 1 load to P_pick1- w7 Q' [# T0 d& q% k
else if A_induct=2 then clone 1 load to P_pick2& g+ f$ U# D& f
else clone 1 load to P_pick3; x4 [; W) [ C: o2 _
end0 }! K. N. U3 }1 e
, T- O% u4 p9 w# a8 |begin P_pick1 arriving/ K# `' F0 X# r# }; g/ P! t4 u
set A_i to 1
# Z8 y# E! R1 l1 @' C, ?# H- | move into Q_induct1) K. g% ~ V0 e+ \
move into pickaisle.induct1' K7 m+ a* r, t8 J I2 g( ]: R9 w; I0 j
while A_i<=30 do begin/ @4 Z3 y R$ o( M9 B( R5 ]
travel to pickaisle.con(A_i)9 {3 n3 A9 ?- l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- t2 s* O. b, P4 t
else wait for 10 sec0 ]7 x& U& x6 \" f" s2 U7 w X
if A_i=A_leave then send to die
9 {6 @& n" |3 t4 }/ h else inc A_i by 1
9 D% S0 S0 W# n+ b. S2 i! E end2 c% Y) e1 d$ V+ ^3 g& t r! V m
end
# t" Y b; o4 e4 p5 r' Y: T
4 J6 A! q) ?$ v9 L$ f% i# y) Tbegin P_pick2 arriving5 R0 i5 g- q9 q: i# q3 ]
set A_i to 11! O) U; h: {: W
move into Q_induct2
2 A0 _8 B" d( u5 Z, H% f5 @ move into pickaisle.induct2
3 P: v# i7 h7 K8 `/ f" [8 B$ t; o while A_i<=30 do begin3 U4 ^+ v5 n; g
travel to pickaisle.con(A_i)
0 D5 U- R3 N/ [1 C9 D3 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; z, C$ d ?' ^) M# w( z8 F9 q* f
else wait for 10 sec- F4 Q" v# g$ z# ~* V0 U
if A_i=A_leave then send to die5 {; W; h. r) B1 o! n( J
else inc A_i by 1/ t4 P3 R B; R6 q2 R
end
/ Z4 l4 f2 t! N, y3 [% [end3 Z2 O2 I! `5 k9 }/ H
2 a5 r9 h/ Y& P
begin P_pick3 arriving
6 m3 d: M! r( Z4 P set A_i to 21
: m% w2 O, d+ B! f) R5 P2 N move into Q_induct33 J" M' b9 L; l/ K1 |# {: l. l
move into pickaisle.induct3
7 D2 p/ l x y! P3 {3 }* _ while A_i<=30 do begin$ F; v1 r, I7 D
travel to pickaisle.con(A_i)
9 c6 w% ]& y e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# f3 w; g/ l2 t, a
else wait for 10 sec7 d7 D( N- x5 {2 d# J, F
if A_i=A_leave then send to die
! [4 }- A5 N1 ?0 C' v else inc A_i by 1( w$ B+ n( |- i4 Q' P8 q1 n
end9 W8 B W1 v& N( |/ x N! Y d
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,其它按你的 ...
|