|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 e% S4 h. n% E& s2 K
) d. l8 X7 m! }2 h, u我的问题是,在每个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中的数值,不知道会不会有什么不妥。* @1 `( U+ f2 `- [& V0 {
* S0 P- F2 m* `8 zbegin P_read arriving
; F, e) E& }4 f5 }5 X7 z while 1=1 do begin5 J' l* @6 z. ?' e
read A_tote from "data.txt" with delimiter "\n"
6 O+ f4 R4 J( F2 p7 b | read A_time from "data.txt" with delimiter "\n"; Q( `" b1 r9 g/ ~# I0 K
read A_leave from "data.txt" with delimiter "\n"
5 M, r: A( C! B9 s o6 E read A_picks from "data.txt" with delimiter "\n"2 k1 i D) W) d- M" S5 r8 O
set load type to A_tote* u# m; m6 J; |. G3 S. t5 _2 a
if A_tote="tote 1" then set A_induct to 1
?- \ D {+ ]7 \, R% P, b. ?! |$ D else if A_tote="tote 2" then set A_induct to 2 x; I1 n( s; C7 ]: {
else set A_induct to 3
. d A; a7 }2 t% ? set A_i to 0% ]! E. L- V" I9 g* t; b
clone 1 load to P_induction
6 h( d g3 n* Z wait for A_time sec" F% J2 I9 J/ a5 B
end$ U, M% n% U6 M1 w
end
7 @$ _. K( o3 s0 R3 x. ~
, T, b5 h) }% C5 {- v8 i' Dbegin P_induction arriving! Y& A0 k9 K! S5 G& x$ y
if A_induct=1 then clone 1 load to P_pick1
2 G5 q" u6 f5 ] else if A_induct=2 then clone 1 load to P_pick2
& u8 }0 j& J' C5 i% r% x. f; u( S else clone 1 load to P_pick37 h& E2 X- J2 Q* J$ w( h
end
- I$ u# C4 |5 v" h
( {- X9 W: U7 G1 v2 {- wbegin P_pick1 arriving! _9 H. s0 @% F+ ~9 o8 l" v7 Y) h
set A_i to 1 J4 i: O" }; L! B; T
move into Q_induct1+ L! \# {) L; J1 p
move into pickaisle.induct11 E9 q: R+ `$ l1 |- o* `
while A_i<=30 do begin6 Y$ t) o0 D' _- W6 m
travel to pickaisle.con(A_i)% x2 ]3 N& G* m& G7 z1 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 U9 T) ^7 R) b5 ] else wait for 10 sec0 N7 T: `0 S% ^" Y
if A_i=A_leave then send to die
' S! ?$ I8 A" A else inc A_i by 1
3 T2 C3 M+ X) c4 r0 j end. g6 M/ V, X$ @
end
. n" a% l- i2 J5 ~ n, V
5 f5 b6 _& O9 O9 zbegin P_pick2 arriving i$ P* `% l- l; [* N H1 e/ o
set A_i to 11; g+ l# r' l3 s7 T; H
move into Q_induct21 S3 j% T4 s) ^5 j4 `- b( f
move into pickaisle.induct20 E& u2 O% }' G
while A_i<=30 do begin
' |3 G! m z, U: m I* m# k8 p travel to pickaisle.con(A_i)
5 x% M( B+ c; `- N) s; _ { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 P- Z0 g8 u2 M5 i& [, H) U
else wait for 10 sec
1 d: ~, [& R/ y& G4 X0 I% p! ` if A_i=A_leave then send to die
% N' f6 {! e& Q7 V/ P' A+ k else inc A_i by 1
( ]" O7 a" G! _2 n, }/ z2 ^# e end
% T) X) S8 }, ~' J/ }) jend* A u' v2 b. v, Z
& |2 H% I6 s. U8 h, b; Z$ h
begin P_pick3 arriving
9 \5 c. o! S7 {8 F- y set A_i to 21
; H; _7 x8 b- b0 x9 D( K move into Q_induct3
# d7 ^6 P' t' q) T$ g9 d, l move into pickaisle.induct3; V9 @* `# s9 J2 I6 [' J1 i
while A_i<=30 do begin; _% Z5 K1 i! u. Q1 {% a
travel to pickaisle.con(A_i)
7 A& k, Q3 Q% O! o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 g/ ]) }' g0 {9 Q5 Q
else wait for 10 sec
+ p y+ R* f3 v if A_i=A_leave then send to die' E$ k* v4 K& K0 O+ N% X
else inc A_i by 1
) n3 t8 M5 ^8 x3 V9 J# d% J end
3 P! A" g* `# ^) yend |
最佳答案
查看完整内容
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,其它按你的 ...
|