|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ c. F" O$ q8 w/ F9 h" ]
" }0 f/ Q$ t7 I9 ^8 O- F
我的问题是,在每个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中的数值,不知道会不会有什么不妥。 J/ S) I( X7 m
/ c- O# t: |5 D5 S x( R5 s1 V5 {begin P_read arriving6 u2 y! ^) j6 m
while 1=1 do begin
, Z: [# C8 V/ B read A_tote from "data.txt" with delimiter "\n"
# [! _% w$ L0 w! u% J5 D$ ^ read A_time from "data.txt" with delimiter "\n"1 o8 U1 z6 }3 }/ H8 @
read A_leave from "data.txt" with delimiter "\n"7 k( r" h1 E1 I& @
read A_picks from "data.txt" with delimiter "\n": G% l4 Y0 j- N: L/ }
set load type to A_tote# O8 ~: y4 t3 z. W: X# ^' \
if A_tote="tote 1" then set A_induct to 1
# m! r; q; F% q+ F else if A_tote="tote 2" then set A_induct to 24 k0 I& b$ o* q- ~( ~
else set A_induct to 3
+ c) v: M6 m. s5 z set A_i to 0
% p( ~* Q2 l& E2 n4 C9 N4 u clone 1 load to P_induction7 C" [, e% t M# s- G z
wait for A_time sec3 `% Q! V+ b$ v' G: J' m; m
end; a+ p8 {, H1 Y7 E ~5 @( H9 U0 O
end
R6 g+ V; [5 s; m# N; d$ n/ v3 b9 _' l8 C2 w0 u i1 B
begin P_induction arriving
' [/ J7 n+ q E( S% V if A_induct=1 then clone 1 load to P_pick1
9 ?: K% w' h2 J6 t6 K else if A_induct=2 then clone 1 load to P_pick2
* L) `; X. P; a: b4 @ else clone 1 load to P_pick3
; t# g z; ?+ H* t$ F) i6 F1 jend- c5 B" s/ d. B. F; m |3 ~9 o
# {/ W! ?' q& Y1 E5 V2 Z
begin P_pick1 arriving
# X/ ]; ^8 L6 c- a8 |8 D set A_i to 1
: o, W! Q" c& I/ F move into Q_induct1% s" J% |& w G
move into pickaisle.induct1
, x% @1 e% m; a while A_i<=30 do begin
& K+ j! ~7 m( Y. l; i& Z* i% P# Y8 P travel to pickaisle.con(A_i)6 S _& X7 j( M7 k: ]4 P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: t) F. N$ v! m6 r8 F4 M else wait for 10 sec
6 c1 `' k ?, s8 ~; e. g if A_i=A_leave then send to die- u( s( X q! o ]. z2 U6 b6 A
else inc A_i by 1# t0 |0 ]5 w9 g* x
end
: J8 y6 b$ U# ]9 s" Fend' E. Z, q. u" V
9 ]( }0 `) O% a% J6 @$ ~( j
begin P_pick2 arriving
: I S% C6 e& K/ S+ L set A_i to 114 b# J8 |7 p' H* ^
move into Q_induct2
0 I0 \; a6 S' J# e( \& O move into pickaisle.induct26 m: Y3 O: y6 o2 t( e
while A_i<=30 do begin
& m, I* C. f7 e) p* g- ? travel to pickaisle.con(A_i)5 |+ e% q) C0 D+ I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: h! ~5 C( O% g+ }5 ?) x
else wait for 10 sec
R; a4 q: g+ O7 f- H; s, h/ U& u if A_i=A_leave then send to die1 Z( W) j, ~! P5 T
else inc A_i by 1
) [# w+ Z9 @9 v) k end
/ J, i3 r* A9 _) T/ `end+ D" B# ^! G, H/ t2 d& Z
6 o3 ?4 I# i. d# q: W. Tbegin P_pick3 arriving
" h* k+ Z( u$ o0 P set A_i to 21
/ v$ u* ^, y' Q& Z; R' r) S2 G move into Q_induct3
( {2 V) ^8 Y8 x6 ] move into pickaisle.induct3
. s% s* G4 X, x+ z9 K while A_i<=30 do begin
9 t8 _$ d, C0 K4 g+ g travel to pickaisle.con(A_i)
8 _% X+ P4 m+ ]. J4 N9 t+ L) T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 G9 ^& k# Q. j8 e# \; ] else wait for 10 sec7 R$ R. }9 m& E2 r
if A_i=A_leave then send to die
$ s6 `" a/ ~: n& l* \ else inc A_i by 1
( ~- t6 v, m: @+ G S/ p9 T end
$ e# E0 C' n4 ~4 V0 nend |
最佳答案
查看完整内容
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,其它按你的 ...
|