|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 c- e8 L& R, |% x& ?
9 y3 s: t- X6 D! y' K M我的问题是,在每个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中的数值,不知道会不会有什么不妥。% Z+ Y7 n0 J0 k* Z% D
/ s1 b/ o& R/ S' rbegin P_read arriving: @) T: T& e% _+ R" l- O+ f
while 1=1 do begin+ [1 }# p: Y( w
read A_tote from "data.txt" with delimiter "\n"
+ r0 D3 O1 |' j( \' G% F read A_time from "data.txt" with delimiter "\n"
9 Y; |# a6 f9 g read A_leave from "data.txt" with delimiter "\n"5 V" D b% f" s& n2 @& a3 C: v
read A_picks from "data.txt" with delimiter "\n"
: V' [ P, f- p# Q) |* { set load type to A_tote
% X1 `3 @! [) G2 n if A_tote="tote 1" then set A_induct to 10 j2 Q* B$ X9 L! k g
else if A_tote="tote 2" then set A_induct to 2' s' q# U3 b+ q3 [2 L. }& {
else set A_induct to 3 & I( R# V, k0 L# B! l n
set A_i to 0
: c$ ]0 q6 u' ?$ }: E1 J% I clone 1 load to P_induction
b' z, l# X' _$ M9 e3 E8 H wait for A_time sec
& e X0 M \8 d) p* [( N end
; E& g8 p. D) C: K& z3 b' bend
: P7 [% Y" W$ k! {4 ?: |% Y+ r6 F# k+ Y" M9 M4 m7 J7 t+ ]5 y" C" V
begin P_induction arriving
& [# u: r4 |) G3 V if A_induct=1 then clone 1 load to P_pick15 w( ~! i! m4 ~& ~( V5 i/ ^
else if A_induct=2 then clone 1 load to P_pick2
2 w; f- O4 b e7 ?3 C) M else clone 1 load to P_pick3
. ^8 M& O b6 \: ]9 B$ uend( |- ^. K+ i: {
+ ?4 H# ` b9 l4 ]( ]+ Pbegin P_pick1 arriving
7 ?& t2 n5 T6 ?9 G) { set A_i to 1
, f) Y( Y/ h7 c( K. g/ S+ \6 P move into Q_induct1# H7 Y1 J5 H9 L1 n! \/ q
move into pickaisle.induct1
4 s' \. q8 U _/ r% W7 v3 u4 k while A_i<=30 do begin+ D- d7 G7 A9 ?* |) c9 l
travel to pickaisle.con(A_i)
+ n7 r+ W5 w- t' d, o" y+ P8 o. X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 m' W2 p* W9 H2 w else wait for 10 sec
& F7 s8 X8 m4 @1 B& B6 q if A_i=A_leave then send to die0 e4 }, B% B, k0 A
else inc A_i by 1 y; E( w7 V& G/ T5 |; Z: G
end
4 K% Q0 b% A8 f* L9 J; [end
r5 W+ p% Y. w, c1 T: z- U1 P. ]" H2 x+ F& a
begin P_pick2 arriving
1 N- c$ S( }& B" o8 p& A set A_i to 116 {5 U7 Q* `9 v% |1 A' Q
move into Q_induct2- Z' S- w. R* o, i
move into pickaisle.induct2
$ e* K% A; p/ Q, T- \! w while A_i<=30 do begin Q3 X) h$ t) T* D
travel to pickaisle.con(A_i)
2 ^; v. A4 `5 ?: w4 H/ l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# M0 p. p0 e. J6 }$ u else wait for 10 sec! B' d E! ~5 u$ F$ T0 ~
if A_i=A_leave then send to die
9 c3 n+ E' A" @5 D( H9 _ else inc A_i by 1
- u+ s( p$ d. t# k2 [0 h: U4 H& ` end! k! `! L' W, h' W
end+ Y$ d( ^: J6 m( F2 U
. r6 _2 }# \; [6 A& l" [, N9 L
begin P_pick3 arriving
3 k+ ?5 \& x' @6 R3 Y) A0 n, e. [" i set A_i to 214 Y( \+ c5 X6 R
move into Q_induct3
m% a6 ?: D0 J2 S move into pickaisle.induct34 O/ D: k; ~+ }2 j" h$ x3 E
while A_i<=30 do begin7 R1 d) N4 `- n7 [
travel to pickaisle.con(A_i)7 Z& W8 c3 l% T" Z4 A8 E7 t4 g% v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
Z2 n1 X! p2 A& I else wait for 10 sec( J, I/ r0 b' l! ]
if A_i=A_leave then send to die, X7 y% y8 I- h& f5 i, o0 F
else inc A_i by 1
) Y6 X. ^9 q2 i r) p. i end# m/ R5 b* ?3 }& F/ i
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,其它按你的 ...
|