|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& l2 H" c" A# [3 E/ s# y" n7 w' 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中的数值,不知道会不会有什么不妥。
3 ]3 a( X5 V. b* Q! t! f: P# Z
. w1 u2 |$ F! Q4 h3 W: |3 zbegin P_read arriving
" }2 n4 x5 j- x E# t6 S. ` while 1=1 do begin$ z% u7 _( k; _- K( c- v. y0 c
read A_tote from "data.txt" with delimiter "\n"
( |- i4 c$ m* U" s2 c! V read A_time from "data.txt" with delimiter "\n"# Y" \* \4 S$ F
read A_leave from "data.txt" with delimiter "\n"
, ^: k' C2 ^; P# x2 ~$ c read A_picks from "data.txt" with delimiter "\n"( ^- g( L! K# n! ~ `
set load type to A_tote
2 C5 _8 a4 H4 t if A_tote="tote 1" then set A_induct to 1
% i( e' {7 k' B9 e; ?0 } else if A_tote="tote 2" then set A_induct to 2+ r( w% {4 U/ q- H5 n6 p& c
else set A_induct to 3 ! c) H1 G# B, d9 `: s
set A_i to 05 V& g" l7 O/ o* P
clone 1 load to P_induction
/ _% s8 n0 N, ^; K/ D \ wait for A_time sec' c, b! A* V% g( X' `, r9 ]$ Z& E
end
4 C3 m/ N, d& }6 |0 }/ c: uend3 h1 j5 `- _( n2 h3 T5 P# @# _
" ^, D( `1 t2 A! I! j: J
begin P_induction arriving- B$ H, [( t* ~ Z
if A_induct=1 then clone 1 load to P_pick1
, w, D9 z- E9 H. V5 G7 M. m$ o else if A_induct=2 then clone 1 load to P_pick2" ~ n+ y4 ?- H( B
else clone 1 load to P_pick3( s2 l0 {: p; m1 f
end
) |+ f. W" c( q/ N; f2 _1 R; q! a/ D. F/ i' R0 v; X8 B
begin P_pick1 arriving% C! e6 \# x1 e) n3 k8 D& |
set A_i to 1
4 X+ a a) ?0 X6 A1 k! {6 ~ move into Q_induct1
6 z1 M9 l: ]% K V move into pickaisle.induct1& A: n/ X; n9 m5 R
while A_i<=30 do begin* t1 X; _. Z7 }$ t9 w+ s
travel to pickaisle.con(A_i)
' C6 q" C' f( p1 }6 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ v1 `& s6 R( ?) i& g else wait for 10 sec
9 y) K. l$ C! W if A_i=A_leave then send to die0 p1 S9 G7 E4 @9 o
else inc A_i by 1# R6 O- [; f* e- N+ {
end
$ |( ], q4 L! p, K$ H! g* D: Fend
; k/ J' a- Z5 y4 I @$ x: K, i& U0 C4 r, G2 \; d
begin P_pick2 arriving* f& H" b7 I9 ^7 _1 A4 _
set A_i to 11
+ X: ^2 X5 m' i2 ]2 n0 H6 d move into Q_induct2
0 M! u# g- k1 W move into pickaisle.induct2
; i1 r' b' U# N* r9 x j: o while A_i<=30 do begin' ^% O. L/ q2 f, v& ^, R- r
travel to pickaisle.con(A_i)4 |* X5 c" C" E/ M \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& j1 R# K% ]. Y else wait for 10 sec0 B* C4 ^% Z n. ^; ^- C
if A_i=A_leave then send to die
; R' b4 u# t* P9 { else inc A_i by 1/ |1 A# P9 Q. y6 q0 F7 }8 d; W% t4 }
end0 R3 H9 i* U5 g
end
. \1 A% n6 v+ U$ M1 c" s5 s/ Q% g* E1 O2 M; G
begin P_pick3 arriving
+ _% r5 y, d( n$ @ set A_i to 21
% s. `1 @9 E/ p. r% ]1 o3 e2 W5 q move into Q_induct3
6 \( T' ?" V2 F P4 [ move into pickaisle.induct3& I$ s0 X* e! ^# z. N
while A_i<=30 do begin
, _" _/ a4 A* K travel to pickaisle.con(A_i)8 r/ U. j7 h: e( ^2 t2 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ t; E6 a2 J" A, `( ]0 j, R8 m# O* P
else wait for 10 sec
* Y* a) g1 m1 B; x# d if A_i=A_leave then send to die
" ], `; W4 j2 }7 `4 \5 ]/ d6 l else inc A_i by 1! M" G$ q/ ^# w1 M& j
end8 E" z+ I7 F; Z6 I
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,其它按你的 ...
|