|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 l- i2 P3 W0 T" v8 t( n! [
; F# m5 o& v; 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中的数值,不知道会不会有什么不妥。
+ g* H2 _5 s1 _$ u" J( R* q( I4 t w( j# b' r3 j/ z8 {* Q+ I
begin P_read arriving
6 R4 _% C1 T6 D3 D while 1=1 do begin' j" P9 P, r. v* i" a
read A_tote from "data.txt" with delimiter "\n"
4 E1 q$ g/ ]' s) w# ^; q, c/ N read A_time from "data.txt" with delimiter "\n") ~2 y m& R$ b: N U+ o/ b0 k8 q
read A_leave from "data.txt" with delimiter "\n"/ `& Z1 [/ n; e+ J$ Z
read A_picks from "data.txt" with delimiter "\n"
& T' r* ?" q3 E6 h. l, T, m set load type to A_tote. ~2 P, K" S( q! l! g) F1 C- N) D
if A_tote="tote 1" then set A_induct to 1' H) q/ K: L# ^; k5 q
else if A_tote="tote 2" then set A_induct to 2
# P3 `1 {7 a8 R2 @ else set A_induct to 3 9 w& f! T) L/ |2 `% U% `
set A_i to 0
) x' s& O; A7 g$ z clone 1 load to P_induction! Z, V2 A8 w: _: P
wait for A_time sec
4 H6 z5 x4 G& d8 C9 R/ x end7 `3 V; ?* J. g, A- O. C$ _
end
$ @7 P1 `- j7 D0 |0 l5 _: x: S: z; W6 [4 z9 H n) {* e- P
begin P_induction arriving) W* f, h" s* v' H3 o4 }+ H
if A_induct=1 then clone 1 load to P_pick14 V9 K% m8 U# [# Z
else if A_induct=2 then clone 1 load to P_pick2& P% f f2 v# n/ O
else clone 1 load to P_pick3: x9 ]1 z; X# f- P0 z
end! U; b1 W1 H0 Y+ s5 c6 W
) X1 V" A/ b+ e8 a. ?! m4 T- c+ H2 bbegin P_pick1 arriving
5 p( w) x2 e( v* p* _ set A_i to 1& o/ f; L/ z( W7 _! H& @ T$ ?
move into Q_induct1' C3 t" R* S* w" f" O
move into pickaisle.induct1
2 o$ ?6 A8 r" W; f while A_i<=30 do begin
/ b+ U! r, w; p o# T travel to pickaisle.con(A_i)& A7 C! L8 p3 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 W$ Q- b- v: a. ?, o else wait for 10 sec2 X( O8 N8 y. W7 e L& U
if A_i=A_leave then send to die7 ]# t& o$ L, ]) _8 N; w. H
else inc A_i by 15 P; N, }4 ?5 I+ t% B( @- u! O
end' | i& j+ ~# _; f
end0 u" m% R" `0 l8 B( v, X
- \9 [: W5 W7 P8 [begin P_pick2 arriving
0 \' M k) {" d2 q set A_i to 111 l( w6 A- o3 C9 R! f
move into Q_induct2
& x0 s9 X0 F5 e6 u move into pickaisle.induct22 Z" Z R. T/ y0 b! W3 K
while A_i<=30 do begin
; l1 K5 Z" P, j travel to pickaisle.con(A_i)5 k2 a9 f! c# j: J8 N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 T% |: E" \+ E! k" k
else wait for 10 sec
; h, M: S5 |1 T; U9 H7 b if A_i=A_leave then send to die0 {% y4 m, J$ M/ C' r* |
else inc A_i by 1" u; B# _% f% i, h$ d- j
end% Y- e7 ?4 l. C* V1 `8 B2 \
end
. E8 E8 E, ^' O ~9 c- m8 l y5 [- b- s9 }1 \
begin P_pick3 arriving9 k, _, w) h& g; Z# [ j2 l( R8 P
set A_i to 21& V$ k4 f' h+ p8 S' u4 i
move into Q_induct3
) G9 o& N8 b) N move into pickaisle.induct3. j& d! }" Q! M' T: d# V: R
while A_i<=30 do begin/ K- F! r: I2 a; A7 R9 P0 x2 O
travel to pickaisle.con(A_i)
F# G6 Q& Q0 Y( j: V0 w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q: m- z9 f7 U6 D' C else wait for 10 sec
2 b4 y, f, b2 h* t4 \8 x0 ] if A_i=A_leave then send to die
! E; K( |9 p2 C else inc A_i by 1$ R% [% M! f! Z# f2 F
end1 l! J# O1 N l9 h3 s& ]4 n
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,其它按你的 ...
|