|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, U# c1 i# W+ b' _4 A+ @
1 l9 {1 ~+ X6 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中的数值,不知道会不会有什么不妥。% ~" [, l. v. ], U
! t% ^6 @/ _- a0 _; `. Q& p5 _0 wbegin P_read arriving
4 ~/ ~- e. m0 i2 c6 B! t+ \8 A8 v while 1=1 do begin0 l" M; J9 m b% w
read A_tote from "data.txt" with delimiter "\n"
) o3 H/ C9 a9 P+ A0 ^ read A_time from "data.txt" with delimiter "\n"
& {7 l0 m" U, ~+ Y read A_leave from "data.txt" with delimiter "\n"
+ ]2 l) O* N5 {9 G read A_picks from "data.txt" with delimiter "\n"* h3 R: N1 t9 j- U
set load type to A_tote
+ U% r* A2 }1 N6 f0 ~" u; V if A_tote="tote 1" then set A_induct to 1
* P9 q+ g" x) v5 F% S) P& Z, g else if A_tote="tote 2" then set A_induct to 2
1 K% O0 p& ^' w% b+ g7 E, q+ |8 v else set A_induct to 3 2 Q) S7 w' j- e: X6 R q
set A_i to 07 t. v9 t: `$ v) M
clone 1 load to P_induction- A2 z$ U- [+ U) G, L# h b
wait for A_time sec
' } I ~) w. w8 n; i& ?. t0 O7 C! F end
* x% ^1 T6 j5 M. i9 G* Nend' h9 z7 e$ a* x, F- F+ n
' D/ C' f- O0 R0 A9 c' K5 X$ sbegin P_induction arriving
7 k2 _1 p# q1 I* y7 ^ if A_induct=1 then clone 1 load to P_pick1" @5 s9 I9 k/ C" \; F- C2 b
else if A_induct=2 then clone 1 load to P_pick2
7 }# S9 K' v& E* u else clone 1 load to P_pick3# n' c4 C" h( p9 m! A
end
% ^ x# y" K2 J8 q# I8 u8 @$ z! ~0 Y
; S( J8 M; i' W* m0 ~3 a0 ?begin P_pick1 arriving+ n% ^" H6 D& V, m
set A_i to 1
, M& `0 K6 h6 ^ move into Q_induct1* j: g2 Q& j* K- Z1 G
move into pickaisle.induct1
' y- M3 w% F6 C6 r while A_i<=30 do begin
! s$ {1 ~% G2 d( { travel to pickaisle.con(A_i)
' E9 o2 g+ A) x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 [ L; r% j r; C# H else wait for 10 sec( H$ [, K! n- r! f; M% K% F5 J
if A_i=A_leave then send to die
4 S& a6 z* r V( T else inc A_i by 1
2 j S9 B, l, q8 j: o. Q4 R% e end
7 o/ n: b5 ]/ H6 A7 K' F. |2 \end( z& o+ G1 c7 W' s) _* c" ?, C
. j6 V" X" B8 k+ t' z" q! D/ V) G
begin P_pick2 arriving
- l$ |$ k0 \" w) W! r9 c. ^ set A_i to 115 j2 f9 X% \8 i7 @% h6 w% ^7 P
move into Q_induct2
* I6 q0 S6 l0 A! C& b( l3 O; K move into pickaisle.induct2! s" G$ k% W% _8 q! ~ D
while A_i<=30 do begin
6 F& l' n% ]6 L; q* n travel to pickaisle.con(A_i)% y& A# y# s8 t! ? _( { z2 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! S1 a- C4 D0 X+ H* b1 q
else wait for 10 sec: ` M: P+ B1 F
if A_i=A_leave then send to die
& D" F$ e. q0 O: g" Y* ]: c- j else inc A_i by 1' ?- v4 r/ O% A
end% z: a/ v, `- s6 x% w. Q$ g
end, y1 ]) u5 u* x) v* @% g* t; \! F
/ d) J9 f, V- y; P; _+ b
begin P_pick3 arriving
; `8 A) o# p3 D+ ~. p set A_i to 21( k! g$ {) J. V# v& F X
move into Q_induct3. x$ i) H2 j1 }" g
move into pickaisle.induct3+ o' l/ Z" F: I7 U7 ]
while A_i<=30 do begin Z! x+ ?/ R8 q* V6 n7 Y" `# }6 f, }
travel to pickaisle.con(A_i)
E( Q% K2 S( P$ ?4 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 s& _4 @2 ^2 y: Z9 z
else wait for 10 sec& o9 | }( C. U. w8 M3 S& [
if A_i=A_leave then send to die7 ?7 o/ g _! V" z
else inc A_i by 14 N" j: ?/ i9 E a z
end
( v, S' Z- ~: r8 I- }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,其它按你的 ...
|