|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢8 v8 A3 C% `& b- b
2 a' @+ C- ]8 d# l- Y% x我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 u0 v3 R! E+ h* S
% l9 H" r( ^" q+ G* V0 Z
begin P_read arriving$ a- m. l) U7 G- p! L# q- F8 g
while 1=1 do begin8 p I5 K$ K; n3 d; V" T4 M
read A_tote from "data.txt" with delimiter "\n"
, K2 k( Z# h; d read A_time from "data.txt" with delimiter "\n"
1 j8 R9 |6 B) Q- ?( [0 j/ W read A_leave from "data.txt" with delimiter "\n"" W6 G9 p) {+ @" _3 q" {
read A_picks from "data.txt" with delimiter "\n"
( h% R! A4 Y, g& g0 M set load type to A_tote
) x! H* @9 j0 q3 ? if A_tote="tote 1" then set A_induct to 1' N2 ]* O9 e1 Y2 U) u
else if A_tote="tote 2" then set A_induct to 2% h8 L2 y, ~$ `: f
else set A_induct to 3 9 Z y: F" N f, q/ @
set A_i to 0" s- l' E( `- |& `* x! } H1 X
clone 1 load to P_induction
: ^0 G4 _" m" X wait for A_time sec9 t: \! f7 \* y/ C
end
( _1 ^5 N0 E, C& Kend6 v7 Q5 J7 ^# b% | P7 P3 D8 _
3 A- h6 ~- `, C7 B4 ?
begin P_induction arriving
5 J" k1 I U) r! t if A_induct=1 then clone 1 load to P_pick1
) K. H& P: `$ W8 Z else if A_induct=2 then clone 1 load to P_pick2
U+ X" W& t7 C8 R9 ] B else clone 1 load to P_pick3
! v, q% O& K6 g$ nend4 K3 K3 }4 N$ |
) [; D6 Y* v O D1 S
begin P_pick1 arriving
5 }4 ?* \; T6 T8 E9 N set A_i to 12 N, @9 E" E; O. g: p, g
move into Q_induct1
" |* K2 o: m# b! `- P% ^9 Q move into pickaisle.induct1
% [2 W" O' P! A# Q9 m while A_i<=30 do begin
' ]4 k7 A0 H; Z9 ?8 g travel to pickaisle.con(A_i)
/ K. v3 _6 p; N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 Y1 k1 K) K1 {
else wait for 10 sec3 H! m& c3 w+ ?' u* S% J0 w s& L
if A_i=A_leave then send to die$ U: [) }8 W4 h' J/ Y( j
else inc A_i by 1/ @6 S% N9 G9 l% X7 c1 A% @+ Q G
end4 i3 h: _ G8 A: v* v
end
8 z8 R& z8 M% m* r H; p3 |; Q4 i, j# F* m/ F
begin P_pick2 arriving
/ {- G* d `) [+ A) u set A_i to 11* P1 Z5 U; Y: t1 Y' ~6 i
move into Q_induct26 C4 d a( [2 t
move into pickaisle.induct2
/ D! z7 C) j; f# G& Q while A_i<=30 do begin
1 Q7 D! Y, e3 }7 j travel to pickaisle.con(A_i)* _4 W& ?# ~- I2 l+ E( M2 k, p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& S( Q9 }" G4 L6 q/ F
else wait for 10 sec7 j$ X" }' O: ?9 [3 C7 P: w* \
if A_i=A_leave then send to die
9 S6 X: L3 @; G( b else inc A_i by 18 {& r3 }9 D0 o, `1 j* p
end/ Y8 d4 N0 U, o8 l# j: l
end; x( {# a" Q( Q# X
; M; `1 [ ^. g6 X' g
begin P_pick3 arriving
3 |+ O- P4 V$ N' r8 f+ l1 { set A_i to 21
) b& I' |# k2 i: t8 [ move into Q_induct3
: C; Q- l" t' A" z+ P ?! c move into pickaisle.induct3
8 \) Y7 z. H2 b$ ]& ]( J/ z while A_i<=30 do begin
7 v1 d) D5 ]: E3 V, ] travel to pickaisle.con(A_i) l; L4 p! I( V+ D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 r, s% k4 S% ?- Y' S+ \
else wait for 10 sec
0 ~5 o, G C$ q( y3 r/ o if A_i=A_leave then send to die. h0 t$ d) E8 z$ r2 } F/ F" V: Q) n
else inc A_i by 1 Q3 E! W' _/ D4 M1 W( m' Y
end. I; `- m5 a- {3 `. X, R! C1 c
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,其它按你的 ...
|