|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 s8 f2 Z/ O" `' ^- t1 Z# z6 b x7 _' a; 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中的数值,不知道会不会有什么不妥。& N* J# I0 U# k5 _; X4 Z2 B
: Z. v' S3 I8 w) K8 d! ~begin P_read arriving5 Y+ s: s" q. g. t) V+ Y* @5 e) [1 b2 H* s
while 1=1 do begin. ^6 L5 n) O0 M2 i4 c+ F8 J9 Z! L4 b
read A_tote from "data.txt" with delimiter "\n"' T- |3 D( ?: W6 |
read A_time from "data.txt" with delimiter "\n"
; K2 \9 Z, g# `( o5 P6 f9 v read A_leave from "data.txt" with delimiter "\n"
m" f* z, q/ |4 `% \ read A_picks from "data.txt" with delimiter "\n"4 v9 l& Z$ Y n: J5 V' z
set load type to A_tote0 `1 J& W8 V- d$ @. N; T: P4 M
if A_tote="tote 1" then set A_induct to 1! h3 e, E9 _, ^& W3 f0 V& B
else if A_tote="tote 2" then set A_induct to 28 P+ Y1 ^' o# \5 r: o. }. j: p
else set A_induct to 3
( j0 u# g- q1 f% p0 e/ N. J set A_i to 0! o$ N0 @( [7 h
clone 1 load to P_induction
J, v4 B+ F4 I( e9 `8 G wait for A_time sec6 W" _+ \- w9 g6 f4 Z6 H
end
1 G: n: L9 F' [end+ z1 y/ V8 k6 d/ j
+ o, e7 T0 s( D+ o! z' Q9 p% tbegin P_induction arriving3 ~3 |4 V* }. ^- u2 w& e5 N
if A_induct=1 then clone 1 load to P_pick1; u; E7 C, T$ g) x" x2 M/ W! @
else if A_induct=2 then clone 1 load to P_pick2
4 Q5 ?4 f2 W& ~* |7 j7 P' m else clone 1 load to P_pick3
. B0 q; K: S, R. Eend
3 O6 W, |9 C' k
' l7 Z9 Z5 }+ kbegin P_pick1 arriving
% A* U" K5 q/ D" T0 Q, w: W6 V set A_i to 1
; i' z* v7 _. d, X. j$ {2 h move into Q_induct1* r2 t3 N) ]0 x3 W0 X7 E/ {
move into pickaisle.induct1
. h0 v+ B) v# h' C5 p* b while A_i<=30 do begin
; W% |$ w u" I travel to pickaisle.con(A_i)2 F* u$ G9 ?; r) ^ z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" l) s- O9 G$ W; ?$ A0 v# s/ S else wait for 10 sec% x/ ^' J+ Y/ l* t5 ~/ h" k/ e
if A_i=A_leave then send to die
) j7 T4 ^# r' V else inc A_i by 1# {0 ?; r/ @3 x9 V, K1 M/ e0 Q
end
. w! r8 B8 t# w u, E# Kend
" Z% @2 |. E, z( X
! o3 `" S- w1 {+ s7 ybegin P_pick2 arriving
8 Y8 v/ V) l' A set A_i to 11) Z: }- G3 v" I7 w x
move into Q_induct2( |2 M, H$ z8 S0 E4 Z7 c5 p
move into pickaisle.induct2
* Z; T$ {6 E! \) h1 b0 U A8 s while A_i<=30 do begin
4 W+ K7 e1 z Q. U$ n$ u travel to pickaisle.con(A_i)* x& N* _; N: ]% f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 ~+ [# D J6 X) _1 x else wait for 10 sec4 Z) E+ B* W' q) h6 D+ A) f
if A_i=A_leave then send to die( n# }/ T% W7 E4 t `- t9 Z
else inc A_i by 16 s: s$ L4 T" w, ]
end* g( i. ?5 m4 A7 h. W6 {
end
: E0 A" T! i4 k6 q
) z/ a1 b# Y+ y& M2 X+ @3 zbegin P_pick3 arriving
$ |! C( b- X( S) A set A_i to 21
% _6 n# m4 _' ~, u3 u move into Q_induct32 I' |: M( \ U( |, e& P+ q$ g
move into pickaisle.induct3# h+ x5 [9 v" u& {, W/ Y4 U
while A_i<=30 do begin
0 M+ p- i8 A" V% w) p, n7 j travel to pickaisle.con(A_i)
/ G4 R( v5 `8 Z7 y' I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 q W3 \3 x7 [5 m9 @# u else wait for 10 sec, [& ^9 f' D! R0 } l- I+ j/ ?
if A_i=A_leave then send to die' q1 W) F1 Z: e3 h F6 u
else inc A_i by 1
; J1 F' M* v: C) g! \, z- K# V end
# c# r$ m$ w/ L; r3 k1 ?4 |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,其它按你的 ...
|