|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' e7 o3 r6 b% E* `: i) v. I4 N7 O" w2 R" k- c+ v# @) _2 {
我的问题是,在每个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 b- q. a( R7 N9 H
' ^1 V" p2 G7 [5 ?; G+ D' w4 x
begin P_read arriving
% G" g% L# ?* f+ ] while 1=1 do begin3 X8 ^$ f1 g% I
read A_tote from "data.txt" with delimiter "\n": n- K' I* ?- R7 }% r% ?
read A_time from "data.txt" with delimiter "\n"
6 I# O; n1 L+ b9 y; ]$ I read A_leave from "data.txt" with delimiter "\n"4 @- l) b0 V T* t% V; u
read A_picks from "data.txt" with delimiter "\n"
) o& S6 |1 B2 G( h: s; s! y; H1 N7 Z set load type to A_tote
! ~8 D+ j8 K' U; C m if A_tote="tote 1" then set A_induct to 1
; R7 e; w' I- K# y! V' L1 Q- A else if A_tote="tote 2" then set A_induct to 2: E: J* O2 @# d0 L, {
else set A_induct to 3 % o) L, U, G) s0 r9 y6 f# s
set A_i to 0
6 ]# h8 p0 l6 c& K l: { clone 1 load to P_induction
. X1 |/ I' L& F0 i5 ~ wait for A_time sec& m/ g, c" G& b, X( Q9 [
end
/ \' h: U. k4 |9 k7 y; cend7 F5 Z+ R* @9 z9 ~% m
! q5 b1 C. r: r) ^5 Nbegin P_induction arriving% N" D- c% X: F A4 `9 n
if A_induct=1 then clone 1 load to P_pick1
( |% J+ g7 i1 e7 Z else if A_induct=2 then clone 1 load to P_pick2
' o( |- a7 U5 x0 w# Q else clone 1 load to P_pick3( T2 j4 I6 o; J0 @/ V5 m
end
( D4 D9 q8 U' | c, S, M3 H' z1 y: J. ]1 W3 ~
begin P_pick1 arriving
0 F0 u6 q. {% j$ f set A_i to 1
- W3 V0 K6 ^" W# W# y& M: Z; | move into Q_induct1
! b4 u5 ^* e6 U6 u* Y3 V move into pickaisle.induct1
; W) ~7 c; X& z; }; F( i while A_i<=30 do begin# B6 t7 A! r' B! A3 Q3 l( t
travel to pickaisle.con(A_i)$ ?* q. _1 E( u0 r" x& }0 V7 b, t3 c/ D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ ^$ V# ^. Z _8 i T
else wait for 10 sec1 S Z9 M- K7 Q& R
if A_i=A_leave then send to die1 }2 @/ T! A$ |( L$ m# j W [% }7 A2 T
else inc A_i by 1
0 a7 k1 @7 b3 G4 n1 {+ ^& B* v end
0 b8 k1 o% D; E m2 v# {end
, g7 d3 a, e4 v# J e" @
: g% g! u( l5 Y7 J; Q& H( ~begin P_pick2 arriving
; z7 e! E1 W- i% g set A_i to 11
1 x/ c6 ^5 u. a move into Q_induct2
+ M8 d) F6 x9 |. u- P move into pickaisle.induct24 O+ c2 v9 y% {. z
while A_i<=30 do begin
% a6 K+ ~& }' n @4 a travel to pickaisle.con(A_i)
4 W& ~1 ~, J9 J& O% q$ G A M# h" [) M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( q* c* G5 x! {7 S. H( W# l else wait for 10 sec3 @' M. {0 u& k$ k. v
if A_i=A_leave then send to die
8 P3 z. H2 u) z+ C( @5 l' b else inc A_i by 1- B! M$ c$ v% X5 x( [
end `' P% [: G5 k3 _
end7 f f2 Y' Z) v4 `4 ~ b9 i
- G' c* U* I( Q; f2 f9 w5 a
begin P_pick3 arriving1 G" H* h/ ]4 h: p" D7 }) h0 N* g0 k
set A_i to 210 W5 ? x: M! X/ c- L. e6 g' C
move into Q_induct38 k; w& R; v6 x/ o9 a# k. I
move into pickaisle.induct3( `/ A4 r; e- a
while A_i<=30 do begin: e2 I4 L! t9 P7 b. V
travel to pickaisle.con(A_i)
9 v# p% E w4 n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ m- Q7 X" X; m' n& p
else wait for 10 sec
* q3 Y+ u+ y0 a5 G$ e$ u+ G, R if A_i=A_leave then send to die2 k5 ]" T3 b$ }7 E" ?0 }
else inc A_i by 12 w0 b1 P& V1 |4 |1 j/ ?0 |
end- I# `: V! w: [+ i
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,其它按你的 ...
|