|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. W. N- Y# J7 J0 V. E
; ~9 t! ^- o0 N3 ?( w6 l( 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 K' S0 O7 A# c* a J9 v
7 H6 H, g7 c/ ~- h0 ~begin P_read arriving6 p4 Z1 c, I6 J% e
while 1=1 do begin
" J+ r0 i3 l- h! s& T* \; f read A_tote from "data.txt" with delimiter "\n"
a, x. o; x( m" ] read A_time from "data.txt" with delimiter "\n") Q2 ?: E6 A/ q7 X8 v4 h+ [# Y% ]
read A_leave from "data.txt" with delimiter "\n"' f/ E. i! ?+ e5 \ p1 u
read A_picks from "data.txt" with delimiter "\n"+ R/ Q# J# k5 E4 j* S" R5 `, k' X
set load type to A_tote
( L1 g# ?2 B& G* F if A_tote="tote 1" then set A_induct to 1
' Y8 r% G7 z0 U5 G8 u. y else if A_tote="tote 2" then set A_induct to 2
, t1 o; Y$ z5 i$ R' O' @1 N else set A_induct to 3
_$ X# H9 Z. v5 g set A_i to 0# B' O6 E% ?- K- q, ~7 p3 C
clone 1 load to P_induction& ]+ H. ~ L5 d0 L* j8 m
wait for A_time sec+ x. [8 \% x; m [
end4 l6 f; E# o+ U* @' }- a7 r
end
, ]3 | y' V* q& u! w7 G6 i: o; _' t5 R j( I! n9 T
begin P_induction arriving- x. }: A5 {. U; S
if A_induct=1 then clone 1 load to P_pick14 o1 l& `6 k+ i
else if A_induct=2 then clone 1 load to P_pick2
4 r, r! Q- R0 {; L2 t else clone 1 load to P_pick3
; N8 E5 l- w- i0 ]3 n, }8 ^$ ?end6 O( _2 ]+ }0 U
, a1 F6 j! B9 k1 l6 w, |begin P_pick1 arriving% {: o: b- [8 Q$ Z7 C% ]# J7 O- U
set A_i to 1
* k/ W1 G2 m( n7 `6 u- u3 @$ u4 F move into Q_induct1
+ { ]3 w( e. y2 l3 g: p7 U% r move into pickaisle.induct1
7 T3 u) R& ]9 z6 F$ V( u while A_i<=30 do begin
+ C3 G3 [" W/ l7 z" X6 } travel to pickaisle.con(A_i)5 v, c' M; U; y& s. a1 T9 U! s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. _6 `! }1 x, U a# o! F2 }5 n" S
else wait for 10 sec
; h/ L4 \* G u6 | if A_i=A_leave then send to die
6 R/ @4 r; Y$ Q0 q# g k else inc A_i by 1: U% h o, Q# J7 I5 {- c4 @" L5 B
end, Z& v& @7 l* Q- R+ U6 k' ^& f
end. B7 @9 O) u. v2 Q& J" q7 q
0 I) B, V: H% {begin P_pick2 arriving
1 S; n" ~. W, C t: ~9 M! M6 q set A_i to 111 ?/ c7 ]( |& b9 Z- M( h; r
move into Q_induct26 z; a+ t; Y4 @6 P2 Q
move into pickaisle.induct2
# O* {9 R" B6 R% b6 r6 r while A_i<=30 do begin! @9 w! s# l5 \' u- T% N6 R) I
travel to pickaisle.con(A_i)
0 l/ @' ~ [- ~8 C/ \& W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec b5 R5 I1 e$ s, K. ?: o
else wait for 10 sec
# K1 b+ O* @$ A if A_i=A_leave then send to die
" ^- c8 a# V X- ~" e- v& a else inc A_i by 1: H- l! E& _' X! \
end
6 v+ N$ n1 h0 {3 Z) ?9 ?3 gend! I, P. u* V# E c
* J& F/ }) x" Sbegin P_pick3 arriving$ P$ ?- F ?1 N$ r* ~5 y: Y: w6 c8 f
set A_i to 21
0 ^ V; @2 X% C( { move into Q_induct3
9 P/ }1 z& j( h$ F8 q* J move into pickaisle.induct32 @5 J) u0 b1 y- W8 G
while A_i<=30 do begin6 f3 }8 i, W, K3 f7 q$ v) Z! _. Y
travel to pickaisle.con(A_i)4 w1 d/ X; b$ x* v {2 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ?# l+ l0 @2 W7 s( l; m. l
else wait for 10 sec
6 R& ~' m1 G+ I6 @ if A_i=A_leave then send to die
. A: `( L3 C. f" T- ~ else inc A_i by 1* I# ^2 r5 o3 ^8 y1 i1 A
end
: E ]' q: W) Q- ^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,其它按你的 ...
|