|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
8 S: @- c+ a) \! M% j* A y1 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。0 W; G/ A: s: F0 s4 x/ f
8 E' ?" {) _. c. ], Z# j) e2 nbegin P_read arriving
6 N4 i8 o% P3 ^; V) \ while 1=1 do begin1 M9 v$ |6 s$ {1 [. D
read A_tote from "data.txt" with delimiter "\n"
' p2 c* g9 n/ M- D read A_time from "data.txt" with delimiter "\n"
; C% m) v. Z7 m1 n, F! l5 O read A_leave from "data.txt" with delimiter "\n"$ h- q0 a6 k! T& S7 F0 R
read A_picks from "data.txt" with delimiter "\n"# [6 F8 z& t4 _2 }. U" _
set load type to A_tote
7 t9 L' ]2 }" ?, ` if A_tote="tote 1" then set A_induct to 1
# o+ Z |2 ?9 J/ v' l3 l else if A_tote="tote 2" then set A_induct to 2
0 R: Y% M _! i% w! W/ R else set A_induct to 3
; u: ?. I2 j, C. z, v t" e7 b set A_i to 0
2 K1 J! c( k- O( M) p4 q& t clone 1 load to P_induction
, ?1 y) d# J5 M, f& w" b2 f6 j wait for A_time sec' w. b {& Q. ~$ @6 ?* n2 X' U
end) ]. j2 j2 ?0 Z8 N0 ^
end
; j% ]: b3 c+ u8 v2 @
& e( a0 u7 T4 q9 Z1 c) Fbegin P_induction arriving
7 ]9 `# ?4 g4 D9 y' M if A_induct=1 then clone 1 load to P_pick1: _7 ]/ X4 a5 d8 f
else if A_induct=2 then clone 1 load to P_pick28 e; o1 z% }! h" G! S3 h7 y
else clone 1 load to P_pick3
& u! U1 f! C- i9 a* e: E5 vend
5 V4 Y I" J: R% t# K1 Q" m/ t* b) B- p: b. I
begin P_pick1 arriving
/ d, C/ K- ~+ a: a, P set A_i to 1* U4 T0 `6 h$ ^7 ~8 Y( A' D. s! ~8 |
move into Q_induct1
! c, h+ G- W+ n5 u move into pickaisle.induct1
& t L& w& I( @) y# f while A_i<=30 do begin5 ~+ }+ c" f: O3 `! c
travel to pickaisle.con(A_i)1 ?9 e7 s( K7 Q! R6 j( v4 B5 N! v U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 F0 q; [; X$ G' O0 h/ A! k+ K
else wait for 10 sec
! S, P9 M% O) P& t4 t$ \+ G& W if A_i=A_leave then send to die
6 M2 w. h3 d* a: } else inc A_i by 1. K( {- {% L$ w, j0 o1 q; V# H
end; E3 s+ u3 k2 w# j6 s Q
end2 D2 V* ` H2 c1 C0 E: n# u
# S# A" @0 U/ j" b# {/ Sbegin P_pick2 arriving1 d6 a0 E8 L4 q$ n0 ^9 ]
set A_i to 11
' N7 K5 j1 g4 h2 R! K move into Q_induct2* Z! y# g6 U2 J" N) _
move into pickaisle.induct2& y# W, F8 q ]' P* { V% s
while A_i<=30 do begin: R6 d- j0 D# U- l3 n
travel to pickaisle.con(A_i)# I) U& h, O: W9 W+ X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 C/ |2 A9 O1 B t" Y) [9 G* M
else wait for 10 sec
; [+ l& h- E. e$ Q/ E& }+ z if A_i=A_leave then send to die
, N" e/ I$ d- h# T5 h' d% k else inc A_i by 1
' `1 c8 ?$ @' C: u6 f end% Z( u2 y5 k4 K) t' U$ i
end
" n3 W! K- V. n- j
6 l% l U$ R+ c; g# z5 p; _- n. e3 Ebegin P_pick3 arriving
0 | e: ^% E% r! D/ m set A_i to 21
, H9 S: P+ V6 ]! Z) u move into Q_induct3
0 f$ B9 f% q2 u# T move into pickaisle.induct37 L- c, o* i+ v% ]4 |- c: t
while A_i<=30 do begin
) d+ }& I( w t K travel to pickaisle.con(A_i)
0 w, m+ g' R! `$ k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 u( w9 I+ g' H$ @1 @
else wait for 10 sec- R1 M- L6 | Q* v2 f. [
if A_i=A_leave then send to die: @% U% g- P/ K8 |
else inc A_i by 1' N, I$ }: H# P( s
end
; c3 H9 o. D" H9 U! n8 q/ }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,其它按你的 ...
|