|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 J$ S6 o8 v& f! a8 l7 ?' W) H
2 o- ~& a4 m( U6 F
我的问题是,在每个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 D0 v& p! b4 `8 y
; h# S( a% y5 A( g, J: y
begin P_read arriving$ U$ O" _: R- Z, v _9 H
while 1=1 do begin
0 x5 S7 h' ?7 f3 Z) `6 K read A_tote from "data.txt" with delimiter "\n"' g# W% ~8 X8 ~% d) r
read A_time from "data.txt" with delimiter "\n"+ w0 y. n9 G! O9 j) ?' |# E: v
read A_leave from "data.txt" with delimiter "\n"1 `" Q) U- g" j& @8 D- o( P C
read A_picks from "data.txt" with delimiter "\n"
7 c& r; D3 g o) k% u set load type to A_tote& `: n: Z5 O( W( O5 H
if A_tote="tote 1" then set A_induct to 1
9 r8 b4 p- N- a g) ?1 U3 n- t else if A_tote="tote 2" then set A_induct to 2' O! }4 X0 P# E- E x% [6 Q+ g% x
else set A_induct to 3
* z+ k% e9 m' c5 g" y set A_i to 0& d1 N# o5 _* H8 z+ n
clone 1 load to P_induction1 z% j2 j6 y6 o x
wait for A_time sec
* [/ S2 R- R8 j: G end! U9 l0 r8 K5 X) p1 Z. j
end
" z- C% C! t+ ~/ d
G, P+ u2 A& A4 abegin P_induction arriving
2 Y7 ?" e/ U* d2 g/ ]' ^3 P if A_induct=1 then clone 1 load to P_pick1
) v7 w9 n' c, W+ p' F else if A_induct=2 then clone 1 load to P_pick29 i5 g: E! a9 Z, S, l0 F) y) ^. i6 O
else clone 1 load to P_pick3
# O3 a4 s/ d$ Y7 `7 kend
+ k. K7 d" ?6 I) M+ G& d e5 h% a+ z5 C- c Y
begin P_pick1 arriving
6 B$ M5 o" G3 c5 p8 V* T set A_i to 1
C! P: r- R4 D( [! [- @% [# ] move into Q_induct1; H7 B7 A# Z7 `3 {# V) x2 N
move into pickaisle.induct1* d- Y+ b* i# _- @6 H/ X
while A_i<=30 do begin
/ m Y* s- }+ [* _5 ~ travel to pickaisle.con(A_i)/ k- Q; p/ h% ^; [, n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' b' ~+ B. F0 }. V
else wait for 10 sec+ [: k1 d' l, B. K/ _& X
if A_i=A_leave then send to die
' M' H. Z' \8 Q$ n else inc A_i by 1! W! Q( n# T5 K3 }. g& ?9 ?
end
0 v, P) m$ E% i) g7 cend
# N. p& ^/ E( n* z+ p/ w7 C! J8 B# P9 }
begin P_pick2 arriving/ O( B/ F, o& ], \
set A_i to 11
4 U/ { T& G) [% A move into Q_induct22 J" L8 X# n* G, F+ i
move into pickaisle.induct2
5 N1 m/ M' O1 r4 n" ?0 l( k2 i8 M while A_i<=30 do begin5 x' n* p, ]4 t# j/ g# a
travel to pickaisle.con(A_i)9 b/ |# D# p4 P6 ^2 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' `3 L0 D/ M7 }, {7 P. r
else wait for 10 sec1 _) v+ ^! k1 ]! @% t- o
if A_i=A_leave then send to die# J6 d# ]6 Q' F$ y; y7 n( B
else inc A_i by 1
l/ N) k2 K! ` end
9 f0 X1 F2 a4 }0 E: j q: L; p$ ]5 S6 V4 @end. Z7 Q7 D, L6 V# B5 k# t
. f/ e" N* g. m3 Gbegin P_pick3 arriving
/ L, Y' V" |* m* Z3 \; q- T set A_i to 21
; R! h$ u/ I6 d+ V6 c1 @ move into Q_induct3
" e1 l9 E2 Z5 w `) f: l+ g move into pickaisle.induct3
! L9 a( r) P+ e, n( E' U2 U while A_i<=30 do begin B* b' ?0 ?6 r; h" g/ q7 x
travel to pickaisle.con(A_i)1 j% ]4 I. |$ I( L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 _9 u$ A' U5 ]$ O' d, G
else wait for 10 sec# h6 C, {6 w& Z7 Z+ j
if A_i=A_leave then send to die
6 h( h0 j: {4 F: Y1 m I else inc A_i by 1
6 ]& W' K$ E5 G- G+ \7 R( k end8 i7 ?8 v1 C) l. T& _" u$ g/ j) R
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,其它按你的 ...
|