|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 h5 t) O2 b5 e7 p$ d0 R4 D. d+ p T. 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中的数值,不知道会不会有什么不妥。1 G9 ~8 c0 v2 t2 w5 |* S0 E$ E
. D b1 w5 q: g0 S4 |$ rbegin P_read arriving2 \; W/ g; R9 K; D N' J
while 1=1 do begin& o! i& F8 @7 u0 \' J% i
read A_tote from "data.txt" with delimiter "\n"
3 C7 Y9 |6 h6 l3 Y read A_time from "data.txt" with delimiter "\n"& q, {$ g; P3 \' d- g% o
read A_leave from "data.txt" with delimiter "\n"6 T# n. T3 l4 |3 d6 ]6 j
read A_picks from "data.txt" with delimiter "\n"! b% d5 M0 u3 D* K+ {) s( j: J
set load type to A_tote! W5 s) D2 @7 |( q# C5 |' H0 _
if A_tote="tote 1" then set A_induct to 1
0 w h! x# r8 X# v% H( ^ else if A_tote="tote 2" then set A_induct to 2' A9 K- X" F/ k0 L- D/ ~* |
else set A_induct to 3
) e' t0 W9 _9 J( S& S% P set A_i to 09 m+ O- _, y O
clone 1 load to P_induction
1 b3 C* l4 a, {8 J f) H5 Q$ N* x wait for A_time sec9 P$ S5 l; a( Z8 @+ Q1 ^
end
% r/ j# w) o. C3 _# yend1 I2 l/ p0 Y! }4 K. T
! a8 J. q: J# o; y
begin P_induction arriving: V- |4 L8 R: G2 s1 I
if A_induct=1 then clone 1 load to P_pick13 `$ S* H* A- i, P" y# N
else if A_induct=2 then clone 1 load to P_pick2
/ Q8 P1 X0 }; O5 ^' H else clone 1 load to P_pick38 b% I5 \- q7 X: r5 j& j
end7 f8 G2 K$ \. s! n0 v
' G; l) z3 O) jbegin P_pick1 arriving
# F) g7 `; G: M: n& Y6 L" ~! ` set A_i to 1
" r: K* t9 o0 j7 Q/ ^5 F move into Q_induct1" F# {& o; ~9 A$ L+ G7 V Y
move into pickaisle.induct1$ t) t$ X; S3 e6 g+ J: j8 l3 Z
while A_i<=30 do begin
1 F* J& j- x5 p* V travel to pickaisle.con(A_i)
$ |0 G! Y" {, d7 V" Q( O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! k; n/ e. B- x6 F! [6 d0 [7 D
else wait for 10 sec
& ]9 E6 R% @8 r* A. K if A_i=A_leave then send to die: A$ g6 y w/ a5 Z
else inc A_i by 1
2 p0 l& i7 E0 l& \" | end
- V4 h, |# l* e0 S) y# e+ f# P3 }end3 c4 ~5 ?9 O* `/ r5 z( l( Q
3 a! V- B) _4 x ?
begin P_pick2 arriving2 O1 E# m: q7 W+ u# i
set A_i to 11
; ]3 r0 a! a) b5 g7 s move into Q_induct2
: T$ ~2 J! P, L move into pickaisle.induct2. e5 j! y, m2 d5 z
while A_i<=30 do begin
& F3 N8 Y! q6 A travel to pickaisle.con(A_i)
: Y/ t3 p. I0 \/ S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 J+ {- @7 K' Q# |" W8 O0 g else wait for 10 sec+ {. u! ^, t0 k% v
if A_i=A_leave then send to die" Z; V4 ~ k& ^
else inc A_i by 1; Z1 u# i; m0 H, a! M. \
end1 H7 Q. X- U+ @& V- ?; ~/ n
end
/ H- V# ]2 E3 W# j
5 a u1 y0 Q3 { {# ?5 z6 Rbegin P_pick3 arriving1 [+ z# o: M6 u* ]. T' z) B5 z
set A_i to 21
# t$ B. H! z" Q9 _ move into Q_induct3
6 I$ N, d0 {! t. ] move into pickaisle.induct3
1 M4 X' C' K1 C9 [4 I while A_i<=30 do begin$ m. W+ `. T5 S) l1 v4 V8 u
travel to pickaisle.con(A_i)( o( R2 Y0 J' `$ H0 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: D* A: y. B- m9 E. }( p else wait for 10 sec
2 i; c- G3 A. E5 N if A_i=A_leave then send to die
0 A9 ^. {" l% k8 A) T& q1 |. T else inc A_i by 1' V' ?( P1 u9 o
end
% C, N) M8 ~8 {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,其它按你的 ...
|