|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( F1 M4 C+ s+ t/ r
- L3 I4 ?: x! J8 B6 i& u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 ^% a! U6 Z1 @% |; e9 ?( L& N/ |
( P. t! z J1 M3 xbegin P_read arriving
: T1 t9 J& J+ l) e7 c- _( F( M while 1=1 do begin1 ~1 R+ U& z* D% |1 c# l U
read A_tote from "data.txt" with delimiter "\n"! w* ]! U$ S/ H) H- B$ n4 |6 g, f& s
read A_time from "data.txt" with delimiter "\n"
4 h6 G" K$ Y+ ?+ j+ p* l+ \ read A_leave from "data.txt" with delimiter "\n"
' O# B5 r8 v) P' I& L% R5 [ read A_picks from "data.txt" with delimiter "\n"
% X$ o3 c5 C2 Z! N set load type to A_tote& i7 R: r5 r; v9 [; A0 d
if A_tote="tote 1" then set A_induct to 1
E: c+ v0 e! }, u/ r else if A_tote="tote 2" then set A_induct to 26 W! }* K6 o- P$ L! p
else set A_induct to 3 8 V2 }" R7 z- p8 ], x9 e% ]2 g
set A_i to 0& [/ J9 ?" q6 \ e- `$ N
clone 1 load to P_induction
2 n3 S) v; m0 ^8 R& @$ l+ b4 E wait for A_time sec! @$ l- P+ R: S0 m# `, y& A0 @
end
9 ?, N& ~) e( p7 ?end
' f% {9 o7 r( W5 ~1 u2 R4 W4 {
Y& u2 N6 a. \$ }begin P_induction arriving
/ O6 F( s3 J* O. \( [ if A_induct=1 then clone 1 load to P_pick1" H9 a/ W) d5 g
else if A_induct=2 then clone 1 load to P_pick2
/ f) P3 |+ t! z* M' ?7 C2 ^ else clone 1 load to P_pick3
6 m; r$ G1 r! nend
8 m7 Z4 G. m9 S2 j% ^- O
. l7 {9 }3 v Fbegin P_pick1 arriving' \. H6 f; @8 x! s4 Z( v. E
set A_i to 1; _& ?& K- E$ Y' i/ D5 k8 u( G
move into Q_induct1
; e' `( v0 c; M. w6 s' b( Y move into pickaisle.induct1; F$ i" ]7 g- U/ {/ V, }
while A_i<=30 do begin
0 J4 Q5 K( d( ]/ ]6 B travel to pickaisle.con(A_i)
1 S- ~' P7 K+ ~6 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; n2 w) H0 E# T0 C7 p else wait for 10 sec% L0 n& e& y3 w. l( d- }
if A_i=A_leave then send to die
9 Q. L# H9 Q, x ~8 m else inc A_i by 1 p/ E. X0 y4 V
end; _1 T: t& { L0 L
end7 Z2 s L# U, T- D% F& V: @
0 s! a; M! `+ o. Y6 R _begin P_pick2 arriving2 V/ D' E) J; a+ h0 O5 u
set A_i to 11* V! Y: e! g0 p% B! k( i& H F7 v; r$ Z
move into Q_induct2
, K* {1 n% G) H. g1 w move into pickaisle.induct2) r- f$ X9 m4 J6 |& M
while A_i<=30 do begin
/ [- [! L5 ?* h& ^ travel to pickaisle.con(A_i)
2 c3 _: n* D: u5 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' }3 m. }# U: W% V+ X else wait for 10 sec
; n k( b0 t# r+ G+ [ if A_i=A_leave then send to die
; F/ m: l" ?2 B! ], _& T8 v else inc A_i by 17 N3 ?( e. A# X, R) f8 w) u$ q
end; E3 ?4 _6 O7 C) q& g+ A& w$ N
end
; P; _+ v# f; I$ ]4 E2 f2 q. Z% I& X! c' k' D& D
begin P_pick3 arriving4 ]. ]2 f9 ~8 S* u) b
set A_i to 217 c% ~6 G/ J ^1 `* U
move into Q_induct3
& d5 Z) Q! D% V1 L! F) V move into pickaisle.induct3
* o# i2 _) S" ?# R$ u; ^: E/ e while A_i<=30 do begin
, F+ R k: I# f1 P travel to pickaisle.con(A_i)
9 M. Y6 M3 V \! N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ M% C. @ D' e2 `3 E( C else wait for 10 sec, g8 h6 \; L' ~+ B" z) K
if A_i=A_leave then send to die* u% n0 D3 `$ q. C& r
else inc A_i by 1
! U4 c2 n( ~, i1 X end; j( H1 a+ d6 ^7 G& 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,其它按你的 ...
|