|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ s" k8 F% d' \6 a2 d3 M% I- r6 F$ v7 t4 t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& Y) r! D, [* N$ ^ h. E
, N- s8 Z! x3 T1 g" }begin P_read arriving5 m; C' l) m( e7 |( c
while 1=1 do begin
, E! Y% _6 \& n! q9 n) U9 J read A_tote from "data.txt" with delimiter "\n"
" Y0 h- M. J1 W7 T% z m+ s+ \ read A_time from "data.txt" with delimiter "\n"8 \9 j) \ I% k: \- V
read A_leave from "data.txt" with delimiter "\n"
* P4 d0 @4 ?, c0 G2 I) b& ] read A_picks from "data.txt" with delimiter "\n"
. F" q+ j( k, b9 s- v' ~ set load type to A_tote- F Q2 |1 j) v0 [# W% F
if A_tote="tote 1" then set A_induct to 11 e% ^4 F* s i4 |2 g/ c& R' b
else if A_tote="tote 2" then set A_induct to 2- z9 n/ D3 C) s# K0 D% }; `
else set A_induct to 3
9 t8 l @+ ?, M" p9 \ z; ?) h+ x& w/ n set A_i to 09 k" g0 A+ W: l: z# t
clone 1 load to P_induction
+ p& M! M1 w$ l: S wait for A_time sec- K, J: z* y3 T/ b' O3 N
end4 v( ?5 k8 ?) }5 n: j9 q
end B$ c4 P. Q$ A5 v% y
7 N& F( V& R/ F A( @2 X
begin P_induction arriving& p* U) ?; ^1 m( C1 m" u; o
if A_induct=1 then clone 1 load to P_pick1, e; Q. K3 g* J* j. {
else if A_induct=2 then clone 1 load to P_pick2
; M8 U3 h% G6 G1 `. o else clone 1 load to P_pick3
; l- i+ X0 @2 e! H$ f7 N/ ^end
) M8 S9 I, U( I6 L
5 b5 b9 f+ o. p) `6 R7 C. ^begin P_pick1 arriving+ k4 C5 i) C j# O4 C$ o: b" ]
set A_i to 1
7 {! t. z) P3 h/ Q1 K- ~ move into Q_induct1
' R! B' w' e4 {- A5 ~; P, l0 E8 [ move into pickaisle.induct1
( h5 t. r+ m) n+ }% F while A_i<=30 do begin- g) w% u2 c& y) Y2 Q
travel to pickaisle.con(A_i)
' _' \5 |, Q r/ c$ W4 k/ z- R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 c5 h* w; f9 D H2 c$ {
else wait for 10 sec
& Y& y* J* w3 F, L if A_i=A_leave then send to die
) p4 C: c' p0 z$ W: w0 h, u- { else inc A_i by 1
( W8 v% [9 R* u/ C7 D6 Y4 @0 k end
* p9 o: b$ A c) k Gend
# C6 O' u5 s Q) R, E$ |2 Y. N- F, D7 P' k
begin P_pick2 arriving8 W1 d( B& u1 \9 O' m; V$ x
set A_i to 117 n% P5 N! L. m$ R5 a' O
move into Q_induct2
0 M7 s/ {& u' N move into pickaisle.induct2
! W4 y% k6 v- V( r while A_i<=30 do begin
1 O. y, k |( v% `; w+ l travel to pickaisle.con(A_i). g1 g) B6 e. e+ M1 L% C( y' Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z" f( k( l5 a- @$ _5 t- H/ N
else wait for 10 sec; n" [& U. K; ^6 N8 p6 K+ t
if A_i=A_leave then send to die
* ^2 r1 W" Y$ O T3 D4 Z/ K7 m0 l else inc A_i by 1( A8 R% L; ~4 C2 N
end& y' Z6 Y7 K: Z' `
end
8 k2 C3 X( k$ u0 f
* \9 Z. c" Q7 H1 Y! L! h6 vbegin P_pick3 arriving. ~9 t" g" F7 U3 h
set A_i to 218 O' {) K; c1 m: Z b7 x
move into Q_induct3
2 Q5 T: I$ B( C4 t( H# }! i% Q move into pickaisle.induct3
) t& P; t& j0 d ?! D1 } while A_i<=30 do begin' g) e3 \/ r0 X3 |: |# g
travel to pickaisle.con(A_i)! F, ]; [0 ]( w. F, ?5 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; C/ Z* I, `2 }" O4 `! P else wait for 10 sec
% a: J$ g* L8 s" T2 | if A_i=A_leave then send to die
7 ^" w% \" `% |9 c1 C/ y7 w else inc A_i by 1
; s: K- `% ? D" a end
g- _, f0 |1 ~+ T0 mend |
最佳答案
查看完整内容
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,其它按你的 ...
|