|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢; T0 \8 B1 w |* g
, e9 F, O. q, 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中的数值,不知道会不会有什么不妥。9 a' i: M: c( R/ r: m* B
) \0 u! n0 ~0 f- m( dbegin P_read arriving
+ V f6 O- J) I7 ?; x! t4 U while 1=1 do begin% U0 i' S- Q5 `, o$ F/ k, ?
read A_tote from "data.txt" with delimiter "\n"
. L o' ?& t: o2 F3 U: } read A_time from "data.txt" with delimiter "\n", j0 [! z" k- K8 b, h
read A_leave from "data.txt" with delimiter "\n"
* X# H8 I4 v4 x) ?: z6 D read A_picks from "data.txt" with delimiter "\n"
1 r0 P- \, W: ?, }' J set load type to A_tote; U" T' Z" W+ P; y/ d! o4 `
if A_tote="tote 1" then set A_induct to 10 | I- u% M/ `8 ]
else if A_tote="tote 2" then set A_induct to 2
5 M! {% u3 _- K& L. v- x& y else set A_induct to 3 . L* p0 ]. @* J
set A_i to 05 I' {4 O. z4 c) T3 H
clone 1 load to P_induction
( }- d+ @ e% \: ^& f' W+ Z wait for A_time sec- j' Z& O8 s: y Z
end/ F8 V) {& _7 }8 I8 l
end8 J( k o( v$ D, l8 s: h; c
$ e* s5 u4 g: Y
begin P_induction arriving
2 P4 x% p. y" W7 ]( n if A_induct=1 then clone 1 load to P_pick1
& R, F8 O0 C% C) j6 L3 s else if A_induct=2 then clone 1 load to P_pick2
- j; G6 X6 y7 k- `' {# t S else clone 1 load to P_pick3
" K! I: N* A) I {' `end3 ?/ y2 a% h) m# R
+ Y& O# D- n% W7 U, L, Ubegin P_pick1 arriving1 r# U. ?: j( N- Z% m
set A_i to 1; q9 x1 x6 n2 g6 `! X
move into Q_induct1
; h& C7 [; E. O d. E move into pickaisle.induct17 N2 H( l+ c' Q# u/ h! {& u. @( i
while A_i<=30 do begin5 [0 m# u: J p# `. W1 m' g
travel to pickaisle.con(A_i)
" U, C& c5 b% e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" t4 ~* e7 }0 K9 r) J6 J' J& [ else wait for 10 sec
# s. Q$ @3 y/ ]6 n r if A_i=A_leave then send to die
) y& l# Q0 o% f else inc A_i by 1
9 s2 z* Y# ]/ a# t4 d0 H/ w end
. H8 g, W7 C4 Pend7 z9 c0 p+ d, j% w6 T( @' {0 `/ [
4 m) ?) @: u+ S3 V
begin P_pick2 arriving
! X8 U) V* G, [% m2 o& ~7 ^ set A_i to 11( g; N2 V8 b" P4 N8 c
move into Q_induct2" O- E. y4 C4 L2 m( x
move into pickaisle.induct24 _! }7 Q" L, z& O+ ^* x
while A_i<=30 do begin
3 {) }0 _' e9 A+ |2 L travel to pickaisle.con(A_i): W T: V2 |$ ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec B% i7 h$ M, x# H# l" z2 ^! W+ g- W
else wait for 10 sec
' V* U3 `- E: |/ i9 r3 e" T if A_i=A_leave then send to die
. |" A7 c7 N( }, H/ ?3 z else inc A_i by 16 X, z9 w1 T$ Y+ }9 x* G
end
; ^) w! s( r' J+ qend, M/ z; Y8 |# p7 M* E, Z. _" k0 D
5 y2 Z- Y0 i- U1 Jbegin P_pick3 arriving
5 G0 k! D+ Q1 R: B3 \ set A_i to 21
% ]- ?: q w ~/ K8 y6 |6 y move into Q_induct3
& i/ y& n) w7 u F1 k move into pickaisle.induct3
. f* E! y5 G8 ^- J while A_i<=30 do begin
2 B3 f, D* U, S3 m" G. G6 ~0 x3 p travel to pickaisle.con(A_i)) d6 w( ?. z2 p) G( O. F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 d u0 W. [* @# W0 A else wait for 10 sec
/ L& E/ Z) X) T2 P: \1 D# k if A_i=A_leave then send to die
6 ^/ Y0 I2 |% @2 R7 h else inc A_i by 1" G p" g( F6 v% F, Z1 `8 s
end
. V4 E4 L) O" }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,其它按你的 ...
|