|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢4 P. B. w7 D: j. {2 U1 a
3 E0 x0 p9 k- F/ A6 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 C$ c/ X0 j0 i
1 l% D5 A$ r, f1 Obegin P_read arriving
' q8 q' n% S; h0 \ while 1=1 do begin. F" ]. U( Z2 ~3 T
read A_tote from "data.txt" with delimiter "\n"- s& l& a+ A+ I9 i7 Z4 {
read A_time from "data.txt" with delimiter "\n"8 t* s3 `# ~) X) J
read A_leave from "data.txt" with delimiter "\n"
7 ?& C6 n# i( m: y3 U read A_picks from "data.txt" with delimiter "\n"
8 {+ l. D8 c/ T! k set load type to A_tote9 X% y% E, y! K' q
if A_tote="tote 1" then set A_induct to 10 b) I: M7 k, d l# a
else if A_tote="tote 2" then set A_induct to 2' l. F& I. S5 Q) q! b0 S! [1 u
else set A_induct to 3
! o9 j0 n7 m7 z: ] set A_i to 0% P$ Y8 d+ S4 {' F
clone 1 load to P_induction
s- y9 `' B- L+ E0 N* Q wait for A_time sec0 n7 Q& W/ p$ x
end. n' g5 x9 r: d! I5 t. I
end2 ^7 p/ E7 B6 D
/ [/ ]1 E/ {- M0 \begin P_induction arriving
4 f2 i/ z0 p* M/ Z. ^$ A2 r! V if A_induct=1 then clone 1 load to P_pick1
2 U: @4 i* r+ t! V% v: ^ else if A_induct=2 then clone 1 load to P_pick21 Z. P+ s' H. L2 p2 u _
else clone 1 load to P_pick3
2 I, Q! p, q' K- _7 U- B- Zend
% D' Y( @4 b8 [' m% T# o
/ j5 L9 e( y- G" jbegin P_pick1 arriving% B8 h$ h; @0 M1 {, ?. d
set A_i to 1
. L5 A1 K O+ |1 K move into Q_induct1
' y+ v' a6 {. Z6 @) `. n move into pickaisle.induct1
3 ^4 z. H- c$ b, w6 P& R2 {: @" C while A_i<=30 do begin0 M* o4 P" P7 y- p" p+ E# ^
travel to pickaisle.con(A_i)
+ J4 h; q1 d( v7 ?# T3 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) _. D; L- g$ U& v) M: \8 l% v
else wait for 10 sec
1 m, k$ R6 M0 w d0 I if A_i=A_leave then send to die4 y( T1 _: `4 {; p9 s. `7 x/ r# W2 O
else inc A_i by 1
@+ @% }3 V* n* _9 L$ d/ T4 j# v end$ w7 L5 k6 ?9 L$ M7 c
end2 y9 b5 \! ?" z% j* [. U ]
' A: y# o- W0 h u- w0 O+ J3 ?
begin P_pick2 arriving) M" t0 ~ v7 e# b5 a# D
set A_i to 11 Z E0 d( U( v4 U
move into Q_induct2
0 q w- @, g* z5 l, T8 \ move into pickaisle.induct2
" n- I7 d% w: q; y4 m while A_i<=30 do begin+ b' j5 H e% b! D2 `
travel to pickaisle.con(A_i)5 B7 W, B" m4 g; u5 v, ^, P' }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 s/ s, n' M" r/ y# ?% k: L else wait for 10 sec9 f" t/ P/ j" ]) r: b) |: j
if A_i=A_leave then send to die( p" c% C# Q: O1 C5 Y
else inc A_i by 1
* w& G) f. `& V$ W end1 J K5 W9 d+ s) F
end
* X* f. c; t% I# P0 h( t2 c1 B! |* j& w, |
begin P_pick3 arriving% u# x8 s2 [4 ~8 z0 A
set A_i to 218 r h4 W( a+ e, B; g) t6 _ p# M
move into Q_induct3. A$ q3 T" `8 r- d5 Y
move into pickaisle.induct3. U0 W: X+ Q# Y) [$ s' A" y" H
while A_i<=30 do begin
# H; e+ Y1 }; Z7 b/ ?7 z) u" H: @ travel to pickaisle.con(A_i)2 j4 n& a; v$ H2 h8 ~4 z) J; v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; U+ Q4 N8 {7 Y' f2 V else wait for 10 sec
7 ]$ P: o8 p+ C7 q1 q if A_i=A_leave then send to die% a5 w" z( w+ a$ k
else inc A_i by 1
/ G/ T4 V: D. ^8 s$ ~ end
) n2 s4 p) d5 q% F" \) Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|