|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- h3 `( \5 C/ h6 _! A O& `* b/ w6 V; F( m+ w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' \" I* e* V2 ?0 a" O9 O" n
! z, p8 n7 `, \! @9 M6 n; Dbegin P_read arriving9 q6 T. r8 x9 Y- R% p( e& s
while 1=1 do begin L( E/ \; U: I3 j
read A_tote from "data.txt" with delimiter "\n"
! F$ E) @% f) O; r" E$ f: N0 P read A_time from "data.txt" with delimiter "\n"
# a' O4 h; d: l read A_leave from "data.txt" with delimiter "\n"
' M4 l$ H3 Q* X' v% K6 c: ?- p read A_picks from "data.txt" with delimiter "\n"# }7 T0 [9 p( J9 ^. ~- x6 O8 J) l
set load type to A_tote
0 A1 H) g; \3 \4 K* D if A_tote="tote 1" then set A_induct to 10 G; V& c4 b" n0 _- k
else if A_tote="tote 2" then set A_induct to 2- X# D* j; S1 w4 O
else set A_induct to 3
( T7 i1 p ~/ C0 }: u% l9 B set A_i to 0
) |/ z8 j) }2 b- @" w; w; N clone 1 load to P_induction8 k6 ]( K; C+ J! l% M
wait for A_time sec
& o6 c7 a! \2 |% F) n6 Y( z/ t) J end
2 E" T+ A F( m; G- I/ Rend# a4 j9 y$ y1 Y; ^
2 A+ U1 i! w4 K( \ B( H+ ^% f
begin P_induction arriving& ]! j( Z9 T& S- e9 l( y
if A_induct=1 then clone 1 load to P_pick1
; a g% s# g0 H- L& s+ X4 F! u else if A_induct=2 then clone 1 load to P_pick24 U0 u) D9 W6 {) q% g2 p) I6 W
else clone 1 load to P_pick3
2 l8 z3 e$ c5 n0 f N/ Fend6 P/ C# o: M8 f1 F" |; K
+ z3 q% [( j4 @ f3 `; X2 U
begin P_pick1 arriving2 g* J t5 r8 w4 K3 d' B' J( W/ \7 [
set A_i to 1* a( M' y1 x% B# |) @, t7 x: m
move into Q_induct1
6 T: K9 \! q# a# l* r. S move into pickaisle.induct1
4 S$ w) ] c" ]( b while A_i<=30 do begin9 D; X8 P1 U* [4 H) ?4 E
travel to pickaisle.con(A_i)
5 M& g6 {6 A" C1 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 C/ H9 q8 m7 v3 n" e/ c2 r else wait for 10 sec* V1 d9 X4 Y/ i3 ~
if A_i=A_leave then send to die; ^0 s* R. b, c' D' w& j: d
else inc A_i by 16 f( Y6 |, z% x) D
end# F) q2 H/ S: X+ A) D! x; I
end
0 a3 F( A/ S( \' ?. m* P5 o) J: o; u) o5 F
begin P_pick2 arriving, Y4 t& P8 X9 d4 [% K
set A_i to 11
; [3 s j" c5 z* y: c move into Q_induct2% \7 l. | }: O, F! R
move into pickaisle.induct2
, _4 T4 S8 F& q. A while A_i<=30 do begin+ {; l* t: j6 M; p& f
travel to pickaisle.con(A_i)
! a' Q* q o }0 v, ^4 r8 E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: F9 I$ |; M# G
else wait for 10 sec
3 h& G2 f$ V x0 q; P0 A. h- w if A_i=A_leave then send to die
! v8 Y, y0 ]% s' C; O4 }& U6 \ else inc A_i by 14 t8 _9 n% e5 G+ P/ z
end
7 g/ }2 O$ V J0 n3 T( Eend% L' U# ^6 k# `4 y4 W2 V
& g% F, @0 g# t
begin P_pick3 arriving6 E1 ]8 |$ m5 c! y8 l# X' c, O
set A_i to 21
% M# P7 ~2 O7 {( n" Y# I move into Q_induct3
- g" W9 P- s) t5 ` move into pickaisle.induct3' g5 s( Y0 I4 n
while A_i<=30 do begin) R4 v- p. ^1 y: {! h$ z) W" y
travel to pickaisle.con(A_i)8 R0 K% a/ b, q) {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 ~4 H0 e3 n3 o8 n$ N) T$ H
else wait for 10 sec
* D3 n. x0 n1 h8 J% G if A_i=A_leave then send to die6 i7 @" @% U& T+ m5 Z
else inc A_i by 1) w7 P( W% C0 i: a* W( E7 K
end& H A1 Y3 E3 N9 u
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,其它按你的 ...
|