|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ X! }7 F) P, t E* E
" r* k. L6 `8 @- N( k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 t$ K1 M" A4 b; h& `# c) U! |% e/ Z$ Y: b$ L
begin P_read arriving1 A2 \* |/ b) d$ b' N
while 1=1 do begin; K4 p: V3 z( q! W! I+ }' N4 U
read A_tote from "data.txt" with delimiter "\n"3 ^; N5 M- N1 Q
read A_time from "data.txt" with delimiter "\n"
' j8 l" a% S0 K9 N/ h0 l k read A_leave from "data.txt" with delimiter "\n"& \# D7 c( d5 P( u' ]1 Y
read A_picks from "data.txt" with delimiter "\n"
' {$ Z+ `, f& g& K set load type to A_tote5 d/ r4 s% [5 s! m
if A_tote="tote 1" then set A_induct to 1+ B4 e0 @2 U6 a- E8 P. x Q
else if A_tote="tote 2" then set A_induct to 2
2 `. y& { E7 M/ h$ H* I: S5 c else set A_induct to 3
0 N' B/ o9 p1 d" E9 F$ U! O set A_i to 0# c c3 Z A6 m) |
clone 1 load to P_induction
% r* k* l& N, B$ g4 h- [ wait for A_time sec8 S" {- s* n: f0 {3 Q, |+ i$ @
end3 z, t" n7 n- p3 [/ V
end* _( H. P: O' L1 V9 E |9 ~
; k4 o# o% ^' n+ K& Y: R0 ?
begin P_induction arriving' \: k! B. [9 k$ ?3 G- d% ~3 C
if A_induct=1 then clone 1 load to P_pick1- V) u3 ?; H/ {/ t% W+ n) l3 X
else if A_induct=2 then clone 1 load to P_pick29 w& P% ^& l. i( h' s s3 ]
else clone 1 load to P_pick31 ?9 a" d v$ A
end, V$ u& @# d. a/ C ?7 R# T
. }% e; o; g* {$ s
begin P_pick1 arriving
- {+ J" |/ N# J% u set A_i to 1
6 U3 C" H; t. v# Y! t/ b6 r$ c move into Q_induct14 } L5 i* V, i; }5 v
move into pickaisle.induct1+ [. T0 [+ t! S" ]
while A_i<=30 do begin
/ l- r- X' C! w) d travel to pickaisle.con(A_i)" _0 X! \1 o) y' y3 z7 k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; k( Z! Q( g5 k& d) l
else wait for 10 sec
' i% y! O; c5 y1 E4 ]# V if A_i=A_leave then send to die! v0 c. `6 ]! `
else inc A_i by 1
1 O! I6 w% @9 e: E& e end
6 U! `. `( ?2 n2 n! F2 rend! x$ g; `' y# s) `, \' U4 c& E
: r7 N! O' l2 W
begin P_pick2 arriving
' |9 @6 O" L' X, E set A_i to 11- A9 u) `" x5 ?( K
move into Q_induct2) }3 M( m4 Y" i9 [
move into pickaisle.induct2
) \/ |! h. x; W: I0 {" V while A_i<=30 do begin
/ a3 z _- I, h0 `' _& c travel to pickaisle.con(A_i)$ Y) D6 V2 m- J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# p& I3 {1 ?2 ]* W! e9 n4 v
else wait for 10 sec
, S3 ?( [, I' k& w6 Q) t6 d if A_i=A_leave then send to die
3 w1 l a) h' ]6 f3 |7 r: K else inc A_i by 1) Y' B5 q, p) G' M$ q: G+ W5 O7 Z
end) h$ q( Y6 k3 l- \+ p' O
end6 y+ P, b5 p1 r/ }7 z
, {) H; q) f% [& m: |8 ^- |
begin P_pick3 arriving9 a( o( _ M( R- \9 x/ V3 F
set A_i to 21+ U" M0 \: t g. C; X& a
move into Q_induct33 d0 N' }$ \5 Y
move into pickaisle.induct35 ]# g, `+ e+ A& k; ?: c( p
while A_i<=30 do begin* W1 \7 X5 E/ C( G7 f1 |
travel to pickaisle.con(A_i)7 a, A* b; v2 [, E6 v# L; @7 n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 O9 o/ k, h) @
else wait for 10 sec
: Z, _2 y$ n1 Y, G! R if A_i=A_leave then send to die
A1 J' R c4 e" \ else inc A_i by 1
5 }5 Y3 p9 l& k8 ]; ^) d end- j9 i2 K. H8 r1 y
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,其它按你的 ...
|