|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 s; H2 w, M: G& ]; ]+ c6 t8 S" J0 p: B" U" [9 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
. B8 t0 c5 Q9 C. s1 B4 u$ m" `5 l: q( f
begin P_read arriving$ m) R1 m5 |& |$ ^& |& u* }. `
while 1=1 do begin3 D( d" a) y3 c
read A_tote from "data.txt" with delimiter "\n"4 Y9 B9 n' A; i
read A_time from "data.txt" with delimiter "\n"/ p* l/ b6 k3 V/ ~3 g/ u, ~4 I
read A_leave from "data.txt" with delimiter "\n"
3 y; f' ~: T: u! n7 q& E read A_picks from "data.txt" with delimiter "\n"8 R% d& l) z7 B1 q6 u8 ]4 B
set load type to A_tote
' r9 ~) n2 S9 V! B+ ~1 r if A_tote="tote 1" then set A_induct to 1
( g1 I9 i3 s3 W4 j3 P8 E else if A_tote="tote 2" then set A_induct to 2 f* |: Q6 _0 E" \- S+ }8 S
else set A_induct to 3 7 P2 E1 J9 z' R7 k% Q& r
set A_i to 0; G) U( A: a+ K c/ E% i% ~
clone 1 load to P_induction
2 u) ` w N) s& W {) h wait for A_time sec
" G% N* e5 y T end1 v5 K3 @% a4 [
end
. O* Q" R" N. b& [9 `% [) _/ J* y; \# ^
begin P_induction arriving
7 J3 B' W6 ?& E1 t( s. d% n if A_induct=1 then clone 1 load to P_pick1- g- c; @! J" R7 e$ ~$ E+ h: l
else if A_induct=2 then clone 1 load to P_pick2
1 @" E6 S# o4 K else clone 1 load to P_pick3+ w" O2 a7 Q% R- m
end
; O) L( W3 y+ q# N8 X
) Y4 v8 W8 D, k0 R( {begin P_pick1 arriving
& W0 e6 m: L |- V( ~/ @" O set A_i to 1
% t2 l" }& y- A move into Q_induct16 T" O/ ?7 O4 l. Q7 d1 H
move into pickaisle.induct1& q8 R+ h; a [2 w# h- |. F
while A_i<=30 do begin
0 y0 z5 f% v5 s3 e' P travel to pickaisle.con(A_i)0 n8 r6 a% P) p9 @+ b( a7 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 `7 [5 R2 v5 w! |' k+ R' q else wait for 10 sec' t) N$ \+ B6 b w
if A_i=A_leave then send to die
" O6 r' G5 x: T. T6 V else inc A_i by 18 T' I+ x( Q: d& f6 |. B5 a
end
. ]/ ]- w6 ~/ Bend
1 a$ t4 q/ C4 v% p. F1 C4 B$ o; J) L5 s1 Z9 o9 Q7 E" ^* r
begin P_pick2 arriving
! U" V& q0 x1 _; |2 Q+ ~ set A_i to 11/ Q* Y$ q: i/ t& n; o) N
move into Q_induct2
+ D$ T$ l2 t' O move into pickaisle.induct2$ c5 y5 W5 k4 {( ]. G) ]
while A_i<=30 do begin$ N9 }8 {! G$ Z. S0 x5 j
travel to pickaisle.con(A_i)0 ?! c# A* U6 L" _: Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 r7 s- z5 c4 M5 q" i else wait for 10 sec4 J4 I! M% v7 i" d6 ?2 A* {
if A_i=A_leave then send to die
1 x! N3 q5 k% s. S$ ?9 e else inc A_i by 11 `6 P4 V, {* c" a9 J( p
end
& A, C5 Z3 I: q; m: m n$ Rend; a) u4 w# z6 v
: C& x/ c4 r7 ebegin P_pick3 arriving" c# w2 R0 g9 j7 f
set A_i to 21. a, X: |0 z) p- Y* D3 r2 R( T
move into Q_induct3
: p7 v7 F' p+ J- P move into pickaisle.induct3
. k3 ] I4 u5 d# a while A_i<=30 do begin
% t# Y& s" I4 t% T2 |5 j travel to pickaisle.con(A_i)0 R2 B" Y0 W' z1 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 {! Y* m: {( G: |4 h
else wait for 10 sec
, W. ~' W6 J+ E( |/ f if A_i=A_leave then send to die: D. H% o/ v! p9 O
else inc A_i by 1
4 ]+ c, U9 C$ W5 @/ d5 O& v1 A end
4 k: V9 ^( l) L Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|