|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ T( a/ f- s) d: C- Z
0 T+ K9 u2 A! v E我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 K. v$ R3 S. R+ Y% w2 Y' v' t/ z
4 b) ?; q: j/ F7 y. v) v/ vbegin P_read arriving
7 B, e, }0 R7 d: T+ V* r# S while 1=1 do begin/ D0 L8 i: g" {+ `. ]. o
read A_tote from "data.txt" with delimiter "\n"
) ]- D8 T! w$ s( m$ ?6 @" G( w# G read A_time from "data.txt" with delimiter "\n"
$ p3 p- |5 L, [# X+ W5 m* |) A read A_leave from "data.txt" with delimiter "\n"
0 V) A4 T. _8 U3 y s* t read A_picks from "data.txt" with delimiter "\n"
: x# t9 o/ s1 g Q9 r9 Y- z% d set load type to A_tote
1 z+ N& ^- B, Y9 ]$ j! Z+ u3 ~- n if A_tote="tote 1" then set A_induct to 1! ~: p3 t. J, J
else if A_tote="tote 2" then set A_induct to 23 G: d& V5 J! j( J. \' J9 C" e
else set A_induct to 3 8 F; _! a6 T4 y7 r4 |' q
set A_i to 04 ~$ p9 Z9 ~; W) k
clone 1 load to P_induction
; @4 o; J: U" E ]' D' u wait for A_time sec
3 W; e, Y' W5 P Q) v v. Y! P end
+ g% d5 U5 s9 Z; K4 j+ r. Mend
3 x5 }" y) `- J3 Q0 q) Z
$ r; c$ u- ?! O8 a0 M) E' V ^begin P_induction arriving
9 E( F7 K) N) l) |. h1 f if A_induct=1 then clone 1 load to P_pick1
" x+ O# L2 N/ |7 F else if A_induct=2 then clone 1 load to P_pick2
3 l3 t3 Q& G/ p5 V' v5 J) F else clone 1 load to P_pick3
6 v: t* O8 `, ?8 y8 fend. [8 v% ]# \, Z, I
# Z8 ~! Y" Q0 e! I8 R+ E) R2 Zbegin P_pick1 arriving
" L* s. G$ } m3 t set A_i to 1
9 W& f6 S6 L- i" R2 S move into Q_induct1/ T. D7 ?/ U! \3 f) C
move into pickaisle.induct1
. v4 G) |* A" }0 {) T; s while A_i<=30 do begin9 |- S. b2 j% W
travel to pickaisle.con(A_i)
* E0 V0 j4 y9 O6 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 x4 v: v& @' S0 \/ a5 W
else wait for 10 sec* `+ ~& X- Y3 x$ S4 K+ ^
if A_i=A_leave then send to die
/ N5 ^: T* c( W! v else inc A_i by 1! }7 R; I0 m* l5 e% P
end3 Z; J$ z9 P! F6 l, O* e2 d
end
) m9 U2 m% i. ]7 @7 l
- T. K, ^* I" v$ W+ r' X+ nbegin P_pick2 arriving
( d' {; p! O( f. C% X& H' d @ set A_i to 11
3 O3 ]% ~( E2 I move into Q_induct2$ p8 E% u! S. G9 T1 t
move into pickaisle.induct2
/ ?8 k8 w3 B# p, N& _ e& } z& K while A_i<=30 do begin
. w; o" Z- W5 f; l+ Z travel to pickaisle.con(A_i): A# h7 O+ Q3 @% {9 m* `. i7 o2 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ U/ \* @8 H1 y# |, M* o$ S! a, f
else wait for 10 sec7 U" q1 g0 T8 n0 F
if A_i=A_leave then send to die1 V% t! R) s( W x. S/ `8 z
else inc A_i by 1
. K6 s( M4 e& u: q end
, f( f) O7 s) zend, U9 J( h5 _; H% @( e
' D, J& U5 w' _* y' H# S
begin P_pick3 arriving5 P' q; k0 F. B% B
set A_i to 21. Q7 O1 X2 d9 b# B# C
move into Q_induct3
$ ?* _, k* I" w# y" q move into pickaisle.induct3& H( }$ Y" \1 M& s: [
while A_i<=30 do begin# E n0 c% e0 | R
travel to pickaisle.con(A_i)
7 I( d# H! Q& A, c! W) A! i6 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 q- {" V: l) p9 G6 b, |+ C
else wait for 10 sec
# n; T3 H& d8 q& W8 w3 j3 Y$ P if A_i=A_leave then send to die
; Q$ \/ c( k$ P5 e2 G0 X+ i& r' u else inc A_i by 13 F" C* a- R3 @* q6 ?, X7 K
end
2 ~5 S) z0 e# |- f) b8 p2 Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|