|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 ^$ \! @- m) i/ `1 S5 F
: v" D) |. W9 \, H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; C1 V9 u, h+ R! Q, B$ f4 ?
1 @3 |7 b# _! C+ s3 h! m7 o+ gbegin P_read arriving
+ B* A# E" Z$ i2 \4 D+ n while 1=1 do begin, a1 T: w% ~6 \& C3 F
read A_tote from "data.txt" with delimiter "\n"4 i; ?. P7 e3 A9 X* X3 p! W; X
read A_time from "data.txt" with delimiter "\n"
9 ?3 k N$ M& ^4 h read A_leave from "data.txt" with delimiter "\n"
. m" w7 y3 k' R read A_picks from "data.txt" with delimiter "\n"% J* _# Q( K+ m+ }. L4 M
set load type to A_tote
0 V/ m2 i0 S5 O if A_tote="tote 1" then set A_induct to 1; Y; ]6 P2 t6 x+ Y& c8 O
else if A_tote="tote 2" then set A_induct to 2' e' t3 E0 ~: r
else set A_induct to 3
7 Z- X' J9 v; P/ U) S0 } set A_i to 0
6 ?9 H7 {4 [, K% d6 I4 \ clone 1 load to P_induction
% @* g% G) S! @; d wait for A_time sec
B' z1 p+ ?/ D& B6 Y end: |! p8 l m+ I: @: o) l: M
end3 a- D' f" t7 J4 G9 e0 \! J
! b1 V2 N; o+ d( R# r+ Z! l
begin P_induction arriving
5 c/ |8 t, {' C/ ]( O! U4 A if A_induct=1 then clone 1 load to P_pick1
& ~8 {- G" |" O7 g else if A_induct=2 then clone 1 load to P_pick2 A9 O$ Y1 b6 w
else clone 1 load to P_pick3; v" O+ v' |- K. [2 R) `
end9 {4 p$ y5 |* |! _5 V" |) `! a
! P+ S4 [0 [. t
begin P_pick1 arriving
6 ^6 m, {4 f+ q% A$ c5 k! U. b U set A_i to 1
0 P5 U4 [% l; m# ?6 @ move into Q_induct1
" L+ G6 S$ X/ r move into pickaisle.induct1% }. L& O! y% m* d+ Q4 c8 r- W
while A_i<=30 do begin: |! c5 V/ L* b4 S3 ?% s
travel to pickaisle.con(A_i)
4 V) g" [* h6 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }8 d* n' ~3 v2 ^. n+ G else wait for 10 sec6 j' C8 w( F, r3 {0 \
if A_i=A_leave then send to die0 ]/ w: C% @& D- a: }% ^+ |
else inc A_i by 1
; \, d8 A8 ?5 |, L end3 z0 s: L# ^9 h2 K* ]
end
+ c) q" P; q; _$ \' n$ p
0 p; |& Y* h' m/ pbegin P_pick2 arriving# B2 W7 ?8 m8 H! Y
set A_i to 11
8 A- r5 \, x9 y, z+ H" [. Q. \# t y. A" ? move into Q_induct2
, N- [( ?; A- o: ^. B. j2 u move into pickaisle.induct2
& {) K8 [* O: C( H! q while A_i<=30 do begin2 F/ H+ k( H4 r9 \8 o5 K4 \
travel to pickaisle.con(A_i)( l: Q2 e6 E* R) {. B/ a' A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 w! \& U7 o* Q/ w7 e
else wait for 10 sec
, Y: n% v' U# ]$ F4 @. A/ U if A_i=A_leave then send to die
# m2 |5 x/ K* O( l6 _" A else inc A_i by 1
* y2 y- R, d1 O% a' {# C! k( y1 m end
7 p5 U7 e& ]9 ^6 \. Oend) {* H- K, I @1 [9 K2 R
* P, p7 y* ~: `* p6 t
begin P_pick3 arriving! O: N; ?; x; r+ s
set A_i to 216 H, Q ^' r: v4 B+ v+ p
move into Q_induct3
7 ?! p+ O G8 ]7 |! j* S9 }# L move into pickaisle.induct3
2 G, c6 a f0 J$ v8 W9 j+ O, U while A_i<=30 do begin
" d U9 s' u+ R* P- o& S" W' ~" @ travel to pickaisle.con(A_i)( O \6 O6 P% P, ~7 P1 [4 D+ ~! E& e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ w' s% E X( F3 z7 U$ o r/ X else wait for 10 sec
! ]+ @; G( N, D$ V; d if A_i=A_leave then send to die9 ?- B2 K5 i4 T
else inc A_i by 1, i3 Z: O1 }/ x* O8 J+ ]
end6 l6 N1 ? f5 j
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,其它按你的 ...
|