|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' p X0 U' w# z9 |
" v/ N% e. @. p3 _& o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。& g4 c, ~2 c4 V# A
9 k4 ]3 ^! P) r" F7 o6 R
begin P_read arriving9 R+ ]0 s: ]- {, }
while 1=1 do begin; u% }7 r$ q( v) F
read A_tote from "data.txt" with delimiter "\n", j3 z, C# e" f2 _* w4 K, O
read A_time from "data.txt" with delimiter "\n"" E( H& e& x; n& M$ f
read A_leave from "data.txt" with delimiter "\n"; Q6 @9 h1 t3 ^* U$ R
read A_picks from "data.txt" with delimiter "\n"
: b6 I( }, o% o6 N. {3 ~- A# l# j. ~3 n set load type to A_tote
/ i0 g, l2 M# ~ ^* Y2 K; ?, y" a if A_tote="tote 1" then set A_induct to 1
1 N4 U: O; A |: [4 P else if A_tote="tote 2" then set A_induct to 2/ D* S, v8 N4 T3 s) l6 r4 t2 g
else set A_induct to 3 5 l& v% k: |) j, k% p, k
set A_i to 0! k! l6 l- v2 H) n
clone 1 load to P_induction) t3 X6 Q) P) b! V/ }5 e
wait for A_time sec" ]. |8 Z, J7 Y6 K- H. p, u
end
3 t- ~8 V& d! E' Hend
1 R" i. S k6 r& v
: j. y9 _2 N2 @begin P_induction arriving
; y7 |6 P* T: c5 [ if A_induct=1 then clone 1 load to P_pick1( e' {$ V1 b3 A8 o* b
else if A_induct=2 then clone 1 load to P_pick2$ k5 Y. ]1 o- G* K
else clone 1 load to P_pick30 J. c/ V9 V5 m A
end
0 c7 P. i7 K3 B! V1 Y* S* B, k. o4 r
begin P_pick1 arriving
! _" _2 O8 ~4 E1 B+ ^ set A_i to 1
! w8 p; x+ A9 [ move into Q_induct15 ^ K2 I! w" b; g) a4 s
move into pickaisle.induct1
4 I" z2 t, V% Y1 @/ \ while A_i<=30 do begin
1 {2 \; |; l9 q travel to pickaisle.con(A_i)
4 ^; x) @ t' g- c. } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# J8 d" r1 y H. [
else wait for 10 sec
9 W7 y& k: c2 Q6 Q; {% U3 ]" I; x! Q b if A_i=A_leave then send to die" m$ |5 F) T& i1 P; |, i
else inc A_i by 1
1 |1 F3 w7 |$ m) V) I) o: m5 n end/ R- C1 n6 F6 b) w
end6 O. ~( [/ d6 D: `1 v6 D7 C
. q8 [ q# s" C, Y4 w9 x/ xbegin P_pick2 arriving
$ j% b5 w/ i1 h% f. w- P set A_i to 11- M* I- R" m5 {
move into Q_induct2
9 W: A! j$ M6 |, p0 B9 [" _ move into pickaisle.induct2$ g- }: F) {. m$ e" G0 I
while A_i<=30 do begin
- T+ ]1 Z9 d1 F7 i, f travel to pickaisle.con(A_i), v q+ _/ |8 ?9 g/ U. J0 z! L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- I2 j4 T4 _0 Q( ^& _9 S/ J# p else wait for 10 sec! c; Z: t- W% c( Y# T
if A_i=A_leave then send to die7 D( ?* K X9 s
else inc A_i by 1; _" q4 g' g$ y' _
end& m V% n* S3 X
end
1 J: j, H3 u% L( C3 x( }( e
Q! J6 K4 \; Hbegin P_pick3 arriving8 k' T' M |8 z) L
set A_i to 21
. D/ V. M. A& [. N* ^1 N4 ] move into Q_induct3
" P& _7 E+ J: Q. \1 j) O+ k move into pickaisle.induct3& a$ f! y; [! d! [- N
while A_i<=30 do begin
$ b) z( }# {% @3 t( _ travel to pickaisle.con(A_i)% Z- q! n4 E( P, Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 q a& T0 p: }4 V3 `! U1 X else wait for 10 sec
; ?3 `6 C& s3 C, o if A_i=A_leave then send to die/ i4 `5 Z$ }7 }6 s t7 _
else inc A_i by 1
9 |( W6 E- U8 J, U A$ D$ h) X end' f0 p1 J3 f( p5 K7 s& p9 J
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,其它按你的 ...
|