|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 w/ Z" S. a9 G) P: E
6 a y" G% L' L/ S. q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- F6 {& F" w6 N+ ^! X+ T
; x, L+ _% ]5 b: }
begin P_read arriving+ P) p/ }! H1 ~# x' T
while 1=1 do begin
1 o2 I! ^8 s% V3 H {* f0 @7 A$ E. r read A_tote from "data.txt" with delimiter "\n"( ` {! `% r* l
read A_time from "data.txt" with delimiter "\n"
5 a& V# F! Q9 o( r read A_leave from "data.txt" with delimiter "\n"
0 o3 }/ `: e3 ~" ]8 K( g read A_picks from "data.txt" with delimiter "\n"* w ^, z X/ S
set load type to A_tote4 b$ |7 J/ S4 P1 [
if A_tote="tote 1" then set A_induct to 1
! B) i& [0 K" n5 _: o3 ~ _ else if A_tote="tote 2" then set A_induct to 2! b8 X9 g' l+ q* X2 n/ f
else set A_induct to 3
$ F9 L$ I# Q, f8 g# C8 T* o9 k# q set A_i to 0
* j `3 r; S9 H7 V+ c, L6 J clone 1 load to P_induction( j% S* S2 j# \2 ~4 @, v
wait for A_time sec+ y. C" c5 r# m+ U6 x0 t/ Y* _
end
* k; t- o; j$ A, B6 B5 xend" S% F6 H: B X: ], _7 V
- ^- X# L4 N# j2 |% ?0 Ybegin P_induction arriving$ u/ f! Z) f7 ?' |
if A_induct=1 then clone 1 load to P_pick14 `, o6 }2 ]9 c f+ \$ o+ _2 H
else if A_induct=2 then clone 1 load to P_pick2: J9 h6 x! m: H7 R5 i
else clone 1 load to P_pick38 O, M+ f: w* C+ ]( |6 z
end! `1 o" O' Z7 i5 ?& b5 I8 ?( p# l( R \
1 d% z# N+ c4 F* ^% f3 z0 H
begin P_pick1 arriving
" n6 {7 |# Y2 ~( y7 [7 h+ Q& d set A_i to 1! ~) o& |# l3 O2 e1 u A o
move into Q_induct1
5 S, q% V% j, c# Y5 }+ q6 G. P9 E move into pickaisle.induct1) L, M5 e$ P, Z3 b2 S, X
while A_i<=30 do begin6 ?- l: [/ X. m; o/ _: _# X
travel to pickaisle.con(A_i)9 R6 ~; ^' n0 V: i1 X- S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% v2 p' G; D! a/ q% B3 e+ e3 y else wait for 10 sec. Y! c7 s1 D# k5 Z2 T& m' b" R) S
if A_i=A_leave then send to die
; X/ [ @" g9 Y5 V else inc A_i by 1# S- w g9 b( V, a5 e
end6 G$ w; h, z1 k* J
end2 g/ `3 _- c$ I0 ]" t$ t7 R- y
' y0 Q0 q) R) O% s# e; U) x# S5 ^begin P_pick2 arriving9 x' v9 C) s {3 H: K0 n
set A_i to 112 c5 K4 B1 C0 B% D( W" ]
move into Q_induct2
# C7 C, ~, n4 U2 v$ n) y7 \: E move into pickaisle.induct2$ H6 h' c- o" R; g2 {7 Z2 o
while A_i<=30 do begin; ~5 L) u4 e- o% V
travel to pickaisle.con(A_i) c6 ~( c" z9 U* F' t& C/ o4 I$ P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& o: o% y9 i8 y8 b: ?$ e else wait for 10 sec, Y8 O4 q" J5 C; i4 u' S% ]
if A_i=A_leave then send to die, f0 W2 W6 O$ x( s/ Q! V: [9 r- Z
else inc A_i by 1& d. E$ t3 T2 {, Q( x0 b
end1 v9 s+ ]3 c2 |* }8 n! S' q, k- `
end
' T. M5 H( _6 L% @
( }! @- S! A3 u2 ^( l$ `4 |' }, _begin P_pick3 arriving! p. D6 u X% E( M5 x+ I2 z
set A_i to 21- M) |4 E' X* g0 c9 _( W: H
move into Q_induct3
% H6 T- p$ J. E5 n# N move into pickaisle.induct3
. s. _5 h2 ~8 q' e while A_i<=30 do begin- W* D, G* R0 W7 e
travel to pickaisle.con(A_i)
2 Z$ i: m3 l) q# d0 O" ~3 {4 r I8 {5 z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: X9 p, `9 G9 \# M% `% j' c6 p else wait for 10 sec3 K m0 P8 S- t; ~8 E3 j s6 a3 Z! e/ O
if A_i=A_leave then send to die
1 ~. G" ~- ^4 l1 o+ G. Q& l else inc A_i by 16 D1 H" i5 H4 X$ M
end: x& q" [# |/ T0 b; s
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,其它按你的 ...
|