|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 G* E6 l& O! x
) O. D% }( g: q8 O+ V- q, t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( R" G, f* y+ m9 w/ Q7 h2 b0 B6 n! n- _# H: v2 \. V2 S% h8 h% `
begin P_read arriving0 u9 J6 a! ]9 M8 Y8 Y; v
while 1=1 do begin
* @2 I0 D! _- \ read A_tote from "data.txt" with delimiter "\n"1 Y! ]" z& }; Z' P
read A_time from "data.txt" with delimiter "\n"% A: X7 H' F' S( n; R0 W7 Q3 @
read A_leave from "data.txt" with delimiter "\n"
X9 i; K4 W( `# g2 Q read A_picks from "data.txt" with delimiter "\n"( M8 d8 }' l# u) k4 {
set load type to A_tote5 {) @, ~) b- ~% i
if A_tote="tote 1" then set A_induct to 1% N! Z G1 ]2 B! y" z
else if A_tote="tote 2" then set A_induct to 2
$ ^5 \; g1 ^+ u. \ else set A_induct to 3
& j: _3 C' F0 x0 |/ e set A_i to 0
) U7 H9 T" w( c/ L3 R& v clone 1 load to P_induction7 c m$ w; q* B- E' s
wait for A_time sec2 ?2 p7 y9 K3 @ w0 j+ r. B
end9 c P% S3 F% B$ `
end3 j# Y3 {6 L$ i4 W' c
& |- [# r' k5 ~* e; ~; a! o9 {6 K
begin P_induction arriving
; @6 D, Z6 r: u9 y if A_induct=1 then clone 1 load to P_pick1
0 b& k& S+ G/ V0 r else if A_induct=2 then clone 1 load to P_pick2
- U% x! K( S/ F3 F. m6 l% o6 v, f else clone 1 load to P_pick36 i. _& D) ^, j4 o& B+ I3 d
end
* k- J4 s2 u- ^$ _7 c6 w% m
4 [9 }( E3 s- Qbegin P_pick1 arriving2 j" u+ Q7 F. k7 h+ y
set A_i to 1
1 J7 N% R* t! v; n move into Q_induct14 k, m6 { {/ w' l2 x
move into pickaisle.induct1
- K% f/ i- O5 c while A_i<=30 do begin0 V) F) B+ i% c1 H
travel to pickaisle.con(A_i)
& E8 U) _* F* x6 \5 m! b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. V: [3 f' B9 J5 I/ A- m
else wait for 10 sec
( Q1 m' Y) E A7 J# A3 } if A_i=A_leave then send to die. h9 V5 n% V0 G$ w3 R
else inc A_i by 1
$ p& k" D$ r, D" E5 `8 ]9 T end" K$ U6 R2 v# J- z" | W
end
, R1 F9 s! x/ K1 l" n% ~, u4 P# k
begin P_pick2 arriving
+ m* H+ C) Z5 s' O& P/ s* r2 ]: q set A_i to 11
, W% F D$ d. u1 q8 z, G- Y, p move into Q_induct2/ q9 p3 b( ? ]) K# ]
move into pickaisle.induct2! U5 p$ I* d1 G5 `) L# j2 z
while A_i<=30 do begin5 ~2 Y9 u" J, R: ~$ o( r8 L
travel to pickaisle.con(A_i)0 p+ @6 a8 i/ D' z) e8 x) ^" U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( p$ r- A. x# b& p else wait for 10 sec8 R" y6 H5 D$ ~3 u# V1 C8 f
if A_i=A_leave then send to die
: u/ B+ T) x4 G! M0 p+ H, F else inc A_i by 1
( W( c) H, N* H7 u) |4 k% x end% U8 t9 m( U+ V+ s. x" L
end: [+ t! _, \- _3 M
' @) v$ z; V$ |! sbegin P_pick3 arriving
) p8 k, |, O5 M$ K0 R @% A set A_i to 211 L4 L: m! {, I
move into Q_induct3
2 y: ~# x$ t2 |" }; v move into pickaisle.induct3; Y6 `; S C: H
while A_i<=30 do begin
G/ | v# R6 {4 e6 b travel to pickaisle.con(A_i)
0 H$ d4 C5 M4 M, V N& {1 f2 O if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% M4 D; ?0 D. {
else wait for 10 sec
8 z9 ?. D- v, n/ R: |5 ^* q. f if A_i=A_leave then send to die7 Y# o* k9 U2 y' R
else inc A_i by 1% Y+ N G+ A( X' ^, i! x
end
' K7 v$ l' y" ?8 \0 q, Rend |
最佳答案
查看完整内容
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,其它按你的 ...
|