|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ Z B) {! i/ h# E8 k$ T. Y
$ g8 u' f- ]/ d! a- t; v我的问题是,在每个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中的数值,不知道会不会有什么不妥。
' t- i9 r: a M
# }7 H. H; w7 F/ o# h# H4 Bbegin P_read arriving$ I9 d8 K h" h7 Q+ [, E
while 1=1 do begin/ F$ g7 f: f+ j# v2 s |
read A_tote from "data.txt" with delimiter "\n"' c9 N( m4 E* {- m
read A_time from "data.txt" with delimiter "\n"+ j4 w, @2 H2 c t& p3 R1 V
read A_leave from "data.txt" with delimiter "\n"
! x7 x3 L& E; Q, q+ p, Q. @2 w read A_picks from "data.txt" with delimiter "\n"5 O5 W* h, M+ {6 f: d) E0 g. I
set load type to A_tote' M) Z9 J( l3 V. r7 f
if A_tote="tote 1" then set A_induct to 15 L# H" \9 |; P7 ~
else if A_tote="tote 2" then set A_induct to 29 q/ x5 r. h7 f1 A( o
else set A_induct to 3 5 c0 @* s% }" }* Y/ J/ o; I
set A_i to 02 `" d4 n. H% x7 v0 s- {- ^- ]+ _ {
clone 1 load to P_induction J! T; y% D0 ]9 Z: l8 ^
wait for A_time sec# |. |) C. S: p" ~: k- P* N4 p3 t
end
0 f/ Z. s, l* _end& p8 \5 U9 S `' |* v% Z8 Z
. z `% `- x0 W
begin P_induction arriving
; o! a' C- j3 z% v6 X if A_induct=1 then clone 1 load to P_pick1
& V5 y& [# F' G$ c" i, ?! t, B% Q else if A_induct=2 then clone 1 load to P_pick2
6 |' g* W4 j: ~3 m, A else clone 1 load to P_pick3
: I& v+ N# _ V+ D0 aend
/ u v9 e# Z+ w1 m! _. Q3 b6 O$ _( b& S: I
begin P_pick1 arriving
9 j. u$ T( d% A9 H. ? set A_i to 1- w! u- U" r7 l( t2 I
move into Q_induct11 k3 u3 H- ^5 `5 J+ i5 R0 y4 f
move into pickaisle.induct1
/ K4 D* u0 h+ n& k+ f# } while A_i<=30 do begin/ e! j: [( C, `+ f+ V( ~! h/ b' g7 U
travel to pickaisle.con(A_i)3 @$ R5 J2 q! d) B9 \7 L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. S. w. Z4 ?/ E- l% z else wait for 10 sec+ |, m" x5 f. M" n4 M# J1 ]
if A_i=A_leave then send to die
! z2 b5 l+ A+ R& w else inc A_i by 15 n+ {% i- O* \/ u9 f* |' C
end% x9 k1 ]2 G( z, I$ i5 R2 ?' l
end, Q) n9 O8 Q4 e% u
2 \0 g) m$ {, m7 J4 e8 m' Tbegin P_pick2 arriving8 X% K5 k. D2 }% c/ v J/ o/ t
set A_i to 118 @4 [9 p8 w4 y) c. d& N0 W
move into Q_induct2
4 t' Y6 i8 N4 [- u move into pickaisle.induct2
1 ^9 l) \" a+ |5 ` while A_i<=30 do begin
( z0 h: e# b! c l4 t' y- s& v2 D travel to pickaisle.con(A_i)# m6 b% n+ Y& w3 C A- ^- f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' G$ U' _' _6 m. _. E
else wait for 10 sec' G4 D p. h+ L! A$ U2 W
if A_i=A_leave then send to die
" X1 [! b' P* I8 i else inc A_i by 1/ C4 |7 u- b7 P6 h
end
" p0 f! C h7 ?8 Hend$ V$ J R4 I2 z$ k
+ }! g S' K0 D' G' ?; dbegin P_pick3 arriving
7 [8 C0 K+ v' a" o& r1 S& g3 h set A_i to 21$ b* {9 y9 M9 ~/ `
move into Q_induct3# E" r6 H) y( o( j: T" @( p. Z
move into pickaisle.induct3. f& K# L. ?+ f2 u1 q. E
while A_i<=30 do begin
( p- o- z# F; R! }3 F travel to pickaisle.con(A_i)
/ a2 p* R J) y% x5 b* ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( l8 B% X: u: k* }" k
else wait for 10 sec# h5 R% y! M, A
if A_i=A_leave then send to die( A8 M3 C+ F2 Q! \4 j$ ? l" w# w
else inc A_i by 10 Y7 ?' M6 B8 d4 D; U' w* ^/ A
end; g: N$ s8 n3 s# Y- Z
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,其它按你的 ...
|