|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 N. Q' K5 [5 q% O/ V' \3 C% u9 V) s( c, \. `3 s8 H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% X6 K/ p( c9 j! r3 V7 U% F
- A$ }8 o6 T( @* {* j' D
begin P_read arriving# L% i( h% }" v* B
while 1=1 do begin) p& J/ l0 D2 D! Y2 A
read A_tote from "data.txt" with delimiter "\n"* r6 V+ ^8 J4 Z+ V5 d" _
read A_time from "data.txt" with delimiter "\n"
]* E" Y: p) |: Q; F3 \ read A_leave from "data.txt" with delimiter "\n"
; o% t; `7 E. j* t& A" s! b read A_picks from "data.txt" with delimiter "\n"
& B! z9 R3 L. w set load type to A_tote& [1 x" x$ B; W6 U. C* T: Y0 K. E: r5 l
if A_tote="tote 1" then set A_induct to 1
& O! J& Q0 j' p0 m else if A_tote="tote 2" then set A_induct to 2
8 E' w/ P+ h) \9 E) z- _ else set A_induct to 3 0 ^1 b( |' b( I" H1 b* ?% a
set A_i to 0
( c( {: K3 R( H n, ? clone 1 load to P_induction
- o/ N8 V% k( P( @8 |* {. v) u) V wait for A_time sec* ?- k% a$ X; f& M: ?
end
* y: v" p! d( F+ v6 ?+ Y, _: Jend2 N; l. M* g& ^$ s
* U7 ?2 P. C+ Y) @( \' K
begin P_induction arriving* p3 X5 y( L- J
if A_induct=1 then clone 1 load to P_pick1
9 B( b, R! }+ w3 D0 x# X, ~7 }/ Y else if A_induct=2 then clone 1 load to P_pick2& K: ^' _# G5 L& |% c: D
else clone 1 load to P_pick3
! F/ C, @1 E* B3 J4 ]end% K+ G8 H v! h% ]/ e- Y' G. v
0 N& i. ~$ C- ` Zbegin P_pick1 arriving
9 L$ d. c$ p$ C" v/ N. t% m6 S+ I) B set A_i to 11 S2 i4 R0 c3 u2 P0 q
move into Q_induct1/ v) t2 c/ N; N7 j
move into pickaisle.induct1
' i; R' u# ~2 i3 H4 z while A_i<=30 do begin! C7 E- k, z1 I
travel to pickaisle.con(A_i)
5 S7 H3 Z* p# p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: P3 K& ^0 w! `, b8 Q' X% @$ t* J4 L1 K
else wait for 10 sec
; U$ H' ?# q7 H3 [% ?& O* N; G if A_i=A_leave then send to die& ^; y: M: O- F2 Z2 Q
else inc A_i by 1
: g& M+ T" p$ C3 i0 ]' o: C" k! w end
* S1 P) j+ l8 |, x& y) ^end$ ^ e" S; \9 b' W+ `# ^( o
9 N& X) o. o0 P) ]
begin P_pick2 arriving
4 B6 E5 L% x+ b1 z set A_i to 11
. m/ o1 R: j! R move into Q_induct27 j1 r* u* S) a$ H& z3 }
move into pickaisle.induct21 Y" ~! [, T. G
while A_i<=30 do begin+ r7 F: J& i6 ?7 H: I8 \0 v
travel to pickaisle.con(A_i)
4 }! J7 t. N1 F: J9 F/ ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( ^/ f2 H9 [" b/ u0 O( h$ @/ a else wait for 10 sec' c4 O9 H- v. f9 o
if A_i=A_leave then send to die
$ _" q2 G6 T0 w! N }: Q2 W else inc A_i by 1
+ h3 N$ {) [( a end: ?+ B* I2 \$ z" x( S
end
' o6 i9 s0 P1 L4 n k* _% y1 c/ o0 N6 e: U6 n' ~; _
begin P_pick3 arriving
5 p0 x% l4 J5 N' i% ` set A_i to 211 A7 f S! d4 F7 K$ D) q6 A
move into Q_induct3
3 d$ q$ g/ L: x% E8 f move into pickaisle.induct3- O7 b* Y7 v) N1 t+ e
while A_i<=30 do begin/ F4 G+ D |9 B* Z
travel to pickaisle.con(A_i) b6 x% e; l* b" M: t7 _5 h7 D* N- x2 _; i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! w& x0 }" |" r- Q1 e else wait for 10 sec6 `# |6 D0 |" A8 b
if A_i=A_leave then send to die f; K1 J; X( _
else inc A_i by 1' L+ R/ a5 Q0 C- Z8 s, W2 [
end! w* G% l+ |0 M! [3 s. s6 J8 B8 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,其它按你的 ...
|