|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 n' a3 T- }- B+ s
- l) c1 t2 j7 _: M D, W; D1 U3 P我的问题是,在每个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中的数值,不知道会不会有什么不妥。# @* s' A9 i; A( L* d0 [9 l+ j
3 X# p o$ S o! u7 ?( R" ?/ X* wbegin P_read arriving& e7 {- _& ~% e% ?
while 1=1 do begin' W. V2 G& y9 e! G) G
read A_tote from "data.txt" with delimiter "\n"' W. t) E) i4 u; z+ ^& i# y0 d
read A_time from "data.txt" with delimiter "\n"# J- c* o! V7 i O1 _$ Q
read A_leave from "data.txt" with delimiter "\n"" T/ I6 c% {) I' ?- `3 ]
read A_picks from "data.txt" with delimiter "\n"
. c- j& U& }+ c+ }% Z' U set load type to A_tote
% D, @, T& U" f" s5 d% W if A_tote="tote 1" then set A_induct to 1
. Z& f+ Z; I2 o) e else if A_tote="tote 2" then set A_induct to 2# \+ r& ^1 q+ M% r* c
else set A_induct to 3
) w H; w& O8 j% D, r) N6 ? set A_i to 0! O2 I, i* _, O+ t9 c$ ^
clone 1 load to P_induction" j8 D* Q1 X; ?3 d5 \
wait for A_time sec: M4 \- s6 o7 n! f
end# r! t/ R `7 k1 g7 e& @
end
. \( _$ l r! e+ ?; Q+ c3 R2 w
& i" s4 I; S$ N* Cbegin P_induction arriving
7 L$ S2 r: U0 s% T6 t& _$ ?6 E if A_induct=1 then clone 1 load to P_pick1
, }9 S& M- p, @2 f( N" q else if A_induct=2 then clone 1 load to P_pick2+ L$ g: D# f s% p, W
else clone 1 load to P_pick3
) ^/ I$ C% u% a9 uend
* o( V. {# d, D; f2 z$ u6 Q; X2 w O2 P6 H2 y( S
begin P_pick1 arriving
1 S! T* n2 H- y8 o" R set A_i to 1
: [! B% A2 @" r0 T" n+ g2 } move into Q_induct1
& H% a3 P X# {% c& f3 z move into pickaisle.induct1
$ @; b0 X& x; l/ I0 ^3 J, A3 T while A_i<=30 do begin
! `, Z+ `0 U/ A- E travel to pickaisle.con(A_i)* P6 u5 _! b% L# @* U2 ~+ d# d+ A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ t3 V, H4 F7 _" O5 Q( o else wait for 10 sec/ C% S; ^8 E( _& [) f" _( t# `& m
if A_i=A_leave then send to die
9 U2 B5 S9 C5 Y" V" S+ p: F8 M$ U else inc A_i by 1/ [/ Q# C* i6 q9 z9 F" @' m
end
# c# e& q; ~3 r* fend3 |- C1 S9 T. f) N9 R, Y a( n
3 G; E6 P2 }+ i' ^1 r& H; V! K( y$ qbegin P_pick2 arriving
; n$ s8 o, S( I0 `' \0 o set A_i to 11
- }* n& q" @3 I move into Q_induct2
* p; G2 \, k3 Q+ a5 s move into pickaisle.induct2
& b' Z% F( x1 k% u while A_i<=30 do begin! r5 ^. r- { m
travel to pickaisle.con(A_i)+ _9 z/ i2 P k; x( B2 o$ z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* Q& b$ K6 A2 j7 e* V
else wait for 10 sec
$ j7 z6 b4 f( V' z) |$ {, N if A_i=A_leave then send to die6 U n1 X! Z1 h( i+ F) R: C
else inc A_i by 1, c$ s D( f n0 r, t
end
1 W+ X1 H/ Y" g, ~end) O. F' T; T* J. ?2 \( T* a% y7 z
9 z2 C9 P& C u6 h% d1 @begin P_pick3 arriving
( f% Z8 B- \! ~ set A_i to 21
, J, F1 W" L3 U& y, q move into Q_induct3
% G, a8 t; K- M3 \2 L move into pickaisle.induct3 H% d- N/ b% R4 Q
while A_i<=30 do begin# Y9 ]. E9 A0 j7 K: k6 m. _
travel to pickaisle.con(A_i)
7 L$ L1 W3 l7 ^ Q6 L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ` ^( _$ p, [. a" p! c, L- a
else wait for 10 sec
4 c( {; b6 W0 t8 n$ s if A_i=A_leave then send to die% @4 s+ f& u% v! v- K
else inc A_i by 1$ w0 V% {1 J' ^0 E. E. u% b8 x$ {
end
+ Q8 Z( h( o* @( u3 m- {3 o+ d" Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|