|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& Q( ?% T- ?1 Z5 ?: R8 U
- }2 o6 g# O* a7 y: D我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 K+ v& b7 T8 D$ b. Q
) O4 i: w6 U: y1 R3 h- O+ ]5 B) ~begin P_read arriving: w$ {* p' f# [; y& D7 u5 N
while 1=1 do begin
) X8 p7 Y: N0 [# [1 q! \6 i read A_tote from "data.txt" with delimiter "\n"8 }) {/ f y6 k, \+ |
read A_time from "data.txt" with delimiter "\n"
9 W6 v$ R7 T0 b/ p+ ^ read A_leave from "data.txt" with delimiter "\n", d5 i4 d8 a9 H( p6 M. T0 u
read A_picks from "data.txt" with delimiter "\n"
) \7 c: ~* P/ [. k set load type to A_tote* P; }% F+ W. B9 t1 c4 A
if A_tote="tote 1" then set A_induct to 1
7 p/ l G2 d4 s) }1 F: } else if A_tote="tote 2" then set A_induct to 2
6 Y! t) U5 |' [) t else set A_induct to 3 * k8 P% [+ [; i
set A_i to 0( A# D! W" X: ?& l
clone 1 load to P_induction3 G8 \) {% C$ |, V: m7 {- F' q7 X# T
wait for A_time sec
5 [- u+ X( E' y- `, @% x9 @1 v end) d, J8 U5 X. @) M9 N" E* \- Y
end
4 {# Z8 H! u2 Z6 b, I P
/ H6 F6 t# E" m& ~: ~1 wbegin P_induction arriving( j$ c: _5 I0 y1 o( c# i* j0 w( B
if A_induct=1 then clone 1 load to P_pick1/ k' d0 [! M& I- e0 o" [
else if A_induct=2 then clone 1 load to P_pick2
# g0 I: y# a; B/ K- } else clone 1 load to P_pick3
7 g! P4 t: F3 hend
! i( @4 u( H( l% M
3 {$ d' E) u; _: B/ b, t2 Xbegin P_pick1 arriving
* m1 ]- _! O& U+ X/ f/ x8 D8 W# o set A_i to 1
8 b: s( R( ^; e& J0 p4 Z move into Q_induct1
& l% b7 Y6 b/ z5 V! a2 [+ ^ move into pickaisle.induct1( _* v$ d, @, X8 Q# ~# C7 t9 }
while A_i<=30 do begin
9 K4 G/ K* @- ?2 q1 i V* I1 j travel to pickaisle.con(A_i)
$ f$ h" D& t* A2 X$ F" Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; a6 f6 N/ e' x7 i8 a
else wait for 10 sec
* f1 K: K: a9 ^( p" x; ^ if A_i=A_leave then send to die
. a @! }: P2 L+ y6 u" h# r; e else inc A_i by 1
! g5 K% |2 F# T9 k end/ |( g) e' m2 L: _- ?1 l5 v0 W) z x5 p
end
4 g$ ^9 ^# U: ?1 Y
/ e; }/ `# q( J q; {3 d* a0 U& abegin P_pick2 arriving4 m* A6 |& ?, {. i% j
set A_i to 11
; x( f& Q f3 B# R1 Z move into Q_induct28 B9 k _ k- s3 k
move into pickaisle.induct2. H5 g4 o* m3 m, y. \; H- c' J
while A_i<=30 do begin
- b) `$ K; i9 H* N travel to pickaisle.con(A_i)
6 m b2 I: @' Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: y- P* h! k2 M" i else wait for 10 sec
8 f/ C2 t2 y& C( F0 w if A_i=A_leave then send to die; p7 J; Q; C1 _) |" L
else inc A_i by 1
% v, U" I* x6 J$ m- t* d/ m) X end9 t% ^, u5 k! q; @! F
end
' _$ N+ @2 o! \5 Z
' m5 ?9 n8 B: `: F: _' f/ kbegin P_pick3 arriving
' S; S5 T0 T! g, u6 [* T set A_i to 21; E+ K0 f" Q, @% J$ f
move into Q_induct3% e; `# z3 o3 p5 J/ T
move into pickaisle.induct3( z1 ]4 a3 j) l5 ]! p
while A_i<=30 do begin
, }: Q: I7 A3 H/ W2 e4 g1 ` travel to pickaisle.con(A_i)- N5 Z: J$ n$ C4 F1 x# h: o# }/ r# s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; R3 B4 p- D" W& E3 Z: N- P( E& I else wait for 10 sec
5 z$ t7 Y, U5 v5 g2 P# f! k: c if A_i=A_leave then send to die
4 A' p' u) A' e3 F5 L7 W else inc A_i by 1& ?3 y, }4 g' {- X& O
end
3 u( b% U# J6 Z3 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|