|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 I( l8 l$ j6 \" k' l2 k
) ?6 J" B( i0 H
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 B7 J+ ~4 V5 X+ Q
3 S0 q( g3 A( M7 x3 R0 Y1 ~
begin P_read arriving$ J: B' R. }* W8 ?& ^2 |6 i
while 1=1 do begin
) i5 q% p/ b6 y$ z1 n read A_tote from "data.txt" with delimiter "\n"
3 A( w; N* L. s- k read A_time from "data.txt" with delimiter "\n"3 i4 J1 f+ D3 W8 L( m- T
read A_leave from "data.txt" with delimiter "\n"
' m$ }- z! n$ Y$ f read A_picks from "data.txt" with delimiter "\n"
* m+ t1 S! c* ^- L! } set load type to A_tote
# W/ u1 ~# {/ G+ n! R: C if A_tote="tote 1" then set A_induct to 1
5 Q0 m) D/ o% S else if A_tote="tote 2" then set A_induct to 2
( Z, x" @/ j8 h else set A_induct to 3 Z! I6 w3 e: w# _) h$ e
set A_i to 0" F( Y4 f& H; H
clone 1 load to P_induction
& u/ W3 O/ Z: O wait for A_time sec6 V- \/ d! W2 b9 n. `5 B( Y a
end
% s2 P2 @1 y. W/ Q! Eend
: _1 S" x2 j! z# ?5 @& r! [
+ v& F) k" _" Cbegin P_induction arriving9 U) f1 [; A/ g4 h4 _' T( P
if A_induct=1 then clone 1 load to P_pick1- L! E. Y$ K* ~3 ]/ y3 A X* n
else if A_induct=2 then clone 1 load to P_pick20 Z' Q& I3 Q, @* _" ~, D; a
else clone 1 load to P_pick3
2 _0 q; t5 }" l" nend& @& b! R6 _) J( K
. T7 e1 G# T7 D d' e4 e2 i& k) ?begin P_pick1 arriving
! \% K. X- t. v set A_i to 1, N" e! V1 G. y/ }- { z
move into Q_induct1
4 A% B' d4 c: Q( B' V3 T0 f move into pickaisle.induct11 y7 }/ k5 ` R' T( M
while A_i<=30 do begin0 _4 i$ N1 M0 ^6 {
travel to pickaisle.con(A_i)
2 A2 R @: ~$ k" W7 a0 Q9 K6 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 `( [3 o9 T, D9 f else wait for 10 sec
# u. s+ g/ x: G! h- ?' o if A_i=A_leave then send to die
7 V, S* R) v: I0 H" x" L else inc A_i by 1
9 _$ P( e) ~8 D6 |/ F( y end
5 Q0 l' a, a( e8 v- K0 Jend
' [$ Y7 e# _; \) S# D' u0 k0 c3 v6 e. U8 B) e
begin P_pick2 arriving
2 n4 b6 X4 `& b set A_i to 11% W/ |; F# L; u) s
move into Q_induct2; d9 W- _% p2 @7 C8 N3 E3 o& V$ B
move into pickaisle.induct2/ j" F; O8 m4 A7 e" B- Y7 b
while A_i<=30 do begin; o i- Q3 c. Y
travel to pickaisle.con(A_i)
7 n; {' X! t* Y% \$ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, I$ |* D4 c$ R else wait for 10 sec2 r0 n2 W5 O! Z( u
if A_i=A_leave then send to die8 a) w. C1 j! T7 D2 U# d) M
else inc A_i by 1, ?% S y9 }6 e$ j* }8 ~5 Y3 N
end
U, a \2 u0 Z/ ^end
* G! o& u9 u9 f# R! }* N. T
! t( Q! L* @3 x3 hbegin P_pick3 arriving0 e9 _) h' F p1 c5 u' N* B
set A_i to 21' m! ^1 {7 F" y9 C2 H4 M6 R) _; q5 o
move into Q_induct3
. v+ S3 P; H8 i g' u# r move into pickaisle.induct3
M) k0 z# i* S$ |, h while A_i<=30 do begin
* d& ^, K2 D0 i3 r travel to pickaisle.con(A_i)9 G, r0 ?' y ~! Q) q" b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) k6 d8 S- d3 H2 F) m9 O8 f
else wait for 10 sec
0 U |" M/ Z" o6 C/ t W) v if A_i=A_leave then send to die
; s2 H+ ? g, { else inc A_i by 1
1 h! J0 Q5 {# p end
4 G5 c8 F3 B7 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,其它按你的 ...
|