|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) l; T$ z8 H5 {7 ?
( f3 W* W- y0 C- b( p# C, L K" q我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 @+ T4 I3 A h& j: f
( s3 R: A8 \: g, gbegin P_read arriving e7 {. L, Z8 N
while 1=1 do begin* ]. ^) R! j$ N! ?) ^* Q! l
read A_tote from "data.txt" with delimiter "\n"
' `* N2 J0 Y+ P$ t$ B read A_time from "data.txt" with delimiter "\n"1 C& x; R- T/ m9 r# }
read A_leave from "data.txt" with delimiter "\n"% K& ?! s( t. t! `+ h. W+ |
read A_picks from "data.txt" with delimiter "\n"4 ~3 {* \9 U) Y
set load type to A_tote
, G0 s6 Q) B3 m S2 ^ if A_tote="tote 1" then set A_induct to 1
0 t$ ?1 o, m$ S! U2 m else if A_tote="tote 2" then set A_induct to 2
2 V7 b+ J# o" Y7 o" v else set A_induct to 3
3 e4 I" z( d! m }$ W* ^: t set A_i to 0) m7 F0 k' L( t; \' b& j5 o
clone 1 load to P_induction
/ g. r0 h' u% H: c& i wait for A_time sec
$ n; e3 e1 O7 d* J* O end7 ]- |8 F& _( c& F8 `* d
end$ N0 L, Z5 x, N& v. z5 c- g" d
4 d6 D, G: P$ b. X& ^* Dbegin P_induction arriving3 u$ L& J) F% X# L9 n
if A_induct=1 then clone 1 load to P_pick1
9 |- G- A( Z3 e else if A_induct=2 then clone 1 load to P_pick2- M7 B& K2 ~' E
else clone 1 load to P_pick3
0 C' J3 d$ u' v* c2 ~$ F" e' bend! W1 h! D# y9 V( O' g& i! ` x6 d
- ]3 K" y$ v) L1 c. [% c, N; J
begin P_pick1 arriving
4 y8 ~& d/ P& N set A_i to 11 k: P0 N2 m8 I& g0 r3 J" v
move into Q_induct1
! ]! m. y1 \9 C move into pickaisle.induct1$ _* N3 O: C; W
while A_i<=30 do begin" C9 V* R/ U; i* v. E
travel to pickaisle.con(A_i)/ Y4 T+ w8 l- e W, E- B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 K6 a* f) P/ \/ H else wait for 10 sec" Q2 k; p: D" q" x+ A) v( _* n
if A_i=A_leave then send to die
; X8 A/ m9 z- s4 s, }0 [/ O3 L else inc A_i by 1& F- ]+ Z; R$ ]) S& [! j3 n
end! F, L) v' H" `
end
! e7 J V$ h$ J1 ~1 `
# l7 M4 H- v4 Q' V0 xbegin P_pick2 arriving0 Z( t* T9 Q) P
set A_i to 11% v9 r' O6 Y1 \: c4 h
move into Q_induct20 R, A2 C- D3 c1 _
move into pickaisle.induct2
' |, ~" `& ^: K& C while A_i<=30 do begin
% T* h: u% f- ?2 m7 d- e* w travel to pickaisle.con(A_i)) f: r3 g9 S9 f% m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# Q. g9 Z8 Y) u5 @- u% w
else wait for 10 sec; \: }) H* f; P9 U! F! r
if A_i=A_leave then send to die
4 Z$ [4 t% ]5 I: s else inc A_i by 1! X7 @2 q: `9 W
end
5 X/ `+ h4 `3 ]" Z; Xend
& a% B" D2 H4 ?: {7 o2 [) H/ ?
g' @8 U. K4 g7 g2 zbegin P_pick3 arriving
+ A$ h4 \2 Q/ `! Q' J set A_i to 21% h9 @& |4 y$ k
move into Q_induct36 k$ P: H7 ]0 X. I/ q% R
move into pickaisle.induct3
6 E: ?: T* Z- A9 J! N1 x" J5 B while A_i<=30 do begin9 x, b: N U9 l
travel to pickaisle.con(A_i)% n* V: n1 D' J+ N/ f# _# \1 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 z& H7 P% x+ A, c else wait for 10 sec
/ E: h, ~8 L% F7 c if A_i=A_leave then send to die" [4 F0 G! p/ k- k
else inc A_i by 1' y1 v! h# B3 }3 ^& {" E
end8 j: W; k) f# G8 E6 q# u
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,其它按你的 ...
|