|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 i/ @( c# b- F2 k7 W8 k0 i
# Q- L9 }1 u7 E! a/ N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" V2 g1 H0 f9 w; Y
4 w' Y1 N) Y1 c8 i: p* Fbegin P_read arriving
1 A- V% G( ^. m' `; q: p while 1=1 do begin
# R3 L" p. l" k, B; ? read A_tote from "data.txt" with delimiter "\n"7 c0 f* C8 z- k% b8 x$ t
read A_time from "data.txt" with delimiter "\n"
, \8 X4 O# M, D: r& ^ F. n4 ? read A_leave from "data.txt" with delimiter "\n"
9 O9 {' Y0 y4 M( C1 i" E" T read A_picks from "data.txt" with delimiter "\n"
1 X4 K" ]1 D! A3 F# x set load type to A_tote
: d; y: q% B" }" B5 f `3 d% H if A_tote="tote 1" then set A_induct to 14 C. y, H( V2 ]+ P/ z& K& i
else if A_tote="tote 2" then set A_induct to 22 e9 y* g; q+ V/ A: B
else set A_induct to 3
& d% w6 G9 f7 p( F set A_i to 0
- Y5 j% T$ K+ q( u3 F2 x4 j) F& }3 Z clone 1 load to P_induction
( U/ e! n: l! A4 W1 y) ^ wait for A_time sec
7 f+ q! D) `# ^! x5 x% V! w" ~. u end
+ `1 m2 o( ^9 @5 Gend9 J n' V& k6 k v1 U! B7 W
" Y4 S, ], H& k+ i1 r
begin P_induction arriving8 K9 E7 v2 ]* U, M# _
if A_induct=1 then clone 1 load to P_pick1
/ z& d* \( K3 d0 z7 z else if A_induct=2 then clone 1 load to P_pick2
* s+ T0 ?8 L5 y) | else clone 1 load to P_pick3
7 C+ f v- f! L% f( tend, s& L `0 }. {2 w2 N5 a
( A$ q( r: _# }- _0 Kbegin P_pick1 arriving' o6 [ a0 w/ z9 r7 L
set A_i to 1
1 W+ Y5 f5 `& i W o: ?! e& v move into Q_induct1 V, z8 x' b: b. p5 U$ H
move into pickaisle.induct1; k& T$ S5 M% u8 o; }
while A_i<=30 do begin
0 l# N* i r9 V travel to pickaisle.con(A_i)
8 B8 B# R* M) W4 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" F8 L; ]- [( w; b, O else wait for 10 sec+ X! m5 b( m! {& E Q
if A_i=A_leave then send to die
}5 V4 w! ~( t- g' ]( h else inc A_i by 18 q, K- |$ i8 i$ M# u
end, e- A& ?3 m4 _# X) |: K" m) z
end
: |3 g# K- }0 D% U
! ~' b0 R2 u" @ r& v% W* ~begin P_pick2 arriving1 j! D9 V2 R' O5 m. r( X5 F1 }
set A_i to 11$ L4 { }& g. L; h( m
move into Q_induct2
5 c( u# `* E! G9 A move into pickaisle.induct2
4 R8 K! c4 }, n. ]& x while A_i<=30 do begin9 n0 { B) [& C$ M, ^
travel to pickaisle.con(A_i)* Y' [1 o$ j% r& |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. v! H! Q3 m4 w) F else wait for 10 sec
7 E- e0 X/ b4 t' ?) |0 N if A_i=A_leave then send to die Y2 ^0 o1 t* H% O& t; f' L
else inc A_i by 1+ g+ L) i {5 B% u, T
end; Y7 }8 n R+ k
end9 F1 X. x8 m& p( i- S
6 r0 h& j2 u3 A: `
begin P_pick3 arriving
) r6 x* i! X* x set A_i to 21
$ I M! y1 N' D# e% E; S move into Q_induct3# n7 [9 L( J3 \' c" r) C- |
move into pickaisle.induct3
" Y' o$ } _& T5 T$ v& b2 S/ S while A_i<=30 do begin( ^* M3 U6 a9 x+ E8 |
travel to pickaisle.con(A_i)
' o+ }1 ^6 z4 L1 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# g2 Q% m6 j J& X, ] x& ^
else wait for 10 sec: I1 _0 j. j* N5 b# ~/ H
if A_i=A_leave then send to die9 F! ]- k& m. ^# ^" @+ g3 n, M
else inc A_i by 1
# D2 h8 P `# ^0 g( b" }$ N( G end
{! B% D' N! `0 }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,其它按你的 ...
|