|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 x2 n+ @) T2 b. [. c: \4 |2 z' I3 H- `9 K) ^+ O) u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" h# ^4 G! R) n5 C- U7 H& K
. \/ s; ^0 J/ k0 c. p$ ebegin P_read arriving! _$ ]9 W. Y% b% r! ]8 y# ?
while 1=1 do begin
* y2 N1 s- m' E read A_tote from "data.txt" with delimiter "\n"# W0 `- v0 W. c; i2 }- j8 _
read A_time from "data.txt" with delimiter "\n"0 R w4 l5 Z, S3 u3 t, t, b
read A_leave from "data.txt" with delimiter "\n"
~/ F" T- z3 |! @ read A_picks from "data.txt" with delimiter "\n"0 q5 B$ h3 q: ~3 J: T1 \
set load type to A_tote; A6 Q1 }4 J J
if A_tote="tote 1" then set A_induct to 1: ]" s8 z5 R S: F
else if A_tote="tote 2" then set A_induct to 2 l! Q# Q( U; ?
else set A_induct to 3
% T3 n# q5 }, k& L set A_i to 0, L& h: s1 c& i' m& C8 q
clone 1 load to P_induction
- b( b/ j$ P9 F2 @7 s W# e' G wait for A_time sec
2 W. ^$ f; Z. i/ l3 C end: i/ c' ?$ Y9 t0 }' {
end
' i- _% j4 h1 k
% y4 P% O( x" M7 S6 lbegin P_induction arriving+ P, A1 {" H1 D9 T- d
if A_induct=1 then clone 1 load to P_pick1
/ A1 L( x8 Y* \5 Y$ s else if A_induct=2 then clone 1 load to P_pick26 Y0 K6 t; E" T
else clone 1 load to P_pick3- a& V2 o$ Z7 f; z
end# |# F/ Y) c7 i* O9 h. S
! v+ R4 R6 `) J) B1 x$ c3 v/ B* P
begin P_pick1 arriving
4 X( m( p/ |; d$ b6 L set A_i to 17 `5 \- I0 [# G9 }' I) u
move into Q_induct1
5 x' @9 W& d7 ~$ h" M1 V) V3 N! D move into pickaisle.induct1
$ E$ Z1 B z6 o2 Y' Y while A_i<=30 do begin% S% @8 j1 S9 J( G
travel to pickaisle.con(A_i)
5 {: T- l- |6 x' k; |! _1 V5 o2 w( E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* G: o X) s( H9 w
else wait for 10 sec$ K! e f/ t) e/ s, X
if A_i=A_leave then send to die
5 Z5 r& _7 n" v6 D0 P5 E else inc A_i by 1
- v0 C* b8 Y! M! k; L end. q G% _7 \% m. l v/ m
end: h, c4 y1 k: b' [2 \/ c
4 f/ P1 @0 ?! R! g2 p6 i, Y
begin P_pick2 arriving: g! R3 M: W! j+ T: k" N, n i, a1 [
set A_i to 11
$ E( A5 T( v2 n8 A7 w move into Q_induct2
l$ x& A/ E3 n- S" ]6 k; l move into pickaisle.induct2
]/ X3 g% D/ R3 A while A_i<=30 do begin/ f" _& Z, a( b! @ g" H! v
travel to pickaisle.con(A_i)* x, n7 t, ? K }+ }1 h! e* \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( J- ]" F3 O9 b' T& _ else wait for 10 sec
0 q+ @6 x$ d& g- W7 k if A_i=A_leave then send to die
- w0 [/ f/ V. ` else inc A_i by 19 x0 `) \) D" A: Q' j: ^
end* R6 i* n# i7 M5 g+ S( e
end# _! q2 L- I. h4 R
# }$ D% [5 q/ r
begin P_pick3 arriving
" u4 `8 z1 y" }: x set A_i to 21
C, Z6 ^ D/ z# z/ ]( ]$ t move into Q_induct3) j5 i3 K7 [) y
move into pickaisle.induct3) p# d- U5 h' H
while A_i<=30 do begin
! |2 p. L: F/ ^6 H travel to pickaisle.con(A_i)( X+ v9 T& V0 N: R/ r) u. Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 b5 L% P9 E0 E0 `& y9 H; _ else wait for 10 sec
3 n5 n" g. U; U- M6 e4 u8 ` if A_i=A_leave then send to die
( w, s+ @8 z9 G1 F' B- s: |& x else inc A_i by 1# m# r+ a$ E X
end
: |1 y4 t+ w- {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,其它按你的 ...
|