|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 P! G F" ^% F; i- e% d; I) \9 ~3 Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; v: ]/ r8 `4 r3 {/ U( H
4 w1 W1 F* \: u6 P O. zbegin P_read arriving( y) W5 h+ D2 ^9 ]6 R0 Z) t# }
while 1=1 do begin
( m6 F3 [. J$ v( l& f$ p. U; r4 p. p read A_tote from "data.txt" with delimiter "\n"
8 W$ Q2 K! X- F/ K* y, v; P6 L$ o* [ read A_time from "data.txt" with delimiter "\n"
* v7 Q3 F6 o. `) r0 h) { read A_leave from "data.txt" with delimiter "\n"
) ?) B! Q3 w3 D# p u( K) Y read A_picks from "data.txt" with delimiter "\n"* Z' n O( f* U
set load type to A_tote$ P2 y3 X- n4 \! p
if A_tote="tote 1" then set A_induct to 1. Z" l6 g% W9 b# c; T
else if A_tote="tote 2" then set A_induct to 2+ C9 X; V" f# U8 G
else set A_induct to 3 , @2 A% s X: T, |1 A. O
set A_i to 0
3 q0 q( }: {" n9 W, D% t$ @ clone 1 load to P_induction
* }: E H5 S" I7 N wait for A_time sec- i9 s% K- L1 M: t
end; ]) d2 t- P2 g, J
end
0 H; [7 k1 h5 N
$ c Y) o" g- ^5 |) {% Ebegin P_induction arriving# T5 }. u7 S/ H1 x, x3 k. Y
if A_induct=1 then clone 1 load to P_pick1% o q- V8 [1 U, x7 x; `; R
else if A_induct=2 then clone 1 load to P_pick2
; m/ K- X7 s( ]$ [& e- L else clone 1 load to P_pick3
+ Z4 H# ~: Y2 y" g6 l8 e& Y# \end
3 k: Z2 d- Z5 J3 k7 O2 N! P7 r# H g" e s
begin P_pick1 arriving
& L! L$ D; z: H& F set A_i to 1, i( C0 y% e% o; k( P
move into Q_induct1 d6 |( G- R) y. S- [
move into pickaisle.induct1" S( | Z4 F& v
while A_i<=30 do begin
% u. f2 c" [' R travel to pickaisle.con(A_i)0 J$ ]8 m2 q1 u; P, @# J( O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; l8 n( m+ ~4 `6 ~ else wait for 10 sec1 g& W3 \+ p x# X7 Q9 Z4 s6 r
if A_i=A_leave then send to die K: A# H4 R/ R
else inc A_i by 1) z3 @* `: [* ^- S/ m& T, ~, F# a
end
f1 O) J5 e/ }+ zend
# ?- n# V* U' a0 s
4 d, A5 V6 ^2 H# h. [9 Z4 l) ]begin P_pick2 arriving
' T3 u4 ~) r r8 w set A_i to 11
# h$ q7 ?- G$ Y3 z* b2 r2 a move into Q_induct20 L2 G( z9 F6 R2 r2 i
move into pickaisle.induct2
5 R! n/ f2 E+ r2 i6 r" O/ \9 s/ p$ ~- r while A_i<=30 do begin2 a& G% R" @+ t$ V9 v0 [# o
travel to pickaisle.con(A_i)- c9 V- ]9 r& Y& Y- l- ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 E& n' t5 f; o3 X: R else wait for 10 sec
% u7 t5 @. H1 n4 G% X if A_i=A_leave then send to die& G/ a. E( G! e# a5 ]! N" r
else inc A_i by 1
( V: n; `8 w, ~( b8 Z; M3 X end& l- O/ u5 J. Q3 G
end5 L! Q. i) G( I- x+ L
; Q0 C. q( H1 \. P; ?begin P_pick3 arriving6 q: m# Z6 \2 O% x* |% m
set A_i to 21 R" T1 V2 G* C
move into Q_induct3
; X! [4 ]) L5 r9 ?9 A' m+ M( t move into pickaisle.induct3
r9 [ W$ N& x$ ]3 O while A_i<=30 do begin d3 f2 x1 A$ E3 g' a" [% @
travel to pickaisle.con(A_i), W* E1 X1 N! l$ ^/ X3 B+ H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ?8 J7 L0 v# ?: ]8 v6 | else wait for 10 sec
* D: v6 h% d/ t/ V if A_i=A_leave then send to die0 P" K! ^& u/ }4 H0 Z
else inc A_i by 1
+ a) ]* L2 d. u end
8 r2 t( ~4 B; ]. Yend |
最佳答案
查看完整内容
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,其它按你的 ...
|