|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ D5 e2 V L D' ]
- p6 y- u% U6 G我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! e1 N( I& H, s. ~) Z- n) N6 I- I. r {3 W
begin P_read arriving' _/ A2 y- |: u
while 1=1 do begin
8 g2 r) o$ Y. y6 F6 S4 R read A_tote from "data.txt" with delimiter "\n"
. E: s* c' I$ w* o) @ read A_time from "data.txt" with delimiter "\n"# |0 S4 j K) ?( i5 r
read A_leave from "data.txt" with delimiter "\n"
0 f" t; h+ H3 r w, [, c1 w. k7 }, X! ?0 u read A_picks from "data.txt" with delimiter "\n"
|1 _, |& o7 w. m: M8 D& t set load type to A_tote
1 b* `/ z* C. m# l T# r I' x/ T if A_tote="tote 1" then set A_induct to 15 u1 [+ _9 i& [
else if A_tote="tote 2" then set A_induct to 22 U' ~+ S$ F6 o( R
else set A_induct to 3 # ~" A# { {) n2 a: |; ~
set A_i to 0
9 i- ~6 ]1 ^1 ]1 D* f* S7 L8 z1 x: } clone 1 load to P_induction. H& f; ?1 h& A' H
wait for A_time sec3 B: U! a+ X/ f5 x. m( H+ V
end, R6 R9 _# ~. q: c+ z, ~" s
end
" r! M0 o2 M% L! X
/ [* j& M& O. y8 F" S1 r' ^begin P_induction arriving2 L7 I2 ^2 {/ E: v8 y/ z5 q
if A_induct=1 then clone 1 load to P_pick1% _/ W5 P Y) h( u/ _
else if A_induct=2 then clone 1 load to P_pick28 `. ~/ ` I \! m
else clone 1 load to P_pick3
* ~; ? q$ w( o( h' [/ Rend
' I! T- t) P( A3 I
" [& t, C8 o f- [9 V* D! S$ cbegin P_pick1 arriving
0 F e* p; e" [+ m set A_i to 1
' ^+ L; o7 y! [" @& K+ v move into Q_induct1
& m/ n3 {* J0 k- |9 _+ t5 i; } move into pickaisle.induct1
- F+ l! _! `* L, ~! z& ^4 c while A_i<=30 do begin( Y0 X' X- o" P+ E
travel to pickaisle.con(A_i)3 C' Y A; o% P: n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ A ]/ m r4 q, t' Q: W# V( A else wait for 10 sec d% M; X9 l; ^* C7 J9 j$ K
if A_i=A_leave then send to die
2 Z) k/ X0 Z$ S7 Z$ z! G7 }3 P else inc A_i by 1! I. B" J j) K$ h v
end
) e8 ~9 i" H( S9 S0 H$ Qend& f& S7 Z e z- g% x+ t4 t* u
3 d0 I7 C5 m/ a. R( T
begin P_pick2 arriving: S" f1 Q+ N5 _) w4 u5 A) ?/ {
set A_i to 11. n4 a+ F$ N! l/ f: e
move into Q_induct23 P" ]; I3 H( w9 |
move into pickaisle.induct2
9 O" H: Y( i: u& P9 ` while A_i<=30 do begin. o S! m; g; Y" r2 V9 S0 S6 i
travel to pickaisle.con(A_i)
; ^4 R* R3 E! G$ N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# C# p2 V \6 M+ Z else wait for 10 sec. J% f% M; r. H. V# f$ u
if A_i=A_leave then send to die5 W+ K2 B: k3 w1 B9 V
else inc A_i by 1
% G( M* E: a. M8 C- c; P4 U- P- M end+ i0 S8 T3 f/ J t0 b5 h* F
end
! Q+ Z: |% V: y' n. j% j1 ~) `" V# @1 M3 ~6 C% _
begin P_pick3 arriving
8 } z5 ~) N6 x; Z' W2 ?. q! ~: v' T set A_i to 21
, p+ ]% b+ E! @3 } move into Q_induct3
9 \; W' e5 }% }( | Z move into pickaisle.induct3
# x5 X& C& w8 G while A_i<=30 do begin$ I% O) t8 q, V8 e8 ?7 x8 v0 i
travel to pickaisle.con(A_i)+ ^8 k1 j4 P2 m( n, l H5 X2 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 U: b g1 w/ i, b
else wait for 10 sec' }) u/ h6 |( u+ ]4 K. F/ _
if A_i=A_leave then send to die& H) H" k' C% z
else inc A_i by 15 q# R% j! o+ M' M- {' P& U
end
) a6 G$ w1 H# G8 q3 W, ?6 lend |
最佳答案
查看完整内容
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,其它按你的 ...
|