|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
S. f* e. }, {( o$ H# j4 S# N
1 p, E3 x6 o; j3 K我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 s+ {( s/ e1 O& |: b" U% V
% ]& L: [7 q% n9 B) Q5 r1 \
begin P_read arriving4 A1 B) h" |* K
while 1=1 do begin0 z% t0 I" v% ]9 g; Y/ F a# b
read A_tote from "data.txt" with delimiter "\n"
- J% F) y. [, s# B4 [0 @( D% r read A_time from "data.txt" with delimiter "\n" \: g9 f& h/ c* @$ r; }
read A_leave from "data.txt" with delimiter "\n"6 a5 s+ L. w, C4 T; X/ d* J/ M( u
read A_picks from "data.txt" with delimiter "\n"3 y% u5 J! M# o Y f
set load type to A_tote# r1 B o) j+ } {5 ?
if A_tote="tote 1" then set A_induct to 1
- R9 M3 P% O/ g! j& x+ a' Q else if A_tote="tote 2" then set A_induct to 27 S% h2 D8 L" ]* ]% L! r- e9 Q# r" q
else set A_induct to 3 , N' m/ Z) G% k! s0 `7 b- h
set A_i to 0
4 Y, {3 }# X2 a& `5 j4 Q clone 1 load to P_induction
5 Y) X0 |9 l0 O9 a wait for A_time sec% g5 Q# Y' L+ n( n7 v5 b
end. _/ h0 y+ F l" k n
end
) S% a) E$ E }. }% V
6 e/ ^9 b3 e; E8 S5 zbegin P_induction arriving) y- `. i) P g2 o8 {- t+ Z& U
if A_induct=1 then clone 1 load to P_pick1# ?4 n' A( e" C0 {7 \
else if A_induct=2 then clone 1 load to P_pick2# m/ L* ]2 Y+ P+ l! b. l
else clone 1 load to P_pick3
; @& `* {! o: Fend
8 n& ^/ `5 C9 l9 k
1 r& r9 K. l" e9 L2 S7 d& L9 Nbegin P_pick1 arriving/ x' j( t" F% o8 ^2 K3 A
set A_i to 1
+ C1 V' \1 l, R' r' l4 z0 ] move into Q_induct1
* |9 c8 m! h0 @; b# g$ z4 e move into pickaisle.induct1
. k) y7 ~, \0 m% F while A_i<=30 do begin
' Z0 T6 o" A, k* }8 Y travel to pickaisle.con(A_i)
( [) h0 D+ x, A! ~/ _5 ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) X( m9 n, @ K- n$ R9 [
else wait for 10 sec
9 O# j( O4 l8 K) v2 G0 v2 S M2 |9 @& H if A_i=A_leave then send to die
4 } k6 d' `; ~2 n1 n9 Q( F/ r4 x else inc A_i by 1: r0 c4 G% ~' O3 l8 J! m1 \
end) C5 ~* K1 U7 t4 \1 k' J, Z/ D
end
) r& G8 j# C" V! q$ y z P
8 g6 q2 p" U0 b" ^6 W& G, T2 L4 x) Tbegin P_pick2 arriving4 c. o9 c. v2 \- S5 I" \
set A_i to 11
F* N4 J/ i& P1 S4 y move into Q_induct25 J: Q, T- ~* g5 P
move into pickaisle.induct2* B# X& W. `: v E1 h: y3 S
while A_i<=30 do begin9 H' w9 D7 N' l
travel to pickaisle.con(A_i)* z( ~- W! J9 m' I1 T( {: s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: w) |& k- Y) U, M( H
else wait for 10 sec" ^- q, f$ p$ Z& J' K
if A_i=A_leave then send to die
0 Y9 U- X0 j$ s! \! j! d else inc A_i by 1
6 l/ n# ?. g* F: {3 M end
$ g3 U5 q' `. M6 e' M$ z+ X0 tend
% {) S- X1 ~( y" T5 u- t" ?# V. r9 w! z5 ?* O$ n7 u# }6 O
begin P_pick3 arriving7 q I' q: t! C7 W' T& m
set A_i to 21
7 s' U0 S3 t4 r6 p move into Q_induct3- |' V; p- h) D& Y6 g! h
move into pickaisle.induct3
/ F8 V; a' ]( z- x. k% w; i while A_i<=30 do begin
3 U! Z( t7 M4 c6 H travel to pickaisle.con(A_i)
4 v7 g1 ?( c4 }* i/ a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ e- J7 ?, J0 J& N; h' z& F else wait for 10 sec
" b t( h/ w: o( m6 R if A_i=A_leave then send to die
' ~2 M/ I0 m r) {; ^% F: a else inc A_i by 1
; Y8 _% r0 O# Q5 k end
2 B9 u( |) ]" n5 Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|