|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 r; {. v; Z0 p# v6 D+ R
- C9 g4 q: E. _& {7 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中的数值,不知道会不会有什么不妥。1 \% r; ~: E5 b' M+ @, k
0 f6 W( Q3 A) {9 {/ E* R+ Z6 {
begin P_read arriving
/ n; f# X. b4 |* z5 D while 1=1 do begin* h* U' H9 z/ T2 \3 E
read A_tote from "data.txt" with delimiter "\n") h" Q$ @ a; \; L
read A_time from "data.txt" with delimiter "\n"6 T" S6 W0 k# u" D
read A_leave from "data.txt" with delimiter "\n"$ Z7 O/ X( g. ]4 W
read A_picks from "data.txt" with delimiter "\n"* l& q& H, ^. w! t* f1 [
set load type to A_tote
' p6 K! c- G. m" o- H if A_tote="tote 1" then set A_induct to 1
/ n+ u( H; _* U) p7 G else if A_tote="tote 2" then set A_induct to 2
- Z2 \1 K0 ?6 D# ~ else set A_induct to 3 * R D: ?4 g# v# W
set A_i to 09 ^2 L8 N5 W/ C$ g" h7 e$ y5 T" c
clone 1 load to P_induction7 Z2 V9 F1 K* K' g
wait for A_time sec
3 W- h7 |# b" K2 r X end
2 F6 X5 \& E6 rend5 U# c( E; N2 P' T* w, c, q
# e2 d2 o* l) o3 C; a4 Xbegin P_induction arriving
, `, Z/ c7 Z# B. O if A_induct=1 then clone 1 load to P_pick13 b# T7 d) v+ ]
else if A_induct=2 then clone 1 load to P_pick20 [' e5 B; @" b% b5 h: I
else clone 1 load to P_pick34 i3 r) {: { X
end9 l2 v# C% d" T$ M$ ]
, d. x/ D% i1 H( {" r5 p$ c+ U
begin P_pick1 arriving
4 m9 |7 C! w6 p$ d' U2 z l! S6 z set A_i to 1
/ J/ G3 o% q: C move into Q_induct1) o$ c2 k# `7 C0 @+ B4 e
move into pickaisle.induct1
0 v& X, p2 J, M, [. a1 k while A_i<=30 do begin
/ F0 F w( F, b5 c3 t5 c4 _ travel to pickaisle.con(A_i)) M6 c4 k& b) O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ {2 d9 S; \9 E! t' K else wait for 10 sec
$ D" D- j9 _8 M' z. ]* e if A_i=A_leave then send to die
" u6 z A! a4 ^' }1 J6 X' H0 R9 ` else inc A_i by 1. ~: U2 y) O) r( {7 K
end
+ Z+ n1 ^- B/ p" b0 e# V6 Zend, ~: H. x+ c2 D( J
. P9 U5 {2 M0 W, f6 B9 q9 X, \begin P_pick2 arriving& ]7 |# d- u' h1 {1 z3 j! f- s
set A_i to 11
H, `% j$ a5 e: X move into Q_induct2
; e; F# x9 n$ @1 w- E move into pickaisle.induct2
^$ P' q0 x0 Q while A_i<=30 do begin( C5 U9 y. V0 ^
travel to pickaisle.con(A_i)/ Q0 T+ {9 M8 i3 y# I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. Z) f4 i: l V4 T! f# q) Q. w4 L( c
else wait for 10 sec: z& |; V5 y5 Z7 k$ Z
if A_i=A_leave then send to die% }, c! x |3 |% [
else inc A_i by 1
5 @% t5 J0 W2 n$ `3 w. L: _ end$ ]) c$ N" Q/ R* B
end
) H" W( }" |8 H8 K! ?0 `& `' T
9 G2 E8 L6 g9 z$ m# j- mbegin P_pick3 arriving2 ?" w* C% }6 _ F$ M
set A_i to 21( M8 V3 ~ d$ \
move into Q_induct30 b/ \$ ^6 x! P1 e
move into pickaisle.induct3# `% D# q" H- E K) u" _; I
while A_i<=30 do begin+ w2 p2 S% U7 b% f5 Q. v# _, _, q" @6 X
travel to pickaisle.con(A_i) d1 p) v# C1 E& R
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 o) i0 J1 A# u1 F8 a8 u. i/ X else wait for 10 sec+ X6 W/ d' J, w* c; R, A
if A_i=A_leave then send to die
6 A E9 w7 z# T0 W$ N6 f else inc A_i by 1
$ P* o6 `1 x5 p \+ R* b, q end
$ T$ o0 C5 s, ^# x( _6 |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,其它按你的 ...
|