|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* _' R% z2 U# e) s1 j
7 x! @' V( j. @2 m; G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% e& q V, m( i" i1 ?7 U" b1 s/ ]( T
5 Q( [2 y3 d5 S' dbegin P_read arriving: Z5 ~2 A8 G- F/ g+ e0 k
while 1=1 do begin6 W5 {, A' e( d9 r$ ^0 W7 J( R/ w
read A_tote from "data.txt" with delimiter "\n"5 Z. d+ j# O" c# y# s
read A_time from "data.txt" with delimiter "\n"
; t3 d1 w' I/ Z6 P read A_leave from "data.txt" with delimiter "\n"
$ I6 o# ~. c" L5 N) T+ A read A_picks from "data.txt" with delimiter "\n"
; ~- t: @. a; p% e9 K: ?7 ~" r set load type to A_tote
+ A' U( |9 U; B" g: Y. A* z+ o5 { if A_tote="tote 1" then set A_induct to 1/ q8 c6 l5 k( s& J) A2 |, ~
else if A_tote="tote 2" then set A_induct to 2
2 C7 d$ @/ D; y! J0 H else set A_induct to 3
; l, y0 \; o3 Q. c+ w. V3 n set A_i to 0
+ W) B7 {$ J# f clone 1 load to P_induction
: a. C8 O; U. C! A wait for A_time sec q1 `) |! p7 ~! ~8 `/ o. t Y
end! e: G, R3 y8 Q; V
end1 A2 |& d0 ?% v* J7 R& ]! g
- o! a" H, t4 ?3 E. ^begin P_induction arriving
: B9 [7 T' u* b' t. `# H7 ?. i if A_induct=1 then clone 1 load to P_pick1
! X& f) I" f9 t# f6 L else if A_induct=2 then clone 1 load to P_pick2
# {% B6 k6 j2 ~# z+ J else clone 1 load to P_pick3
; U) j) i. w$ ?; @) V4 G* l: hend! ]% {8 Z9 C6 l; b- Y: u2 @
; {% R( R- Z' s8 [, z; Y# Gbegin P_pick1 arriving
& v3 L" U2 a! v0 u- u) `+ Q& ~ set A_i to 1+ W' d2 g: ]. R I6 n4 s y0 I
move into Q_induct1
9 ~# A4 i! S0 }( E: @4 \3 ^ move into pickaisle.induct1
% E5 O9 K( y% Z1 O while A_i<=30 do begin+ ]4 C0 m W) k+ `* l! o' _! F; \7 a
travel to pickaisle.con(A_i)
3 n& J9 B; S8 Z( P9 ~% T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 j6 u4 A5 m! e! X( t( o. ~: s' s else wait for 10 sec
) P2 |' H/ M+ K3 w if A_i=A_leave then send to die+ g' n$ B# n! D8 j
else inc A_i by 1* x& Y+ B. B: e0 ^) f4 D3 N7 }
end
! `2 Y1 ]. ^3 N1 `end4 v% I# \6 R( k$ P) g1 z
# p2 u( |4 O5 b" b7 A6 B. a& d
begin P_pick2 arriving6 l4 Z" O$ r: r- L: ^
set A_i to 11 P: i2 i' R W# o
move into Q_induct2
3 F6 d& R7 g F% r move into pickaisle.induct2
V% _. T: @# c+ W while A_i<=30 do begin9 P% @3 h" |: x) U7 O
travel to pickaisle.con(A_i); Z V8 [2 ]; z* ^$ y7 R1 {4 o" |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 T+ h0 E' d0 b+ Z. E else wait for 10 sec a7 X1 F, P! ?: l
if A_i=A_leave then send to die6 C2 v A# B+ ^7 d& {' W; s. Q
else inc A_i by 1
3 o$ Y6 |# \! ] end: h9 I$ ~, Y9 L' j& a( w8 E
end/ h* }) g/ P" X5 n7 r( {) U; |
- i' h3 ~- n4 bbegin P_pick3 arriving
9 S3 c& ~) E+ \ set A_i to 21! B4 ]5 j' i& w8 t; [
move into Q_induct3! [+ w( T6 y, v5 \- o+ Z+ [
move into pickaisle.induct3. H& B* M. p! l5 G* K0 f
while A_i<=30 do begin
% B% {2 \ x2 P6 `8 T' H travel to pickaisle.con(A_i)
3 L; k! B7 {- U7 m! L$ s0 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 V. A2 n9 Q3 ]/ s1 a9 Z else wait for 10 sec5 L z+ ]6 m; [. ?& H8 _- y
if A_i=A_leave then send to die
- ^* ]# C+ U& v else inc A_i by 1
/ z! D8 `- ]# |, `: I. m0 G9 k: a end5 K) o0 Y* }9 H& 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,其它按你的 ...
|