|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. h- k0 R, s& x' h( t
0 Q2 n( }5 F" Z0 i3 i" S/ _ V我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ x: [/ h" g% j# p& Z
$ }* H* `- }- b) |0 c- W3 U
begin P_read arriving
& H5 O( [$ p" S1 w$ S3 u) o) N while 1=1 do begin
M9 E% Z! l n0 c- z read A_tote from "data.txt" with delimiter "\n"0 n$ [8 L1 Y8 Z0 M/ o4 \& K
read A_time from "data.txt" with delimiter "\n"- ^2 c. J1 Z1 k" Y* I
read A_leave from "data.txt" with delimiter "\n"
}: `8 `! Z3 K4 q* r! Y read A_picks from "data.txt" with delimiter "\n"- F- P; N8 [# B0 ]
set load type to A_tote
: B' {; H( |* ~/ z( Z if A_tote="tote 1" then set A_induct to 1$ }9 e4 K( H" M: w3 |# N! e
else if A_tote="tote 2" then set A_induct to 2
- {/ D5 e" J V9 P5 e8 W else set A_induct to 3
8 C7 s# F, Z& f% }# u; R9 o5 E0 s set A_i to 0
+ E6 l9 e$ p* D$ u- n6 A& N clone 1 load to P_induction
! q+ I+ _" }" l) N; i' Q' t wait for A_time sec
. X' _, A- _# I7 U end
8 T1 G( X" {- e5 k+ q% iend
: P" S1 p+ X6 S8 i$ G
0 J8 e* d% x* p8 A6 a# M4 C0 nbegin P_induction arriving) m7 I7 g2 k, S
if A_induct=1 then clone 1 load to P_pick1
% v8 m( f) `* r; _! k6 Y- n else if A_induct=2 then clone 1 load to P_pick23 C9 \6 _) V9 L5 `
else clone 1 load to P_pick3, M3 q- e5 ^/ ^: G# e. k
end S7 f: K, |5 X1 {+ P
- S) P8 D: L( I3 F$ S; ~begin P_pick1 arriving
" M a t8 S! |; a: N set A_i to 1
9 d Q# P" |. P move into Q_induct1/ H" \6 o( r" y) g& }4 e
move into pickaisle.induct1
. p2 h( D+ T8 z/ ~ while A_i<=30 do begin
K% z3 w" C5 L$ j1 q* b8 i travel to pickaisle.con(A_i)
- g7 v" f1 |0 m# v7 t! t; U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 g) p$ L+ W# S( s1 K$ v( g
else wait for 10 sec I7 l+ i: H+ L0 c% {. R, ^. S) u m
if A_i=A_leave then send to die5 V) _& Y3 u* A: @' w4 V3 m
else inc A_i by 1
' ^5 L: }1 w" K+ H% a end! N0 E% Z2 o. h0 `% X/ E
end# z" L4 B# [. b" l8 L
s! i, j' m0 C8 ?9 n% k& Tbegin P_pick2 arriving
# v. h5 f' w8 J" ]5 E( }2 p set A_i to 11
& M- [" T& h8 b' c: C; }! }4 y move into Q_induct23 Y3 P+ [8 _7 F5 N2 R
move into pickaisle.induct2
, p* B- i' g8 i2 D' l while A_i<=30 do begin
9 `8 F- o9 ?6 z+ M' Y travel to pickaisle.con(A_i)
3 s3 T( N: H! T4 |3 e/ }0 A9 d% j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 z0 ?& ?3 {0 i( ~" [; k4 X* |
else wait for 10 sec5 E( {; f1 i9 |7 z
if A_i=A_leave then send to die2 n+ }+ z. U ~ q; t0 t3 v6 }
else inc A_i by 1
4 G' ]/ z! |( u. e. t/ l6 J/ A end
/ Y1 ~7 C$ ^8 G" [ h8 f3 |$ pend: h2 [; _' A5 q
3 q: _1 y/ K' B7 Nbegin P_pick3 arriving @; k, D8 x! t2 @4 n9 u
set A_i to 21, _% L5 M7 ~* f: w
move into Q_induct3
. I( H* I9 X4 [7 R- R5 N1 F move into pickaisle.induct3
. c, m1 A( B P4 k. U while A_i<=30 do begin9 q* y+ L& B ^! N2 }
travel to pickaisle.con(A_i)7 I. C* v9 I$ ~7 z) U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! D& [- G5 N+ M; O, c. y; S% }8 _ else wait for 10 sec2 ~" B# z0 \& l! l
if A_i=A_leave then send to die
2 [7 S$ x2 D8 j3 l1 ?& G else inc A_i by 1% F0 E$ W" F/ D
end# B6 w# ?" u4 U7 o$ g9 j( ]5 w$ |
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,其它按你的 ...
|