|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 ` |6 f1 U# X9 a0 H
4 P0 {" P% i2 J2 q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; [5 E/ a5 ]7 [3 f+ Y( t8 }! @
/ F% T* u+ O F( p# \begin P_read arriving+ B3 L! X) w6 B8 G1 I
while 1=1 do begin+ k/ [1 W! |' h) f9 g
read A_tote from "data.txt" with delimiter "\n"8 ~- L, j8 z8 r- F
read A_time from "data.txt" with delimiter "\n"
5 K: |! i# z: ]* X" S, U read A_leave from "data.txt" with delimiter "\n"
s) t7 \ q4 Q+ u3 e; S: D4 j read A_picks from "data.txt" with delimiter "\n") Z m/ f7 S& d5 u$ C. v y! U
set load type to A_tote
$ v0 a S" b! W) ^2 c4 n+ ~5 m if A_tote="tote 1" then set A_induct to 1
) \; j' z0 O# q1 A `6 r9 N& g; a else if A_tote="tote 2" then set A_induct to 2* U8 g9 J2 S( X, K
else set A_induct to 3
2 s8 z' i5 } ` set A_i to 0
& S7 j. q' _8 \ clone 1 load to P_induction1 L8 R' G, F1 S
wait for A_time sec
7 W4 H' G" m/ I end
# A b# c5 b- G' O* f3 rend
7 G: x$ x5 o8 i `7 f }2 l7 K5 ?7 Q5 M. P d
begin P_induction arriving$ s }- ^' Z& x$ l H" n
if A_induct=1 then clone 1 load to P_pick1
: y% G# I$ `2 z1 j# }( A! [ else if A_induct=2 then clone 1 load to P_pick2: ^2 n: ?" | A' J
else clone 1 load to P_pick35 w& h& d. _5 q0 d+ g- ^ _6 e
end" r+ I) L$ o+ |
, I1 a) |; X. t
begin P_pick1 arriving
4 r; o) m8 n. v& X8 b1 K: h set A_i to 1
. O* u1 W$ |: J: A1 y! @ move into Q_induct1
- F' n. C+ v$ P: x1 U4 @ move into pickaisle.induct1( i% }; _' n1 B0 w. [* ]9 s" F
while A_i<=30 do begin
9 Z& i4 r6 f# O9 X" k7 p5 f travel to pickaisle.con(A_i)9 v' f: n7 @" W d2 l- B/ H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 [2 u' ? a9 @( g: L" D+ k7 @ else wait for 10 sec7 v4 Y2 _4 y( z1 x' |% r
if A_i=A_leave then send to die, b4 J9 `' l$ i2 Q0 X
else inc A_i by 1
6 r* t9 m2 v, Y" ` end
6 K( C% H# I+ D2 O, dend
5 q3 m- w4 c/ N" ?+ h) K: p5 r5 P5 O) v' H2 A7 N# r
begin P_pick2 arriving
`( B: u4 Q, b+ v9 k& r+ D set A_i to 113 y7 `* S# {% C6 c+ K/ f
move into Q_induct2' @' E- }: G. X( i
move into pickaisle.induct2 m% j/ A9 `- I2 C
while A_i<=30 do begin0 H6 [: S0 I3 i3 ~, l e% x
travel to pickaisle.con(A_i)
6 Y% m% t( V1 f6 y/ r% R if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 T" s& z2 C/ H: B G( |4 n1 C0 s& d( [; c2 f
else wait for 10 sec
; V. G+ g6 d5 \. t) i: m if A_i=A_leave then send to die
0 I. t1 D0 p" k: S8 L- l6 g else inc A_i by 1& a+ n+ y$ `5 o# U
end$ l3 ?) h; Y# }* o
end
& \0 x* V4 h& N9 B% s+ S' T5 ^; T4 a2 `
begin P_pick3 arriving
2 P4 j5 J& B1 I" _ set A_i to 21
- x1 x) y1 D$ y8 P# t* w. ~ move into Q_induct3
9 E8 g* z9 m5 G; O# j move into pickaisle.induct3
0 s/ `5 X- u' X8 o m while A_i<=30 do begin
) ]6 ^9 P, O/ G& C8 \/ Z" m travel to pickaisle.con(A_i)
4 C( d, A- J9 a- C1 p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 b' b3 U* {* m4 d
else wait for 10 sec& e0 k, H8 \/ Q( ?- n; J
if A_i=A_leave then send to die6 Y* u8 Z G1 j$ d7 ]" Z
else inc A_i by 1
- F/ v( u$ k- E+ `8 L3 w0 U6 E/ { end
$ i; N8 o: A5 a$ m1 _1 d: y2 iend |
最佳答案
查看完整内容
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,其它按你的 ...
|