|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 S* \7 O4 C1 T: l
$ S1 N/ L" A1 w Y" @6 {我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) A x0 v% \" w' O* L8 A! `; k8 e: c
begin P_read arriving( A/ e7 c! D# h3 K9 T* Q9 ^
while 1=1 do begin# @% F* i5 T3 n* v$ o J" H& T& f
read A_tote from "data.txt" with delimiter "\n"7 z2 R; A! ?9 c# b: b+ J9 s
read A_time from "data.txt" with delimiter "\n"
* v& d: p" C/ k$ t3 ^ read A_leave from "data.txt" with delimiter "\n"
( K; M& v6 L/ f$ e) E read A_picks from "data.txt" with delimiter "\n"$ R6 ^2 k9 {4 g5 O/ l9 P
set load type to A_tote
# h7 `$ S* D- _ if A_tote="tote 1" then set A_induct to 1
1 z0 C8 |* J& g2 J else if A_tote="tote 2" then set A_induct to 2 M; y" S- z( R4 S- w3 y6 w6 h
else set A_induct to 3
9 P; M" L: x6 k7 q set A_i to 0
# U' k3 T, ^ P clone 1 load to P_induction7 x t: v# [8 w A0 T1 ~
wait for A_time sec& u, H w/ |+ S! O- F* W8 ?
end3 Z9 P" ]' `8 W: V, J2 x% {
end
' f. |' q1 H* B$ @
, H) _' `7 `9 `4 ]begin P_induction arriving) A( s" w" K# N* ~* O; J
if A_induct=1 then clone 1 load to P_pick1
, K8 w& E2 r* ~3 P4 C2 v# m else if A_induct=2 then clone 1 load to P_pick2: L% D: w7 N! Z: H( r
else clone 1 load to P_pick3
2 `( b+ _( T, v& eend
8 i1 e1 h* @2 R) W0 M, _
" V( D. F5 h6 J+ ^( H# k; }begin P_pick1 arriving2 P" P& N! u" o/ K( Y3 n
set A_i to 1
; W" |7 d2 s( c, q move into Q_induct1
T& ?. C% `( ?0 r j& u: \ move into pickaisle.induct18 t" b- S5 x( K6 N, f) z+ j4 L
while A_i<=30 do begin; u$ S1 e$ ~. Y5 @( _
travel to pickaisle.con(A_i)
0 O' i! S/ l$ c2 f- k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ A! G) n$ L; Y7 e+ l else wait for 10 sec% D+ w+ t9 D& U. x
if A_i=A_leave then send to die
+ X7 T5 Q; Z/ r& T else inc A_i by 1
2 H6 j U v0 }* ?3 e) n ~ end6 @. f0 ~3 ]; J; N
end
. p {0 r L+ T( x5 f) R
P6 S% {/ V1 S& ibegin P_pick2 arriving
% Z' w2 a* z, b" L set A_i to 116 o) D5 c5 P: S1 ]
move into Q_induct2, F+ ?# N0 `' v) n
move into pickaisle.induct2
+ d- W7 V, B! b( a: s while A_i<=30 do begin
+ R; H. F1 B1 v4 }6 q% ^' R! |0 ^8 e, @ travel to pickaisle.con(A_i)
7 d' I6 S* q+ N! _% S: I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 U) u2 c( w% S( p6 u6 @$ Z' ^. c else wait for 10 sec- ?, G0 |! }, f4 b6 z$ a
if A_i=A_leave then send to die! @5 [- m. p' E
else inc A_i by 1
! w7 d$ q* e- Q8 V' |+ X6 x. P end
) N# u2 X! [! Y: kend
' Z; Z& k9 s5 ]; U5 s- b) F" y0 Q/ e% C8 }* w3 h
begin P_pick3 arriving7 ~' n, [0 j! Q4 z C
set A_i to 21
- D3 Q& N" t/ N1 g+ a: a move into Q_induct3
8 u6 Z7 x: b8 n: V; j. v, o0 n move into pickaisle.induct3
o& M% i( O$ E/ z) E9 I! T while A_i<=30 do begin
2 [6 U! A; j6 s% \( \0 J* K travel to pickaisle.con(A_i)$ Q: t0 Y% ~0 w/ X! r a3 h' Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, q+ u ^ _4 p3 r+ ]7 A else wait for 10 sec, J1 t Q& @" V# \5 H$ c+ h$ o+ x
if A_i=A_leave then send to die
* A- n2 |. `- N$ d else inc A_i by 12 E7 G+ Q# U* b
end/ l" B! s, ^1 S' s8 V
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,其它按你的 ...
|