|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& B$ v8 e, }6 G9 Y
$ {; R3 p6 X5 ?* e3 `
我的问题是,在每个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 v1 \5 I: L1 O- C2 R
- Q' A# K' i2 a ~6 ^9 Z7 Wbegin P_read arriving7 }2 G# [$ V( h+ {
while 1=1 do begin
0 }4 D4 s& [7 d7 l4 X, i+ c& J read A_tote from "data.txt" with delimiter "\n". v1 s, L( ?7 [ T' U5 a
read A_time from "data.txt" with delimiter "\n"
* E- y5 H) P* r1 c read A_leave from "data.txt" with delimiter "\n"
& C1 v$ c& m: M4 c+ X8 X1 V1 R read A_picks from "data.txt" with delimiter "\n"/ w4 [" r" b2 H
set load type to A_tote9 T: L( c5 @3 d) B6 V/ g" C
if A_tote="tote 1" then set A_induct to 1. H9 e6 g; Y- ^+ {
else if A_tote="tote 2" then set A_induct to 2% t$ n! M; o( t6 Q4 \/ ]. [
else set A_induct to 3
% n3 H, |- [$ V& B7 U7 Y) u set A_i to 0
' U0 R' Y- w: B: q clone 1 load to P_induction
) {5 Q) J1 N/ z$ C& | wait for A_time sec
, ]9 h7 y' g0 M/ e end8 P2 {2 d7 P0 ~1 ]$ I! V
end* \1 Y+ H* O6 e
' S# p" C7 o( s+ Ebegin P_induction arriving
5 s3 O; Y" L2 F5 H& W( o. T if A_induct=1 then clone 1 load to P_pick1& _& k7 J) [+ X5 I" q6 @0 [
else if A_induct=2 then clone 1 load to P_pick2
; s: r4 C! L, g% S0 r6 k" F. \( K7 U else clone 1 load to P_pick3
& a; h' Z* g: {4 h$ l+ rend
4 X" s- E ]: t. Y" g1 Y, o' W# Z. d
begin P_pick1 arriving. v& |: F- M& K6 K# B
set A_i to 1
+ l* b' R, z; U+ n' o move into Q_induct1
% Q5 L( i/ E( h+ b' c move into pickaisle.induct1
A2 g$ ~) T* ~2 P while A_i<=30 do begin
# U9 Y; H1 a, Y* \, q# D" c) N travel to pickaisle.con(A_i)4 B; W7 H( ^4 P3 H+ r, d* I% n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y- X! C* d. ?# D1 M else wait for 10 sec
9 p! S9 E7 [" p( G if A_i=A_leave then send to die% G1 w4 H) B( \2 b: w
else inc A_i by 16 z: ]3 j1 ~0 L) q/ n# i2 p; a
end/ Z, O; D% H4 t! T$ ]
end# n7 Y: s' A4 e; h9 p% Q
+ k# j5 R! v9 M" M) E# J
begin P_pick2 arriving
8 u; S4 [9 m1 D8 P% {3 ~! X set A_i to 11
! g/ w8 t( ^8 c move into Q_induct2$ U( ~1 L V+ n0 s2 C0 `# r
move into pickaisle.induct2
9 c1 z9 \( P, r) P while A_i<=30 do begin( d) m$ D' ~* p$ M. O% w& Y* V" E
travel to pickaisle.con(A_i)
4 } |: c2 V6 q3 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 U* F$ o9 T/ O: g0 s6 { else wait for 10 sec
3 ?4 G6 z- B( [6 V$ ?' w if A_i=A_leave then send to die, j# \9 H3 O+ Z# q. E
else inc A_i by 1" ~# p' m" R3 Y2 D
end
{! l+ D9 x9 l$ bend
" ^. C( r* O* }/ ^
7 m% K# ` J0 h& ~2 C7 bbegin P_pick3 arriving, S: E6 [6 N! ~# P& ]$ H
set A_i to 216 R4 y# ^. O3 a" a
move into Q_induct3
S5 f7 S1 {" }9 I! U move into pickaisle.induct32 n7 b1 ^- s6 Y( ]9 ?/ ^( w' ]
while A_i<=30 do begin
: `7 G5 Y* N; ^( Y travel to pickaisle.con(A_i)
3 @- K# i( x* I y% B) s( C6 E# J/ w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `/ w- w6 s/ ?0 U) ]* J& {9 `
else wait for 10 sec
. @; _. k4 h2 n+ e; h if A_i=A_leave then send to die( d2 ?6 I! U _6 a/ s% c
else inc A_i by 1! p1 U4 b7 f$ ^4 c+ @" z* x2 Q
end
* y8 y5 j9 w" b" p# H0 T( aend |
最佳答案
查看完整内容
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,其它按你的 ...
|