|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ b& U+ q) A9 O0 L; a
, e. U, ]2 C* r( t8 [- 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中的数值,不知道会不会有什么不妥。( t e2 U8 q3 s2 c6 f* Z
% T0 [/ K, i7 X- \' Z$ M2 _begin P_read arriving
~+ a4 L/ x* g6 Y5 C b+ C7 h4 r! | while 1=1 do begin! W6 w0 X+ t7 | ` M
read A_tote from "data.txt" with delimiter "\n"
- [8 W6 L% [9 q read A_time from "data.txt" with delimiter "\n"- \$ U2 R3 P/ W1 A$ @2 E
read A_leave from "data.txt" with delimiter "\n") l! @, n" m6 k4 f* u
read A_picks from "data.txt" with delimiter "\n"
% ~1 {0 i! v; ~6 `4 p% U set load type to A_tote8 y1 e* W( ?$ D' l2 T, e" Z4 G
if A_tote="tote 1" then set A_induct to 1
6 D7 Y3 {# e$ ?$ Z9 m) M7 m/ f- T else if A_tote="tote 2" then set A_induct to 2
& B& \- K" o2 M, w else set A_induct to 3
5 r1 Z' o& f1 I set A_i to 0
2 ]8 h0 Y3 j3 e1 t% A/ k% V clone 1 load to P_induction9 x+ r4 ~/ T7 x0 L8 |- R
wait for A_time sec
+ D4 E! U* J: \8 J" A" C1 d- f& J end
( |9 t) f0 R( d+ M8 Rend
2 @2 d6 H) ^. P4 K$ Q2 I F& R
& }& x7 Q" Z. A' b& z3 Dbegin P_induction arriving
) h7 L9 f4 j7 k if A_induct=1 then clone 1 load to P_pick18 M# Y- }( J- f
else if A_induct=2 then clone 1 load to P_pick29 N- m9 F' l9 u5 j$ k* B# L
else clone 1 load to P_pick3
; a& o' p0 | H) A, oend, x- v o% ]$ `0 e
; i0 @* n% _+ Y% [& c3 y# ubegin P_pick1 arriving
/ V0 A: O# ~& c set A_i to 1
0 w9 {( m0 J% Z5 R; G move into Q_induct1/ B* u7 Z! a9 E# t" w
move into pickaisle.induct1: z; f s1 t/ T7 k$ y! a2 H
while A_i<=30 do begin" U, p) E0 Y$ L/ R. D. |. q9 q& \
travel to pickaisle.con(A_i)
4 y# z+ i# i7 K6 o% M0 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# I& T: a& O! b$ e: x* \9 x
else wait for 10 sec3 t d1 i- }: P" @& Z+ ^# d
if A_i=A_leave then send to die
4 { @& m) E1 r- M* e else inc A_i by 1
- W& M5 Y# o) f& c* n: E end
# H% s+ ~+ F: q/ [2 X4 \0 Eend
- k7 C0 y4 H* Q; S7 N5 S
0 n' g7 B- {. W u2 ~3 h9 gbegin P_pick2 arriving
6 h6 @# P6 ?% a* M1 Z set A_i to 11
+ f* j* N5 `0 l5 Q7 m. @ _ move into Q_induct2+ w9 J+ P* z. f! g0 @0 k! v
move into pickaisle.induct2
4 z/ D p0 i. i6 R while A_i<=30 do begin
4 l* K" V' s! V6 X) t6 G travel to pickaisle.con(A_i)
1 N `- H6 a' q' X0 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' s x3 g3 [7 t1 U8 P, Y else wait for 10 sec
/ F/ r$ s. i0 k$ M if A_i=A_leave then send to die. G" j: W8 l. H5 o" J( p
else inc A_i by 1
" ~6 x" {3 w9 M end& L2 }! C! m% T6 ?4 }+ b) J D7 L
end
3 a6 L: j. C V5 U' \4 }9 A) e; w8 I# A/ {4 R$ ]
begin P_pick3 arriving- p- P) ^" N( {- t
set A_i to 21
. B( _1 K" L) v# {: n4 Z9 U: q move into Q_induct3
) v0 Q" z+ L1 B6 p move into pickaisle.induct3
( ^5 w6 `1 J* u) ] while A_i<=30 do begin+ B# c8 W1 q1 g9 t+ T
travel to pickaisle.con(A_i)3 W0 g" Y/ l" {5 ]0 V& W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; ?- N. p8 w1 s else wait for 10 sec
4 @, ^& u7 c1 H2 U, P+ S O1 q if A_i=A_leave then send to die! B% G+ f/ Q6 [: P
else inc A_i by 1, B5 G" q$ L; }+ R2 g; D& Y
end
c# K8 y5 G9 J. w+ f4 X$ J" l: |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,其它按你的 ...
|