|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 u6 B& O& ^* D/ o: _* i$ v
; S2 L9 b" n; l0 n3 p我的问题是,在每个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中的数值,不知道会不会有什么不妥。% x1 @$ G; y- @; N6 C. M
" N6 V5 I `, W& ?begin P_read arriving
. h3 w' I6 l# ~+ F, j' K R) { while 1=1 do begin
- m1 d+ ~ P' N% d$ V read A_tote from "data.txt" with delimiter "\n"( \+ _# E# P4 R0 }* o
read A_time from "data.txt" with delimiter "\n"+ N; r% ?9 j" l! Y) y
read A_leave from "data.txt" with delimiter "\n"/ _: T# R2 h% {7 F7 z5 W
read A_picks from "data.txt" with delimiter "\n"4 L" x7 Y; B% w9 q9 M9 D% _
set load type to A_tote+ V" k" f, m) @+ p! o3 E3 e2 S
if A_tote="tote 1" then set A_induct to 1* L* ^, O% m3 i+ L
else if A_tote="tote 2" then set A_induct to 2
: i1 a& t) C. t- y else set A_induct to 3 3 b7 B9 i4 c0 l5 {2 N. U9 s
set A_i to 0& T! G+ V! ?/ x3 [
clone 1 load to P_induction0 X, A- Z1 r% A1 x% t* ^& r
wait for A_time sec
/ |0 K% o: H; D( O F9 c end; f0 M" _* l0 r8 B( K
end
) M# q: _( b* l9 Z# t0 m% D3 x) S+ G l
begin P_induction arriving
+ t: f; L5 ]9 C$ P) m4 e0 r if A_induct=1 then clone 1 load to P_pick1, I' Z$ m$ H* `. N3 L: g
else if A_induct=2 then clone 1 load to P_pick2' J v( k/ Z1 T- J
else clone 1 load to P_pick30 D) o3 {8 D+ s+ Q" h
end9 W6 i, ]0 T4 j( P R" |
9 Y2 n7 h, B9 e% P$ S! n: D) bbegin P_pick1 arriving
2 M$ G6 |, ^1 \+ ~- l! a, w set A_i to 1! Z% M2 p+ x. s# O7 G
move into Q_induct1
9 _$ u/ C8 `% } move into pickaisle.induct1% r* c m% J( V3 ?( V
while A_i<=30 do begin9 ` ]( M+ M! H C/ N
travel to pickaisle.con(A_i)' C) [9 I" t; k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& c" e. v6 B5 ~) y
else wait for 10 sec
2 {: Q" r! K6 O+ ^" T1 f if A_i=A_leave then send to die
* c+ U4 o3 @/ D; S0 d7 n) c else inc A_i by 1
t3 G; S1 F' a' E end
& H* m% _. V! T0 D/ eend
8 N% @1 B0 }. S7 F u, {* w# \2 k9 l4 n3 e
begin P_pick2 arriving
& Q7 E- r. S6 v r set A_i to 11
% p5 z7 H9 D! R0 a6 ? move into Q_induct2
) _% o' G3 s( d move into pickaisle.induct2
! a5 d" f# K1 }8 M& k while A_i<=30 do begin
* n5 W6 r4 M, k3 a% _; L o travel to pickaisle.con(A_i)
. S/ y) ]& T) n: ~3 G- i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. f. k+ e/ A, d- v else wait for 10 sec! N }4 S1 [" i7 Z
if A_i=A_leave then send to die
; v+ X8 {) U5 |% w. \, [ else inc A_i by 1
- L, Y) i5 y1 f2 k! G3 ?$ @ end! a+ W* q! Y6 {! R, {$ T+ T
end. @: l: U+ K8 i }
# H. ?$ D& f9 H9 ubegin P_pick3 arriving
( e- S/ ^* k6 d) ]+ j, Y4 x4 J9 E$ T3 } set A_i to 21
( I& w: Q" b! W" I move into Q_induct39 N3 O( S8 r$ z
move into pickaisle.induct3
1 x4 q7 j3 U7 y4 } while A_i<=30 do begin
: L. [$ l1 s1 U# S* ~ travel to pickaisle.con(A_i)# ^' B# Y/ U; Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; g: K$ Q1 K: R& x else wait for 10 sec
G2 z" R4 Y7 b: D: n0 a. ` if A_i=A_leave then send to die2 `% Q1 X/ i1 T7 T
else inc A_i by 1
! S$ V- Y M ?3 ]3 U" Z. B( f; v end
" b( \: I0 r1 C' t7 j5 p9 Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|