|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* s% E9 L1 X% G/ j% m9 I( w6 {- U" Q9 N" m5 {4 \" @" D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ Z; n% K5 |9 ~# U4 W9 E% N+ y% F
begin P_read arriving. O6 b8 Q# e: A0 O# e
while 1=1 do begin
4 u) W4 u2 l. @! E0 [ read A_tote from "data.txt" with delimiter "\n"
$ x* t9 c2 b/ V7 f; [5 O read A_time from "data.txt" with delimiter "\n"
; r: X$ T+ o$ }6 C: ^5 E read A_leave from "data.txt" with delimiter "\n"6 `; x/ y( |' i3 ^4 g! D5 t5 P8 N/ Z( `; @( O
read A_picks from "data.txt" with delimiter "\n"9 P& C" z' w( y$ H) K( w0 G' M
set load type to A_tote
& Z" `( H* z. S3 A) E# C if A_tote="tote 1" then set A_induct to 1
+ W, A3 X2 S3 F, i else if A_tote="tote 2" then set A_induct to 2& k. q* j. K9 y6 c
else set A_induct to 3 , p7 \) [# v4 q, ], g; l6 @7 @6 L9 P
set A_i to 01 v) X$ L9 ]% C9 U! m$ R; N
clone 1 load to P_induction) S3 J0 h! o9 z W8 a& w
wait for A_time sec
+ {$ a" O( k8 m1 a end* [7 j# M/ n) {4 [8 w' y& e
end+ C( z# ~- ^: T9 J
/ i) {6 t; h8 wbegin P_induction arriving. m1 ]/ u$ |. T& ]
if A_induct=1 then clone 1 load to P_pick1
6 ~0 }0 u' p N* R" e1 ~1 s else if A_induct=2 then clone 1 load to P_pick2
8 {. P. h& @; ~8 Q else clone 1 load to P_pick3
: z- B+ b; N5 j: c9 Uend; j! h% \) v% s( W
6 R1 r: `: d- W7 U6 |; fbegin P_pick1 arriving
3 D. y7 \( P: P1 d. P% } set A_i to 1+ t" g: q* S, X2 i: ^
move into Q_induct1
b( h- J! p" W$ a5 R5 g6 X( A move into pickaisle.induct14 u- `2 J, i4 T1 g5 ]* h. r
while A_i<=30 do begin
1 ^+ Z8 D; q/ l travel to pickaisle.con(A_i)
& J9 Q% b' D( z4 ? u9 ]) u- O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 r2 y+ B p1 e% R( l3 w9 b- e+ M
else wait for 10 sec
8 j: Y5 p7 u7 y# B# Y if A_i=A_leave then send to die+ K( _, |) y x% m' q
else inc A_i by 1% Z9 R' v4 j: h* r9 l
end
2 @6 p) X9 z: P7 cend5 G" E+ _) s5 C* z8 Z5 [
2 ~' ~* a6 T+ j# U) ~7 A% K7 U
begin P_pick2 arriving) `/ \" [% ?, R% l! J
set A_i to 112 w6 S: v. m# Q' G0 @3 G
move into Q_induct2
0 X" }. ^ a; V( ^0 Y' ? move into pickaisle.induct2
! p) l% F, z6 P! | while A_i<=30 do begin
! Z' y8 B2 @ l* f9 Z+ ? travel to pickaisle.con(A_i)
: z; B3 Z0 i0 N* y* F7 @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' |3 I. @3 ?5 L; q! @! [9 Y
else wait for 10 sec+ _- D9 e) c& h+ Z' S! u3 V
if A_i=A_leave then send to die
5 @- H" L$ `" V1 j' } o else inc A_i by 1
0 M( h- F+ A$ J end
/ {" n1 C x3 m# l3 P6 M) Mend
( M! n+ V4 X( [' j3 f# ` F7 E5 m2 }% k1 E
begin P_pick3 arriving8 @5 S$ G0 W2 x6 u
set A_i to 21
5 F6 U6 E4 I& B move into Q_induct3+ H2 d/ H% [ G: q0 J
move into pickaisle.induct3
& w; d. I* L3 X while A_i<=30 do begin
, J8 @3 a. _1 P travel to pickaisle.con(A_i)- y! K' k0 k/ A" X! Y0 k5 K, S% H1 s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 W B" _% X; O4 B. X9 T( E. u else wait for 10 sec
7 [( D9 h+ l; r& w3 A if A_i=A_leave then send to die2 b- ^5 E& [- z( c9 Y+ I
else inc A_i by 17 n, f$ A- d& \1 L b
end
/ \$ p5 e7 \! L( X% oend |
最佳答案
查看完整内容
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,其它按你的 ...
|