|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. {5 _9 n/ o8 ?+ z5 e2 D! ~* F2 ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" _6 n% h) k0 @) r
4 ^5 q6 S' Q! _begin P_read arriving n+ a# ~% z3 ]& @ w! u% u
while 1=1 do begin
! U" l% O. m5 R+ R* h' ?5 g, ` read A_tote from "data.txt" with delimiter "\n"
- u! s- Z/ k! Y/ U/ t* a read A_time from "data.txt" with delimiter "\n"
) F2 ]. w6 h% `) |! i5 \8 S read A_leave from "data.txt" with delimiter "\n"* a" A* {1 Q$ \+ d/ T( t/ @8 j
read A_picks from "data.txt" with delimiter "\n"
: F1 T% ~8 y, R% a9 F# Q set load type to A_tote1 a% e- g) d$ \4 \1 q! V
if A_tote="tote 1" then set A_induct to 13 D4 H4 l. {- \$ |
else if A_tote="tote 2" then set A_induct to 2: v# ~ v3 w. @7 J) Z; Q
else set A_induct to 3 * w3 [: \3 ]* `
set A_i to 0
* @ w! |0 w+ ^- O clone 1 load to P_induction
; s8 ]9 d5 Y' z; J" M3 Z9 m' d+ M. E. X wait for A_time sec
! ~' W3 e; c0 r$ [0 d end
" n# z- \9 X. b! b- L- j( Y8 cend
1 Q2 E0 h* Q( z7 q F& \+ I2 I- ~' o9 A3 W2 ^9 q
begin P_induction arriving
7 I8 l( _- t0 a$ A4 H0 @( W& @ if A_induct=1 then clone 1 load to P_pick1
; z' s1 P t* X, U6 x) r' D else if A_induct=2 then clone 1 load to P_pick2- P0 J2 t7 |# W- K
else clone 1 load to P_pick3( d1 m% Y E/ }* J! G
end
6 M( ` U ]/ u' c" {) @7 ~/ O' b: e! b5 w3 y
begin P_pick1 arriving' f& y1 p9 D/ u3 [2 d0 B3 ]
set A_i to 15 t* j& o, ~" a' g4 s
move into Q_induct1
5 j9 \. q9 K" @ move into pickaisle.induct1
8 r7 a+ K- B2 T( { while A_i<=30 do begin
& x+ x6 p& L J travel to pickaisle.con(A_i)
( r5 {3 _$ S6 V: R! ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; P5 M" P/ R* A4 G1 z else wait for 10 sec% ^, {+ T) o8 q/ L; Z" e/ n
if A_i=A_leave then send to die
- l( \7 b) C; g: i% Y8 Y% p; T$ Y else inc A_i by 1
3 w4 O2 ^+ Q5 _/ M end
5 Z! o- ^8 f' ]: I! m; o) Uend
5 w- ]4 W, z7 ~% K9 y7 M/ p
! \; d. W9 D4 X9 @begin P_pick2 arriving
( ?3 z" p: B4 a set A_i to 112 A! G0 V0 W! m8 m+ H
move into Q_induct2. M1 P( `9 c) `) L' j E
move into pickaisle.induct2
4 ?" b; M- \8 w4 b, \1 c; v while A_i<=30 do begin1 m9 d8 F |! b, n3 R p
travel to pickaisle.con(A_i); J z. K# c& j' b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 i; Y% L0 D! H2 e else wait for 10 sec! F" I/ a% R& ~8 m- z
if A_i=A_leave then send to die- t) G* |; X3 T, |( [2 G
else inc A_i by 1; I4 x! q: Q* I# g& I
end3 a* h7 O7 F* E, Q0 R8 `
end
9 y; @ c3 B5 _/ A6 R7 [5 R2 R- P8 Q4 A9 h# s7 Y( e+ l
begin P_pick3 arriving: w9 h; H3 o% e* m7 T
set A_i to 21
3 w1 l, w2 ?& @: o0 b& O: g! }( E move into Q_induct3. \- l. e+ q4 w
move into pickaisle.induct3
& K4 o) a2 \" m while A_i<=30 do begin7 r2 T0 X: i7 y0 d* G ~
travel to pickaisle.con(A_i)
" O, H# A- m* U/ ^& q4 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! R: c c4 S s' _/ @& G" ` else wait for 10 sec9 n" z3 N( v. b/ z
if A_i=A_leave then send to die
8 A8 D% S3 k* }5 ^* _, } else inc A_i by 1
5 x1 E3 G* ]% _& o end! ^ v: e- @3 N+ j9 l
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,其它按你的 ...
|