|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 a. [1 J) L4 _* I* y. \! Q
. J6 {8 X( h' _" Y5 |, f我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 [6 B8 a4 h' e" s/ V% u
- }0 ?) s' S: {% V8 W
begin P_read arriving$ W6 b/ x7 B7 [9 b) k2 O s
while 1=1 do begin- p' L7 U; y; k) S& ]6 W7 l3 k7 }
read A_tote from "data.txt" with delimiter "\n"
" y m! u3 S$ S$ o' z4 O, Y8 ~6 a read A_time from "data.txt" with delimiter "\n"# a& Q( _7 ~) G
read A_leave from "data.txt" with delimiter "\n": o' U7 ~) i6 _; O: x
read A_picks from "data.txt" with delimiter "\n"
+ `( V; j; t; k" D& D& | set load type to A_tote) U# r- c9 B; g8 Z! {
if A_tote="tote 1" then set A_induct to 1$ T) j" H6 x6 S. j7 L7 G6 }! u
else if A_tote="tote 2" then set A_induct to 29 E7 m) \0 q, D( {; H/ E
else set A_induct to 3 ! w, o1 J2 I- @; _
set A_i to 0+ x$ ` d) w: o
clone 1 load to P_induction+ d0 H1 Z" x6 M* W$ J
wait for A_time sec
, x5 c$ V9 x8 v$ |+ j! g end
* V" J" z& i7 T9 Q2 Yend
7 Y ]/ M/ _1 I) J U6 C; H; q. n( S1 ~
begin P_induction arriving
5 k; F/ p8 ^& ]3 ` if A_induct=1 then clone 1 load to P_pick1
5 @4 \( u* J0 y else if A_induct=2 then clone 1 load to P_pick2
" F2 k- T% }; I else clone 1 load to P_pick3
b5 w1 H6 x: y C" X( K7 cend
5 Q/ h/ g# H+ l
# ?" E% F6 C+ V( L+ i1 p1 tbegin P_pick1 arriving
; x3 {: j& L b) I6 K0 E set A_i to 1
1 _6 u T! l& a0 ~( P, S move into Q_induct1
& L' s: j( z6 l move into pickaisle.induct15 @: ]9 k- ~# j0 T# p( E
while A_i<=30 do begin
3 [( z9 M% P' O' h travel to pickaisle.con(A_i)
' @, }! _2 I: c |1 U2 u# L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 S) `0 U. M% n+ ]5 |3 P
else wait for 10 sec
) ^! T) L: L8 O! J" T if A_i=A_leave then send to die
# y1 u& t# J4 q# V else inc A_i by 1
9 s" i5 H, Z+ s; d# Z! q G end4 _3 b- G/ I" p W1 j% ~. L: i
end; e9 Q$ S [8 |, e/ b+ n$ E/ W
0 Z9 V( X7 ~- V, E& Rbegin P_pick2 arriving
0 D/ a7 k2 O7 s set A_i to 11
# c: ?6 n) Z: i6 U0 a move into Q_induct2
2 C* ]1 U4 `2 q1 p5 f: @ move into pickaisle.induct2
* v d% w1 Q4 i& d while A_i<=30 do begin, W. O8 O( V( D9 Q4 l
travel to pickaisle.con(A_i)
5 r' n" U' @$ {1 g& m( r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 a4 c7 @* H+ D8 r- I+ h8 _ |
else wait for 10 sec" H5 E/ `' h; n7 V# x
if A_i=A_leave then send to die8 o+ ~* t- ?; J, I5 A6 J/ H) D
else inc A_i by 1 D: O1 Y3 a4 B: f" {. y
end
2 J: s0 V: N z$ R- l2 hend
6 k) |- J* X- B- e0 p1 s8 e: d/ B2 Q
# `" _! u e) B7 L! qbegin P_pick3 arriving# _8 M; O M& Q
set A_i to 21; O3 l/ l3 U5 X% h
move into Q_induct3
6 N7 c" G; s2 A% _. ]; y% r move into pickaisle.induct3. N& X' A& P1 b$ q
while A_i<=30 do begin" s7 |' ~: y1 n# T
travel to pickaisle.con(A_i)
2 f1 V% B/ Y5 D% t' [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% ^2 `4 M% {/ U# X1 r [ else wait for 10 sec1 J: c! }* H3 g8 f, j$ L( T
if A_i=A_leave then send to die+ ~$ S; ^6 X* K) V
else inc A_i by 1. B5 G9 a) h! R; G
end- J, C- y- _! Z! M2 ^+ D
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,其它按你的 ...
|