|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 d: U0 R6 x9 T+ n2 ^5 q
8 b: b) c* {- v$ d4 ~
我的问题是,在每个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 c3 m% I5 x4 R( G% H$ q( t+ ?: ]
begin P_read arriving3 o6 T# T1 [. Z: w' e
while 1=1 do begin
& `' K, D/ x/ F# [% D# W read A_tote from "data.txt" with delimiter "\n"1 H4 P% o& z0 R4 ~5 \. R7 D$ O
read A_time from "data.txt" with delimiter "\n"
+ s+ B1 y$ t) R read A_leave from "data.txt" with delimiter "\n": Q, w9 v( M$ B, f" i$ D) D
read A_picks from "data.txt" with delimiter "\n"
- V! k; l q6 a6 ` set load type to A_tote. c* P& {& J" T5 C$ }2 A
if A_tote="tote 1" then set A_induct to 1
& `+ C; H$ f% j" w else if A_tote="tote 2" then set A_induct to 2* |# R9 k5 M9 m! q3 r1 D
else set A_induct to 3
( z+ m6 t( k7 j( {6 H2 M1 ? set A_i to 0
4 e# W0 q/ K8 h9 L clone 1 load to P_induction' z' W, r' [/ S2 G, H
wait for A_time sec- E. `& q% V) z8 d% G
end: r4 f# C. W& L# D1 r. ]
end
+ h z$ K% _) z" Q% M- W! C( ~# D! w2 u
begin P_induction arriving
: y# c& Q! j/ _* z; |- z$ _" A if A_induct=1 then clone 1 load to P_pick1* I9 L8 I6 a9 P9 c& E
else if A_induct=2 then clone 1 load to P_pick21 M1 v9 n& C9 M3 r
else clone 1 load to P_pick3
' E: @" g( @7 k; C6 [. m( A1 v Qend
0 U4 N* r: X$ |. J: q: B
7 [- a1 ^& @1 x- lbegin P_pick1 arriving
) M9 b' e5 D4 t- A" U* F7 U# D set A_i to 1
/ f6 ^9 r% b) Q: N/ U- [ move into Q_induct1
7 H$ x& k7 Y/ Y6 f move into pickaisle.induct19 o( b, Y4 F. h& _2 s
while A_i<=30 do begin2 @3 U' P- J w: M1 j
travel to pickaisle.con(A_i)* i! H5 @- B9 T7 F) A4 h8 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- {* ?* h# {1 M: n$ C$ G% Q9 P
else wait for 10 sec
. H1 C8 C2 C4 I, f" a0 l. A if A_i=A_leave then send to die
5 e# l- E! S! e else inc A_i by 1# Y1 m: X' l& E5 L2 Y* o
end1 c7 K+ i+ M) _% U* _; X
end( A: K h, a/ U$ A7 q P! c
# ^. w$ g2 K$ C4 H* T7 obegin P_pick2 arriving. Z2 k! r/ }0 a: n8 f
set A_i to 11( B, Y% ~) L U G, r
move into Q_induct2
# F+ n9 B* S4 b1 L U8 ? move into pickaisle.induct2
1 l4 _9 i# v) w2 ?( A while A_i<=30 do begin
0 E1 k" B; D& j$ k: h. \+ \ travel to pickaisle.con(A_i)
( d1 i9 D: S& z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B9 b" ~; Z% P5 F
else wait for 10 sec
/ X/ J+ M) v6 ^ if A_i=A_leave then send to die/ Y& o$ V$ k, w: y+ h
else inc A_i by 1
- y& Y. X4 z0 s! u' h/ e+ G" b end
4 v& ] ?1 @- d ~) Pend
7 t8 b: j$ P" G8 g1 V
9 s5 W7 L; P/ V" @8 q; l7 c. ibegin P_pick3 arriving/ i) i# I, v$ F+ ~
set A_i to 21/ g3 d9 Q6 N! p9 F4 {. l# Y3 f
move into Q_induct39 j6 V4 b0 Y/ v+ N6 v
move into pickaisle.induct3
5 K u& G5 a* t. ?9 j. m% P) J while A_i<=30 do begin1 l; p$ C f7 m$ F1 p
travel to pickaisle.con(A_i)
8 U7 t4 g$ E7 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ v8 E E. d$ C1 Q2 @ P& d! S8 v
else wait for 10 sec# _% t6 `( k9 T6 ~2 V) N
if A_i=A_leave then send to die* B5 B# T, L8 F5 n- F0 O2 b1 F1 A
else inc A_i by 1
, F$ S/ B* X2 R7 [6 J' X end
, ~- x2 `/ [/ ?1 a0 d1 j( [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,其它按你的 ...
|