|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 z, q9 L" W- b3 x' [2 \7 m
4 Z8 Z- k, T% K, }' C7 j9 ~, 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中的数值,不知道会不会有什么不妥。
! c' @0 _) P3 Q* d5 \, h5 t5 w/ h( q! |. n( V. C+ b* w5 N% b
begin P_read arriving. b: O& S. j: {* E
while 1=1 do begin" M5 s1 H/ I4 E
read A_tote from "data.txt" with delimiter "\n"
% \4 _0 B- I) h) k5 d/ a' g read A_time from "data.txt" with delimiter "\n" f8 e: ` d6 v
read A_leave from "data.txt" with delimiter "\n"
( E9 E' b* W/ v2 ~4 H read A_picks from "data.txt" with delimiter "\n"( R* I% s' m/ [- r
set load type to A_tote, K: W9 t1 f3 J2 {
if A_tote="tote 1" then set A_induct to 1
% }7 `) P5 r; S1 ^$ v' K: |' ^ else if A_tote="tote 2" then set A_induct to 2( Q7 R. k" `! }0 x* ]
else set A_induct to 3
6 |( c- p# ^5 ^/ x1 B set A_i to 0
; D! x# @4 O5 N( F0 b clone 1 load to P_induction
. ^; E4 S& h* ]+ \1 z7 b3 n; F wait for A_time sec7 L; \1 n" S" o6 @
end( i7 U! {! K4 t/ H$ W
end$ j! H+ y5 U- H% a% m
' d# l7 N) Y: q- a$ L8 |5 \. g2 ^
begin P_induction arriving5 X0 s' R3 ?5 i/ c6 S, q. l
if A_induct=1 then clone 1 load to P_pick1
7 s* v1 S7 c5 [6 }) ]% j else if A_induct=2 then clone 1 load to P_pick2% Q; l9 J( S. ~1 K
else clone 1 load to P_pick3' p0 g* n9 `3 I# J/ X, @
end
3 ^. b" `& I9 F* R b0 a% [/ d: G; r
begin P_pick1 arriving5 X3 K* ^: W# c
set A_i to 1$ i$ O% F! [. x
move into Q_induct12 @; _3 m( N6 J+ ]! s1 u
move into pickaisle.induct1; I& u! L, F: |+ u4 S# J9 O" A2 A* U
while A_i<=30 do begin0 W$ j7 g' ~, |- G
travel to pickaisle.con(A_i); y: P5 C; F1 F/ Z1 G: D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 \& g2 C& E& \7 ?$ M$ [
else wait for 10 sec$ ]' K1 g2 t6 Y s
if A_i=A_leave then send to die- M" u5 G9 X' |: g, z
else inc A_i by 10 D( L. d3 `/ {( z: ]# [3 E
end
9 E: D9 m- M$ c2 H0 S' J0 U/ ?& oend/ _1 P9 N* C+ w c+ {" L
" g) ]& ^- p; Z" E; u, b+ Nbegin P_pick2 arriving( Q, N7 ?$ k; c1 ~5 q
set A_i to 11
$ \% \1 o! A" | move into Q_induct2( @. N3 h, _0 a& q
move into pickaisle.induct28 @8 n( u# ~" |5 ?6 p
while A_i<=30 do begin1 O6 G" ?7 l0 T
travel to pickaisle.con(A_i)
$ m1 T& v8 e3 I$ c, C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O0 R/ n3 r- H" h5 q
else wait for 10 sec
, g( [, R& c6 J: ]7 R if A_i=A_leave then send to die
' H$ v4 U: O [' p6 { else inc A_i by 1, T3 U4 ~" k% D. o- m
end
1 Q: Q) C( I0 |end
" u; P" @- D9 v0 Q6 ?# c! ^& j+ Q0 P' i) ?
begin P_pick3 arriving; d2 w0 s* Y4 {3 ]1 ^" z% D
set A_i to 219 [/ \' { ~( h8 s
move into Q_induct3
! J& K( P+ G2 M6 k3 y move into pickaisle.induct3" `' m2 A2 f6 B8 k' J+ Q1 Z
while A_i<=30 do begin
0 N: _) l! n" f+ \ travel to pickaisle.con(A_i)" v# }3 L& d7 N8 X9 q$ d: ?- X6 V' |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" H9 U: d7 v& E$ o, G0 q0 R3 H% T
else wait for 10 sec
' ` y) b8 y w4 k Y+ j if A_i=A_leave then send to die
3 o7 h" @ |1 R, @. z, ~ else inc A_i by 1
# ]/ `. F6 L, G( `! l( Z end
6 a# \3 c# T. q& ?, Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|