|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* b7 ]* w9 G0 W" U. w; J8 e/ u- _' \ Y2 j
我的问题是,在每个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中的数值,不知道会不会有什么不妥。: U+ U' ^& h9 W
: b7 [: ~6 U0 _, D) H
begin P_read arriving' p g. ~' ^' t! l$ c% a% j
while 1=1 do begin$ W; y- u( R% ?/ Y. G0 p
read A_tote from "data.txt" with delimiter "\n"
7 ?7 Y8 u9 T/ B3 P# N read A_time from "data.txt" with delimiter "\n" j4 B8 y- e/ G: ]. Y
read A_leave from "data.txt" with delimiter "\n"! r. R6 j0 k$ b- D0 L5 s1 D; Y
read A_picks from "data.txt" with delimiter "\n"
4 ]) N/ m0 P) {: ~ set load type to A_tote
" \, `1 e. Y* D- v if A_tote="tote 1" then set A_induct to 17 h4 }6 c' \4 B. |
else if A_tote="tote 2" then set A_induct to 22 S# [, F( F& |8 X2 f8 g8 _$ _5 X
else set A_induct to 3 $ f# I2 f: x8 _. w$ F
set A_i to 0
" k1 m! m7 {9 D; H; V6 V" k clone 1 load to P_induction
, ]" D& Z8 a* o$ D% k) L( c9 s wait for A_time sec
* F' ]5 {1 {( M; q3 J8 L( J end
4 t6 l# g/ w2 ?4 U. xend
6 F [+ k1 `- a* O! E
9 f ^7 [% w5 g! k% Z2 e' ebegin P_induction arriving* D h3 e# Z0 i, I' `4 ~
if A_induct=1 then clone 1 load to P_pick1& w% }8 T# C: s. u: `5 H
else if A_induct=2 then clone 1 load to P_pick2
' T9 R. u. q1 R) V5 r else clone 1 load to P_pick3" y2 }0 F& a1 D0 Y" r
end
; F K. w9 m" a% P6 j4 z3 M2 b* m0 q0 x) M, X
begin P_pick1 arriving
J8 D8 [+ ^: D( l9 _2 r set A_i to 1 \$ h5 K7 p: p
move into Q_induct1- p4 s8 ?0 }. x
move into pickaisle.induct1' f/ s( @8 I$ R+ y+ L" H
while A_i<=30 do begin B t. a8 q' }5 q& L% W8 [
travel to pickaisle.con(A_i); `. ` w$ x1 ^( i" ]5 S9 e5 C: W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ] k7 o. ~2 W9 b( ^; r0 M
else wait for 10 sec
* r4 a9 j' g: K4 J4 k if A_i=A_leave then send to die( z* L2 d+ ]6 b4 }4 s
else inc A_i by 1
I5 I3 x# a3 q" y" _. v end( {6 ^) o) S5 F2 g
end
* b% w" r$ A' \/ D, e2 h. A }. Q
# H- X. M ^9 {) p' _begin P_pick2 arriving. h. M i: m. q2 ^7 Y
set A_i to 11( A3 V- t3 W Z
move into Q_induct2
& b. F7 Q. p9 i& G move into pickaisle.induct2/ B4 V- X E+ W8 c ]
while A_i<=30 do begin
; z* |& B* u0 g9 e7 v travel to pickaisle.con(A_i)
. O3 f$ ~+ q) Z1 J" z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# G& l, ]& }, L else wait for 10 sec
* _' f' [7 M( R, _' W+ f. S' { if A_i=A_leave then send to die
# ?: F& U4 [. @5 h* K else inc A_i by 1
( s5 T% S" |1 J/ D2 l" c end
9 T# n P% D3 q, iend
5 t1 P* p: w% T1 Y4 a) j
4 T! K( [# ]# p6 X7 Ybegin P_pick3 arriving9 v- q' D# n6 D' V6 J9 ^6 _3 K3 p
set A_i to 21
4 z( ]# W9 @+ `7 T9 q- E! m: {1 e" N move into Q_induct3
! ? |4 V# j- {$ X5 i move into pickaisle.induct32 Y. R4 `# |+ b: S
while A_i<=30 do begin
' {" g* B; m3 y5 {" k travel to pickaisle.con(A_i)
2 L2 @4 Z$ T: b1 c% e) ]- \9 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 |) \3 U& A% ]% Y: b/ f else wait for 10 sec
4 p/ J& V( I5 t9 j4 c- N5 q if A_i=A_leave then send to die2 J, C& A4 z# P" A y
else inc A_i by 14 N/ `5 K1 q& v: T! g
end
7 @; \( y4 ?3 V. ?) K1 q2 fend |
最佳答案
查看完整内容
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,其它按你的 ...
|