|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 n+ @1 O8 {& R$ b1 C& c. d
5 ^! w* M! w: C我的问题是,在每个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中的数值,不知道会不会有什么不妥。& M7 g1 W* C9 g
" D0 k8 H2 C% |4 @9 C5 k
begin P_read arriving* f+ D R2 _( \+ W
while 1=1 do begin
0 D1 @+ D& R, W# O. t- A$ ?+ p4 h# ` read A_tote from "data.txt" with delimiter "\n"* z. G0 I0 a! l% I4 J7 _% ~9 W1 p
read A_time from "data.txt" with delimiter "\n"
( _) e1 T5 Q" |; J3 q- z/ p) ~ read A_leave from "data.txt" with delimiter "\n"
& E! h* E2 R/ Z3 U# ` read A_picks from "data.txt" with delimiter "\n"
( `$ K/ p0 H+ q2 X; j% M set load type to A_tote
* S2 V! A0 C4 `! m( T `; { if A_tote="tote 1" then set A_induct to 1
2 K& z4 W1 d4 B8 U else if A_tote="tote 2" then set A_induct to 24 Y8 X; {2 P+ J# k
else set A_induct to 3 / e( k% z$ G+ r( j, Y5 Z$ P# [
set A_i to 0, @# h4 u* C# k" _& s' u4 Q0 u0 D
clone 1 load to P_induction: m5 O j: E' S, |. S
wait for A_time sec
- T0 R' O! D8 P" R$ z n end
( L) p7 e# C5 E4 g8 E5 uend
7 Y2 ^' V5 R$ ]' m& m2 Z
& B _& a, F3 mbegin P_induction arriving) A5 q3 O8 A6 P2 j, W' a
if A_induct=1 then clone 1 load to P_pick18 Z9 s3 _8 d/ b( t+ R
else if A_induct=2 then clone 1 load to P_pick2. Q* q5 d! m2 [0 [1 O
else clone 1 load to P_pick3
# l3 _7 }3 S; s' I. Gend
. y& l8 k" j k. w! f2 Z" y0 H$ E k
begin P_pick1 arriving
# X+ w0 C( h' F2 ~* b" D4 z set A_i to 1
& {8 l2 _' g( M/ N* q9 z7 p! l move into Q_induct1
0 @! x! e* X- K4 g7 f/ M+ b H move into pickaisle.induct15 z( L! o" Y: G
while A_i<=30 do begin5 J, e; S# D6 E& B" B7 Y
travel to pickaisle.con(A_i)
& a* \% A; |" l" Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ o$ H: T' t7 v! @% q+ }. `/ V
else wait for 10 sec
+ _/ K. ]8 j" T if A_i=A_leave then send to die+ r \' ]* }4 t
else inc A_i by 1
0 ]$ S+ C4 N1 x, g) N( i- h end
6 p- q$ m& Z/ ?% h+ gend4 W% @3 i h- W
; K$ z. C, K$ s2 q; ]7 c2 @6 U
begin P_pick2 arriving3 [1 b9 p; r; C* I0 Z" E' N$ @
set A_i to 11
5 `! n/ G% x& {2 d move into Q_induct2
6 v7 K' w* {8 X% y move into pickaisle.induct2
* p7 i' p+ y8 X: n- e7 O) J while A_i<=30 do begin
1 g7 S' Y, N$ h travel to pickaisle.con(A_i)
( b) X& B2 E( p- y/ T8 V2 B) L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 Y' H7 w _* ^$ d3 X7 K else wait for 10 sec' P) Y$ j, E1 A% T0 ]- m0 U
if A_i=A_leave then send to die; v1 T& j! @6 F6 [6 ]* A# ?- }
else inc A_i by 1" W9 ?) x+ _- M8 w
end
2 H; a3 V' s$ y v' Cend i% `; w& \! k0 ?4 o8 ]* X e
/ I! O/ |. W/ n- O3 U' s! F
begin P_pick3 arriving
, P0 p) }7 `9 x1 o( c- V set A_i to 21! T2 ^1 }! U2 k/ p" }) g
move into Q_induct3
& n$ {7 d2 Y0 o move into pickaisle.induct3/ L' G+ d# M- N# A
while A_i<=30 do begin3 Z8 a0 m$ c9 F$ D
travel to pickaisle.con(A_i)
# b5 S8 W. G1 U0 O2 i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" z8 T; R0 `# m$ U) f) R" f else wait for 10 sec
$ K9 B! e4 @( o% v# x- ~ if A_i=A_leave then send to die
; W$ t6 _. h7 { else inc A_i by 1
3 q3 J' ] l% ?, d end' ?/ J4 N( A. K( Z+ ?3 \3 v
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,其它按你的 ...
|