|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& F) I6 |9 `+ x/ i7 Y
+ N; J/ N7 e2 W5 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中的数值,不知道会不会有什么不妥。
5 A: @* _% n: ~ }
8 S4 @) k& L( o9 w3 P: c( Wbegin P_read arriving% d) B% \1 y x" X
while 1=1 do begin; M" b( p9 `1 C; w5 P5 N% f8 b
read A_tote from "data.txt" with delimiter "\n"
; t# Z3 r3 h9 p+ F' v read A_time from "data.txt" with delimiter "\n"2 s+ S5 s4 f: n! C
read A_leave from "data.txt" with delimiter "\n"' R4 d) \# \" H7 j
read A_picks from "data.txt" with delimiter "\n"
7 {+ m ~- w2 W7 P- b set load type to A_tote/ f/ C9 X( l' l
if A_tote="tote 1" then set A_induct to 1
# u; P7 N( W, [6 h( A1 `: C( ? else if A_tote="tote 2" then set A_induct to 20 j7 W$ B( K7 W* w7 x' |5 V! y$ Y, x
else set A_induct to 3 ( u# a( d( v: {/ ]
set A_i to 0
6 j: f# K4 T# c clone 1 load to P_induction
$ q# h' Z6 I/ R# ^: E" [- G' W wait for A_time sec7 l. o, Y3 ~8 \2 u2 F
end
4 D. U; c, {, I4 y6 qend
) a* X v7 c! e
# @5 Z. ^7 N1 fbegin P_induction arriving' I) ~) y% n, Y1 e X
if A_induct=1 then clone 1 load to P_pick1
' S/ R v+ p2 E: G- d; e else if A_induct=2 then clone 1 load to P_pick2
1 [ J& ?/ v- p' { else clone 1 load to P_pick35 _! l t" e# [7 F7 ^* o0 q$ [; d
end' `8 T3 @ a, p* G% }3 B" y- F$ x
0 s! t- u% Y1 W/ C
begin P_pick1 arriving
+ x+ I/ y' ]( r/ } set A_i to 1
. g3 {& @+ v9 @! P3 T move into Q_induct1
u2 x# V' \6 V6 P7 Q, ~ move into pickaisle.induct10 E. e3 F+ g# L1 O9 B) A- T
while A_i<=30 do begin
. H* _4 |. [6 h5 ?! \7 z; x travel to pickaisle.con(A_i)
. q( L1 a; p' T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% \2 @/ a0 A8 y) U8 V' K A else wait for 10 sec: z. p3 o6 z& S5 @3 \ c5 p* v l
if A_i=A_leave then send to die
! O9 S: R; @7 H8 ]7 U else inc A_i by 13 J9 Y1 ]# v1 w5 f1 Z
end
2 h6 k9 u& b3 W5 i; tend5 J8 f1 N& h8 S6 G. ? D5 D
% O; t! G7 u) y2 C
begin P_pick2 arriving% U8 d+ {" F6 B: k
set A_i to 119 u% _- Y8 ^8 w: T" b( o5 x( I2 B+ Z* C
move into Q_induct2, t2 Z% l4 g3 P
move into pickaisle.induct2
$ O3 v v! s/ w) [! z8 r. v: u while A_i<=30 do begin
2 E& Y, i* [0 ?4 A2 C/ [7 U3 @ travel to pickaisle.con(A_i)! x P# d: a4 Q8 d- Y7 K* `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# j7 D" ?* m5 W+ a% n* _* ~; \
else wait for 10 sec2 T( s# n& C4 J! _5 `
if A_i=A_leave then send to die
7 k2 Y: x4 q6 q* P0 y, Q$ e$ G9 z else inc A_i by 1
5 {# z: ?0 t$ \: b% }& H end9 H9 j9 D/ d2 m0 x' D+ T
end
4 ~+ T0 `2 w3 {% N/ _/ d
; N: Y3 l5 J. ~- N, Wbegin P_pick3 arriving/ B6 D4 U- h1 {1 q8 K
set A_i to 21
4 F1 a N# q% m move into Q_induct35 T! j h0 N5 Z# G( { A, a$ ~
move into pickaisle.induct3
! K8 F8 e0 v" N5 t. ] while A_i<=30 do begin
" n- q |; ^: h9 R9 ?. L8 d travel to pickaisle.con(A_i)
0 S# V E' \. z0 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& g4 ~% i: n5 r2 }4 J. w m. K else wait for 10 sec
, ?. p7 j& t/ C+ i8 v. P if A_i=A_leave then send to die
\ x+ U1 q5 A0 v# l1 }7 z, u else inc A_i by 1
! P3 ~) {+ x$ [) A end; i1 s+ E; M9 a/ }% X5 N
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,其它按你的 ...
|