|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 s/ d& ]8 C6 }3 A4 g3 z/ f, C3 }# c# i. a& K; P% 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中的数值,不知道会不会有什么不妥。: B, \1 o, F+ y1 W2 _+ F
# E) i q# F5 A* e1 w3 z5 O2 }
begin P_read arriving# j0 t- b+ _2 d, s
while 1=1 do begin
8 g5 c6 m0 R. i* F5 I- E+ { read A_tote from "data.txt" with delimiter "\n"
9 k( A) b1 B) k; u5 o+ m read A_time from "data.txt" with delimiter "\n", q( e# k* \8 @
read A_leave from "data.txt" with delimiter "\n"
- D( X% l5 i7 I4 ?( z! [5 C read A_picks from "data.txt" with delimiter "\n"5 n0 @, |; {: [1 P: R" ?4 Y0 |5 p
set load type to A_tote
9 N% L# B# f) t9 m( [( v if A_tote="tote 1" then set A_induct to 1
C1 W' a( x- J else if A_tote="tote 2" then set A_induct to 2! R. H6 V; u- M# B
else set A_induct to 3
5 P6 K0 K# Y! l2 ^ g set A_i to 0
+ j0 e3 b: n$ Q" o) b. G clone 1 load to P_induction
. M$ d& w% J3 _, Z" S wait for A_time sec1 w G. j! ^9 x5 Y
end; x9 ~; W) u4 d M4 l5 Q! u5 j
end# h, g" g g% s1 I
6 b, J. y- A5 }, ~- a) e- \, P$ y: y+ qbegin P_induction arriving
T* c3 U5 M4 m% }' f1 J, x if A_induct=1 then clone 1 load to P_pick1- o6 x6 g# i M, u7 }
else if A_induct=2 then clone 1 load to P_pick2
w6 r* X t: p0 E/ | else clone 1 load to P_pick38 r. C+ r9 G" t) x8 Y5 |
end- ~' b6 C* n# k- z6 R
2 y0 f- t$ F: A3 u1 Z, s. \) I4 Ebegin P_pick1 arriving0 H, Q( @, b$ w/ K. g) b1 o2 \
set A_i to 1
( m* P/ l" X# q% y2 Y! G5 G0 ?8 Q move into Q_induct1
- {. e1 ~0 `" |, s move into pickaisle.induct1
3 J" n* ^2 ]6 N while A_i<=30 do begin/ f0 ~& }0 f! h( }" e; t' G/ q% x
travel to pickaisle.con(A_i)
# ^% [5 b+ _+ K3 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ X: ?! w9 ]1 y$ J h3 u. `9 ]
else wait for 10 sec* h: }* e8 w6 w' t' ^
if A_i=A_leave then send to die
' Q; U' G) [4 s5 X4 I else inc A_i by 1
4 R, i4 R' {( `4 F end
3 A4 d r. G i" |+ N z- Nend
: @% ]7 {+ k$ D& l7 E( ~4 B* d" r" F
begin P_pick2 arriving
- t* T" H$ ]; W! a# c3 E7 f set A_i to 11# f- y% d' j3 x [7 P5 {$ U
move into Q_induct2
4 E5 S! t" {- N% e& W1 b move into pickaisle.induct2
) {1 |+ \1 w0 J' e; r while A_i<=30 do begin
& d7 {+ V& Z3 G; g travel to pickaisle.con(A_i)+ T; d$ J# s" X. ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Y- z6 \5 Z8 {& u8 d
else wait for 10 sec: {7 c* ]3 V" U9 U
if A_i=A_leave then send to die
8 P& a. ~- h( j! }& I else inc A_i by 1
3 X Z; q/ r& o end3 F# k3 ^: r4 ?3 q( |! [$ S
end
* @" }$ z4 e) @5 K! e" e g, U/ R9 V9 |8 ]) W
begin P_pick3 arriving
$ T1 V* j; E8 ^5 A$ Z. n0 G set A_i to 213 P: c" D$ ^3 L# C. U3 N
move into Q_induct3) _* ?- {+ f2 y: y
move into pickaisle.induct3% ~# j% a0 H0 u5 L1 l
while A_i<=30 do begin
( v4 j: w8 ^% e; a1 } travel to pickaisle.con(A_i)
* g- W0 ]! u7 N0 G+ J6 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' J& _9 \; X: ^: n/ w3 |
else wait for 10 sec- `, O. u& z c
if A_i=A_leave then send to die
& O8 {6 Y4 H, x& K f else inc A_i by 1" q- ?! A0 B* U/ S
end
" X1 k' ^. d8 |9 k- L' Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|