|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. ^0 i$ H" e* w3 \( m' A2 q0 `* A4 o8 X/ R `, i
我的问题是,在每个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 i: R, a7 A& _: M6 b1 r4 h
0 h# M2 j7 O. w; T1 Abegin P_read arriving
/ _/ b' b, _6 Y0 M while 1=1 do begin' K9 L$ z' |0 X+ z; G/ y
read A_tote from "data.txt" with delimiter "\n"! x- D; h0 x( x
read A_time from "data.txt" with delimiter "\n"! b" x; p. x) O$ K; O* y, J B
read A_leave from "data.txt" with delimiter "\n"
9 o4 e- Z# D: F) T read A_picks from "data.txt" with delimiter "\n"
. e( C. _9 r: K* p$ B set load type to A_tote
+ M0 W% N. A( ~ w5 L if A_tote="tote 1" then set A_induct to 1
' M3 a, |" H$ w; F3 F" O! t/ J+ Q else if A_tote="tote 2" then set A_induct to 2
m- _ U, m# C4 G! l2 z0 k else set A_induct to 3 ' g& ]: x0 I1 W4 U. V* e+ J
set A_i to 05 \' ^, d) h4 P6 L: e
clone 1 load to P_induction
$ c+ u/ }/ I5 V: k- g% D( ` wait for A_time sec- K# u" q P) @' b; c
end
9 `! t9 B# C' s) p: o( ?end
$ N9 S) l3 C8 t3 S3 P* e' d; m# o) H ?
begin P_induction arriving
9 l) m! d, g; d$ a# U if A_induct=1 then clone 1 load to P_pick1
4 [' n$ u+ w M$ g# W* Y, I$ ]0 ^ else if A_induct=2 then clone 1 load to P_pick2, F! c+ t: ?+ _' t2 f) K0 `
else clone 1 load to P_pick3. G5 v1 T% s: b/ p: t
end
- H y; i: r6 V/ |; U* b: B2 ~: \3 z, T
begin P_pick1 arriving
( n1 e! P) V( H! R set A_i to 18 C7 R7 h0 V8 e+ n$ b
move into Q_induct1
2 i* y8 e) a& l B. s# P- c1 y move into pickaisle.induct14 f$ b# V! J' N* P$ b3 _- @. B' {
while A_i<=30 do begin
\ { d. W; @) w7 v1 c5 t travel to pickaisle.con(A_i)$ n$ s7 P4 l4 j, `4 @4 c7 \0 {
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, F" c/ t8 p U/ F' l else wait for 10 sec
! O: z2 F0 f* t/ o if A_i=A_leave then send to die
& J) B$ _% Y& J# u else inc A_i by 1
4 Q- R3 Q3 E% j. A/ } end
! n& f( k0 ?* Vend& d) ^4 o" b- E
" U. P' x$ @7 c1 s# u8 ?' A
begin P_pick2 arriving5 R% X- A9 X0 d6 V+ ^( W
set A_i to 11
/ ^( {3 f l2 s" U move into Q_induct2
& Y( Y. ?- ^7 q% o) Y# b move into pickaisle.induct2
, n; p6 Y7 t+ H. D0 P- d while A_i<=30 do begin3 f0 f! N3 G% s; Z
travel to pickaisle.con(A_i)
5 `9 ?5 W- J. c& }$ s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, d* T. b) a G# ]& v9 i" q: t
else wait for 10 sec4 D# O$ j: S# j3 L4 ?+ k. D, m
if A_i=A_leave then send to die' k/ s8 t0 y0 A$ m& H {' o) M
else inc A_i by 1
9 h$ l7 r3 H. J' q2 Q/ ]5 b% d end
+ G0 [9 Z) k0 O( }$ ~( Wend# r5 O; H7 v, D( v* n# M
0 E9 K% Q; M8 i6 I$ l' m; N, A
begin P_pick3 arriving/ T' Y& ^7 o: N1 e# |7 G
set A_i to 21
6 r: S+ A) A& z; S" a! Q move into Q_induct3
/ v- t% I, J: z- |* d k9 L: k move into pickaisle.induct3. K4 H& y2 j& B, c' j
while A_i<=30 do begin
( `1 D/ [2 \) O! r travel to pickaisle.con(A_i)
1 I0 T4 B: k) T9 O5 [0 s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ @$ D- {# C+ J, O else wait for 10 sec: s! J0 C$ U1 I" N R- U
if A_i=A_leave then send to die3 B- q! A* G9 p& J$ P% w: |, O
else inc A_i by 1
/ d2 n9 q1 G+ [ end
, j: a6 T3 u% Y) _( Z1 s% F7 J4 Y9 {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,其它按你的 ...
|