|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
; _2 V$ D/ e4 e+ X, V
& G1 S% Y) P4 @6 e我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 V3 v9 F* S" ?& S( H" K: t. G+ C/ y+ ]
begin P_read arriving# F# \9 i0 |; l! O# \
while 1=1 do begin" l; _% ^. q( J% g0 Z' p
read A_tote from "data.txt" with delimiter "\n"
1 D- ~ j6 e. u { read A_time from "data.txt" with delimiter "\n"8 s2 W) N I4 A
read A_leave from "data.txt" with delimiter "\n"
! s5 A2 U1 O+ F& P read A_picks from "data.txt" with delimiter "\n"- }; c. o* t8 Y' Y8 R# `4 G$ B% S
set load type to A_tote! U0 n U! |9 M+ x
if A_tote="tote 1" then set A_induct to 1
( o8 g; m2 B3 M4 F5 t; Y* y else if A_tote="tote 2" then set A_induct to 2
7 b2 R+ a8 e1 x. }2 O else set A_induct to 3 e; R: ~# Z5 U; b! `& O
set A_i to 0
5 r. C k" d3 H clone 1 load to P_induction% { @& M. h$ A) O, [, h
wait for A_time sec
( y' @: D+ W8 s( P& H end9 M: C: R9 p& O$ S$ ^4 S
end
1 x" R* d5 o6 I; e3 u* @
3 I) Y0 R1 T9 F5 }/ t0 Bbegin P_induction arriving; ], i" |; n: K8 w2 _
if A_induct=1 then clone 1 load to P_pick1
! t5 A2 q. C2 ^) b3 l6 J else if A_induct=2 then clone 1 load to P_pick2
5 E. o5 {8 u+ c) Z" \' z; x else clone 1 load to P_pick3# A' w3 F2 p; u a, ]2 ^/ o
end! B+ @7 |, d) F9 X; E) S
* o2 x! c$ Y% X1 `( v$ k
begin P_pick1 arriving( B" b; o3 j3 {; f' g$ Z% f
set A_i to 1
) W c3 G& G! G) a: C move into Q_induct1
q" m3 \( S1 n& N move into pickaisle.induct18 |: L& X/ d2 M) Z
while A_i<=30 do begin6 Z4 Y6 y& R+ y' q) ]' `" h2 Z
travel to pickaisle.con(A_i)$ W( j& c5 ]# J% d! n, A( i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* c5 G5 A* |7 |& O* t! E1 v else wait for 10 sec5 k* q& K+ ]1 k- h7 H# Q
if A_i=A_leave then send to die
) ^2 e0 j. Z s( O else inc A_i by 1! G! w7 [: l+ c1 A: f( ~
end( I- r: j- z3 @" ?
end
" W- A: ]+ ~+ x+ N; y) i
0 a# I3 G* P" c8 q, ibegin P_pick2 arriving- v7 q# c% X+ g9 _
set A_i to 11) W+ [4 Q/ y8 D3 h7 N E: b3 ~
move into Q_induct2
! H5 S) Q; J" Q3 ^5 p+ e, K* L3 \" \ move into pickaisle.induct24 [, j; Z1 s `0 @1 w' j
while A_i<=30 do begin- R+ H7 U1 k: N4 e4 C
travel to pickaisle.con(A_i)
$ H2 Z/ l7 H ~/ A0 w3 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 B; N# a7 H) H; O/ {& i) F
else wait for 10 sec1 W: B8 s. W: a5 ?
if A_i=A_leave then send to die
& p8 Q% y& ?. P# g- f3 X else inc A_i by 1
& t& X4 j- d; t/ z- S% @1 j% L end
7 [6 j, }! b& l7 {6 t$ aend
0 N6 x& e1 f* E8 D7 G
! T. t5 j' M% O/ K% F3 }begin P_pick3 arriving
* B8 u* g; C$ t( m- x4 x @ set A_i to 21
4 Q5 q; e0 ]+ }3 E- b move into Q_induct39 I0 z: Q% t* e7 }
move into pickaisle.induct3 p! o8 P* A0 L
while A_i<=30 do begin0 m% n2 j) l$ S9 p0 f5 N, C
travel to pickaisle.con(A_i) P9 T) b2 L' q" E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. `: U @- @3 X* E+ W else wait for 10 sec- u! V5 G; V4 X
if A_i=A_leave then send to die; k- X2 i2 e! D3 Q( Y# g$ {
else inc A_i by 1
0 ]# p) d6 c/ [4 I' h& G8 X8 F end
! h% Y, W% e0 n, i+ u0 u5 send |
最佳答案
查看完整内容
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,其它按你的 ...
|