|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ^& F0 w1 Y- J* W U$ ]% ], P) f6 @- ]6 }9 q/ F* t/ P: b+ {7 s- k+ v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。; n! \5 r/ j! z5 T6 M$ W1 i
4 [+ R9 d C1 v2 Dbegin P_read arriving
6 \3 }. N; t# O5 L* T while 1=1 do begin
2 `9 z% H/ c# D3 G% ] read A_tote from "data.txt" with delimiter "\n"
- w U9 f$ n; j6 S. _ read A_time from "data.txt" with delimiter "\n"
5 g2 A! C, T: S read A_leave from "data.txt" with delimiter "\n"! W2 T! o' l( @$ U# U3 @
read A_picks from "data.txt" with delimiter "\n"
# k- ^# a- |- g7 A. _# w1 e set load type to A_tote2 H9 h% Q# l% ]4 E- J
if A_tote="tote 1" then set A_induct to 1
4 `- n* f7 }' o, ~" x4 X1 `+ t else if A_tote="tote 2" then set A_induct to 25 d/ G* e2 {0 z& t$ v
else set A_induct to 3
/ x+ I* Q- C7 S9 C* `% _! O set A_i to 03 c2 x4 s' b0 l/ \9 [
clone 1 load to P_induction
: v) T/ y! w1 I* X' i0 [' [: C wait for A_time sec
* _" }; A9 _" U( K; |- F end
9 m" g! k6 v- u% v1 bend
, D" y+ w- |. x) m; Q2 c) X1 c: j6 B/ l1 n/ s1 p7 n- O
begin P_induction arriving0 I$ Z @% D# X t! t& ^
if A_induct=1 then clone 1 load to P_pick1: L3 U+ \. h+ }" X# |
else if A_induct=2 then clone 1 load to P_pick2% c+ S) ]# [2 I& ?5 I+ S4 J
else clone 1 load to P_pick3
2 b$ ~: k( x% v% t7 f$ F) Pend7 ^" i2 s* E7 n, a( j& k5 @$ _
. h& L/ ]1 E; x& F$ V# K/ Fbegin P_pick1 arriving. o; R2 b( ^( V7 S! p5 u1 z; N
set A_i to 1
U4 A- O1 H8 c5 a+ ^& S. S" e move into Q_induct1" {, d. d$ C. o! [, L
move into pickaisle.induct1
0 [, H! r* M- z& F' {' G' W. K while A_i<=30 do begin
& R3 e, ~3 R7 T) @6 n* f. ~% N: L. \ travel to pickaisle.con(A_i); a+ X E1 z, g* ~( v& a; O0 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# l3 @1 X6 `' ^; k else wait for 10 sec
: v3 b l* r% t8 Z if A_i=A_leave then send to die) C% M7 b5 d; ?) h/ h0 N0 v
else inc A_i by 1* \6 l- Y& b. L& }# D
end
1 P6 ?4 I3 X, E8 F! wend
2 ~/ q, s3 I1 s! l7 I0 l6 r- |; T' i- L% g: J
begin P_pick2 arriving W/ L8 [ Z: \9 r" }0 D- S- ~$ p
set A_i to 11
) d9 D1 B3 I" Z( W! Y& i5 a move into Q_induct2
1 B8 c& d7 N3 n1 |6 g move into pickaisle.induct2
# r4 ]" B! V) ^0 A$ ^2 C- r# ^, O while A_i<=30 do begin/ W7 f! ^$ i' J, H( U* j4 b
travel to pickaisle.con(A_i)
1 M5 d# T7 t& c1 ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. }6 F+ i0 S; Z& A- N5 A) Q1 S6 Q6 Y else wait for 10 sec/ H' ~( x. S: {+ s- M$ ?6 g) Y
if A_i=A_leave then send to die
1 f" r- T( }( [3 z0 p8 j1 i else inc A_i by 1* [" c$ S" m: j/ s0 a9 R; ~: N* x! v
end
- J5 Z$ e( X+ x2 uend7 }% x2 N9 e" C y1 ~6 I
* c2 w9 [! D' \/ I
begin P_pick3 arriving" ]/ _( R3 w. X8 m9 n
set A_i to 215 I9 @) D& ^3 ~4 {0 J
move into Q_induct3
$ J5 _/ f. d, l: h; f% D) N" W move into pickaisle.induct3
5 d! a! v/ o0 u! q2 l- m while A_i<=30 do begin
$ x/ W$ p3 R: X1 ]: {( t3 \2 L- q travel to pickaisle.con(A_i)* Q& m W( S, [0 y2 A, N' |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 c1 i: Y: ?0 p# y e) M6 L else wait for 10 sec0 _1 P& i0 Q" h0 o8 v6 j" o
if A_i=A_leave then send to die I1 Q* r5 |/ Y2 E/ w! Q7 Q& ?
else inc A_i by 1- X. r& l7 B! t/ c1 b
end
# v2 @2 b# v( |1 w _6 k! fend |
最佳答案
查看完整内容
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,其它按你的 ...
|