|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( L) l( L6 M; T+ q
5 v$ ^6 O/ ^9 N) D% W我的问题是,在每个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 r9 x. b& K3 K$ D
$ H: ?4 \2 f% }5 U1 }$ b2 _begin P_read arriving
% F( G9 F8 X2 e8 C C, t while 1=1 do begin0 h; [ j* Y: U ] m5 h' i# B* _
read A_tote from "data.txt" with delimiter "\n"' }8 r- K! W, [! u4 S6 h
read A_time from "data.txt" with delimiter "\n"
# d: }* ]7 F' v6 }$ K read A_leave from "data.txt" with delimiter "\n") a6 e3 V. X* o r- l
read A_picks from "data.txt" with delimiter "\n"6 u: l; W4 X% x
set load type to A_tote
0 F/ H2 Y& X: ?- |* R$ O) ~ if A_tote="tote 1" then set A_induct to 1# Q/ L& L5 ]) _" n. |
else if A_tote="tote 2" then set A_induct to 2. P" V& j+ Q# E* [7 Y
else set A_induct to 3
4 D, s, Y* W4 y1 g6 X+ W set A_i to 0* m* ^% n- d! {9 U9 G1 H
clone 1 load to P_induction
0 ? g" M% u- ?4 _; [2 e+ L wait for A_time sec
5 e2 ?- E7 ]% M, Z" i! @ end$ p/ ], H: ?% f7 q
end3 P. f* u2 E* ~4 W
! g/ f3 P; ~+ G! C/ Fbegin P_induction arriving
3 k6 R. v3 z7 }1 I! w$ c. q: i( H5 K if A_induct=1 then clone 1 load to P_pick1+ @4 d" E" s, V5 L& \% I, j8 A j
else if A_induct=2 then clone 1 load to P_pick25 M3 h( @8 N1 m; S1 g3 r
else clone 1 load to P_pick3
" f* z2 e0 i2 Dend2 F7 `4 H' e0 k4 Y- A7 R) U
( @6 _5 k" q6 s
begin P_pick1 arriving
. [' q* L, f( n5 e9 o) v. `) U/ D set A_i to 1
. V# v3 x( B) _9 i move into Q_induct16 W0 r: k! J" `
move into pickaisle.induct18 k. [$ G2 q# @3 ]
while A_i<=30 do begin
1 u" k; t! V& y) n/ J. Q$ ~ travel to pickaisle.con(A_i) p. L4 Z7 o0 g& K3 |/ J) {. U+ W5 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* y8 D1 f% w6 L7 D0 n& W
else wait for 10 sec5 B* \, c# k, S( b+ P
if A_i=A_leave then send to die
$ Y }7 b1 U9 U4 _ else inc A_i by 1
4 \& A' a, a' N8 U5 `/ Q5 `- q end2 J5 u: {& P. [) d/ f/ V, M- l
end
! x2 G( s+ E {3 h7 `
* J" }& _+ |# F5 d! _4 L3 B1 kbegin P_pick2 arriving
" c8 o: A/ {3 }% @7 u) ^, A( L. S set A_i to 115 f( ?0 w4 T, a& X1 E
move into Q_induct2
& J' o1 E. ?: i! {0 J7 t" Y. [$ u move into pickaisle.induct2
6 ~% d/ d; g, l# B3 b0 m while A_i<=30 do begin
' G# z# ]! I, d2 J' n travel to pickaisle.con(A_i)7 k+ t3 J: S' D% W) c9 B( [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ c) \5 G2 L5 C$ x _* ` else wait for 10 sec7 C- F9 _& {& u5 z8 K
if A_i=A_leave then send to die
+ R; Y$ H) |/ p else inc A_i by 12 a9 k5 F& K. E) ]- v# L/ J' E, o& v* J
end
, o2 c* E0 \4 E. \; M, C7 Fend7 h! R( ?8 Y4 w0 M4 E' q* r
& |& ]2 _' ^4 p+ C" q8 L
begin P_pick3 arriving* V; Z, k! K& V o/ x# _% l9 }
set A_i to 21
: q7 N7 E# F! l; x. T# t move into Q_induct3! X& d8 m. l2 G
move into pickaisle.induct3
) ]1 g) E8 K% y5 E0 C4 q# M2 y0 E while A_i<=30 do begin
4 L5 d' F. U" g. R+ @8 f travel to pickaisle.con(A_i)4 r1 \: c J m: |# \* w4 H! b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 y. Y8 r J$ o$ k7 H else wait for 10 sec
/ c, ?+ f% G9 b5 R& A if A_i=A_leave then send to die, N6 L/ S# Q3 ?- \5 _3 ^
else inc A_i by 11 v: M4 Q% m' o& H8 o
end0 `! { t8 F; |0 t
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,其它按你的 ...
|