|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) K& d& c, g8 Z9 u4 }1 c) F7 u. x+ A3 W& v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ e, X. L2 R7 [" K/ C# ^
( {9 o! Y* m+ K/ i5 |begin P_read arriving3 C+ ]) q9 ~: I
while 1=1 do begin: G I# T6 w* q; J" [/ U
read A_tote from "data.txt" with delimiter "\n"3 T( E. l; {3 s) Y5 i1 K) G3 I: Y
read A_time from "data.txt" with delimiter "\n"
J4 f8 c& |$ m. ] v+ j7 Q read A_leave from "data.txt" with delimiter "\n"
7 ~! x% M9 p2 f7 e1 ` read A_picks from "data.txt" with delimiter "\n"
. Y6 {3 O9 b2 z+ o; R2 U2 i# s set load type to A_tote! Y s7 W( @- b& m- ~6 E L
if A_tote="tote 1" then set A_induct to 1
% U2 m5 M1 ^8 l! O else if A_tote="tote 2" then set A_induct to 2
, p: C; B, P# G& p0 p! z, s) \- U2 P else set A_induct to 3
; a) m) }6 V& G I set A_i to 0# y ~+ |0 [2 R+ a
clone 1 load to P_induction
% D- ?# Y! C) M0 z6 l; \ wait for A_time sec
/ b- \# ^+ o! E/ |. L6 c end
. V! S' e3 x! W$ R( ^end
% S9 Y2 O, F( [7 X6 c8 R% Z1 R) `/ ?! a9 j: m
begin P_induction arriving0 K% k. _# o7 ~6 u" Z
if A_induct=1 then clone 1 load to P_pick16 Q2 J. A. T; M5 H8 o2 M
else if A_induct=2 then clone 1 load to P_pick2
+ B. i* x* p& v/ X" T- Y else clone 1 load to P_pick36 I; R* q& `1 n8 {
end
4 b0 C) ^2 M/ r: |1 N: t
/ a2 z- D0 o' U" b" ~3 Ubegin P_pick1 arriving1 d: _& ]2 U4 L7 e( P. t- y9 u' f
set A_i to 1& E7 K# D z( i
move into Q_induct16 M* S. h& B, Q6 J, q9 F
move into pickaisle.induct13 D: t6 h. W- ` x" i: n
while A_i<=30 do begin
. K- h% g8 F! @, ]. ~* ?* x" K/ }: n travel to pickaisle.con(A_i); j. F* i5 h7 _/ u8 ?% X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 m( n; W& `" O- s: U$ H$ y _
else wait for 10 sec
9 E, x) P/ W) w" t if A_i=A_leave then send to die
; w* a6 X8 g F' P7 l4 } else inc A_i by 1% g) r0 D% Y% i/ }% y# X
end) y9 v1 e% w) F# l$ ?; K
end
" p8 ]. f# N4 J- o* W
A& M1 P) ^5 J- A. _# ]begin P_pick2 arriving
0 X2 Q/ d% Z1 b1 v' {4 ^ set A_i to 118 F; j" Y6 j' j5 O9 T: ~
move into Q_induct2! r% V; M& V7 P: c/ R
move into pickaisle.induct2
' _6 K# a, ~/ w, `: ` while A_i<=30 do begin
8 h2 t9 T( I5 R7 q% L6 l travel to pickaisle.con(A_i)
0 [: [; J3 t- a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 p4 L, B5 G: c" }# q) u* @/ W else wait for 10 sec
/ m m" k% r9 c. ^( P7 a( Y3 b if A_i=A_leave then send to die
' o9 B5 W- ~3 S9 \( F6 j' t else inc A_i by 12 n! { Y" T2 F0 N! ^: B
end5 U9 w3 x1 E8 N7 m0 }$ Z
end% ^0 B: S+ H/ q& b
, K2 B2 v( M; C* c4 O
begin P_pick3 arriving
7 k6 s! y3 ^, z3 @& A set A_i to 21
8 I0 H3 _ a( a% S/ o' R3 L move into Q_induct3
1 r; `7 E4 N0 k$ F move into pickaisle.induct3 m* n- h" j M( K8 y+ Q- |0 {& i
while A_i<=30 do begin* f7 f" ]# c" h+ V! x+ B, {/ B3 N
travel to pickaisle.con(A_i)
, m. A! b3 n9 O; n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! [9 h$ N! h9 ?7 j" x3 N( a* A: b else wait for 10 sec6 c0 j4 i0 q( x
if A_i=A_leave then send to die
5 I" W2 x+ H/ _" M- ?' G& I3 }7 l6 J else inc A_i by 1
4 v* I- `0 U7 I4 N* r$ F! g2 A" j# V- I end, t( G% h' s9 I, C( n$ e# F& 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,其它按你的 ...
|