|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- {+ j, a4 X# v
0 J! v: }3 t/ k l3 ~* L# k* H: U( k我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 b8 h- h' @! ]7 Z, n* @! T H. C
5 m6 Y: R1 J1 U( @: N8 Bbegin P_read arriving8 @; b2 [' q6 e' L# A$ F; n: w
while 1=1 do begin4 f: a2 f9 K0 s* p: \# V
read A_tote from "data.txt" with delimiter "\n"
9 e8 N$ j" ^9 L7 h read A_time from "data.txt" with delimiter "\n"$ P" N3 q7 h! }
read A_leave from "data.txt" with delimiter "\n"
, [8 a3 w. T, ]1 v' S* o read A_picks from "data.txt" with delimiter "\n"
' ?6 C7 ~4 Q# Y! Z- W set load type to A_tote
/ ]% N) j6 D6 y if A_tote="tote 1" then set A_induct to 1. A" J6 ]4 N4 {1 E. {( |
else if A_tote="tote 2" then set A_induct to 2
# f6 U* k( n. z( f/ | else set A_induct to 3
0 G) ~3 q* u3 d& W7 n c4 I- ] set A_i to 06 B' y- Z* \. r( [0 [
clone 1 load to P_induction
( R, A- p9 D8 ] wait for A_time sec# @8 `, b3 J5 U3 l( ^# X+ w2 h
end$ Z% L8 B/ d5 l8 d4 b
end |; Z$ i/ \( q% ?8 p& Y. w, K
8 S8 D3 n1 U! \( Z; a; A/ tbegin P_induction arriving
/ l) }$ W. ^8 D2 N/ G" h* Z! E if A_induct=1 then clone 1 load to P_pick1! q8 o6 h- N9 q
else if A_induct=2 then clone 1 load to P_pick2
5 d. C/ Q$ a( H \ else clone 1 load to P_pick3
% c% k9 ^, j" r' j3 r! U, I7 m. l! Hend5 _% a8 M2 {8 R
* z. n' n, H5 d N
begin P_pick1 arriving8 l+ |' F; o9 P8 [# N- E) C" @
set A_i to 1! ^2 R4 V9 k" P- c f. N* p' j
move into Q_induct13 ^6 R$ F' o5 B7 @" d' b' \
move into pickaisle.induct1
1 G6 ]! r: H$ _/ l while A_i<=30 do begin
8 D4 q. {" Z r: d travel to pickaisle.con(A_i)
+ p# G. s8 O1 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 K7 `' r1 R( u
else wait for 10 sec
- w4 R8 f2 T; v* |9 Y7 v if A_i=A_leave then send to die4 ~* ^* V" p! y- Y5 Y
else inc A_i by 1' {& a# r( E9 {5 N0 T
end
% W9 I8 _# |; B3 ~0 v) pend
' g1 ^6 k% z# @9 V# w: m$ ~
4 c8 |9 u, \/ [) Q4 }8 cbegin P_pick2 arriving0 ]' x G4 |& K' Y* t
set A_i to 11
! I) R% r4 h$ x O; M' @, d move into Q_induct2
- ]; h! b- L6 G( q move into pickaisle.induct2
& @, c3 i/ k2 l while A_i<=30 do begin
* w. w. p4 ]9 T& f6 b travel to pickaisle.con(A_i)/ G& ~8 E8 r; J! M2 H5 l% f! H: J5 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# a1 L' q) u' M
else wait for 10 sec
3 L( W8 C/ P& L! ?: D if A_i=A_leave then send to die
1 w& C( {* n( w- t2 Z0 o else inc A_i by 19 w. U/ b& J3 E% I9 S2 S
end G" _& }+ G0 f* ?- b& [$ Q& F; |$ u
end$ l1 ~' p ]6 l) Z. J( Q8 Z
_& \6 Y- g0 X5 P# y6 R2 Rbegin P_pick3 arriving/ Y) k& A5 J% q7 b$ u& n
set A_i to 216 x2 g8 O# m$ s0 ^* T9 ?" o: X" f
move into Q_induct35 O+ I8 h2 J' K# R. L/ P6 {$ F7 h+ L
move into pickaisle.induct3
: B w& r: V9 g: v$ _- r0 j9 Y while A_i<=30 do begin" g2 ?+ ?# f7 e0 z- \
travel to pickaisle.con(A_i)
; y2 p: Z0 v1 h1 v3 I. O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ Z% q9 ?5 S! i7 c! ^* o! a else wait for 10 sec
4 {/ h8 g% w7 H. E2 \* t2 i if A_i=A_leave then send to die+ P- ~/ i t) y1 n
else inc A_i by 1/ S% F: U* t, Z
end6 v. e+ J7 @- `0 d
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,其它按你的 ...
|