|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
) K) O+ y! W+ E- E! m4 a) ^% \+ |& i5 c+ Q A d4 B: Q8 Y5 r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* i6 b& ~$ d( _# E' f" K7 Q. x5 T7 B: X; w b: l
begin P_read arriving; V9 d5 d8 S/ K: }
while 1=1 do begin; Q" B1 B& Z2 I' F2 T. y* \
read A_tote from "data.txt" with delimiter "\n"' ?# |7 e* g! o, N& `% @6 e
read A_time from "data.txt" with delimiter "\n"
! ^2 L# ^" s% x4 w" _$ y read A_leave from "data.txt" with delimiter "\n"
; G& L/ X$ I0 \4 p, V3 i% h read A_picks from "data.txt" with delimiter "\n"' l0 \% l8 X& P8 R6 i# h/ s7 q
set load type to A_tote
# n; ?0 J* D% y2 x' \ if A_tote="tote 1" then set A_induct to 1/ @( _1 N9 h4 f
else if A_tote="tote 2" then set A_induct to 22 w# w) Q, e$ Z F X
else set A_induct to 3 5 B+ P9 _) r: _% e5 ^
set A_i to 09 N( v! _$ X) a, a7 D. p) K3 V
clone 1 load to P_induction
1 C0 W+ f% } U wait for A_time sec; @; u7 L' e- J) P5 Z- E$ W e; l
end$ }7 f t9 F7 o3 R* A$ z9 L
end
% k7 d" Y/ _9 e: V, ?8 I+ Z$ ^" V" L$ h8 k3 K
begin P_induction arriving0 M7 e2 v* ^3 r: L: t
if A_induct=1 then clone 1 load to P_pick1
7 r, l* k& ?6 \) y else if A_induct=2 then clone 1 load to P_pick2 N1 a* |: m2 F1 J6 e4 s
else clone 1 load to P_pick30 a9 z8 @7 F6 o) I5 [! O) D
end" Y5 h% o9 H S: X2 Y
% [4 r0 z' ? Z8 V; }
begin P_pick1 arriving$ e T. g$ Q) r# c6 b7 {+ ?
set A_i to 1
3 G. c( N9 z. k% `9 ? move into Q_induct1
/ C) C0 I$ V+ K8 r% T) |$ D move into pickaisle.induct1) j6 ?& l5 x* d# P7 S
while A_i<=30 do begin' O* @4 s4 X- l, h7 D
travel to pickaisle.con(A_i)
2 B0 B0 L" U# o: a7 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' y! _; D! U! _# [; ` else wait for 10 sec- O8 [5 h2 M, j0 j; z- _# h1 {
if A_i=A_leave then send to die) ^( R$ R9 a- h7 ` X3 [2 R
else inc A_i by 1- F" u* j6 ^) `# Y, K
end, N5 v1 f2 [" n
end
! H; q! T$ j5 \- W, Z* ]3 N0 e4 S* Q( b* R4 V; S$ |7 N
begin P_pick2 arriving$ f3 @5 Q9 N2 U/ f L. ]
set A_i to 11
. f' ^: D7 ]) ^( e( O move into Q_induct2
7 R# N& [( l6 |% g; z$ a3 G1 h3 l, O8 N move into pickaisle.induct2' G# Y/ s6 G( e8 n( l- L
while A_i<=30 do begin
, d6 r$ A& a: |0 ]0 A0 Q travel to pickaisle.con(A_i)- o: F9 }. O- \$ t: [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! [ `- H/ g. n6 _% K- r2 Z
else wait for 10 sec1 R' ]9 N& L5 R! l k7 _
if A_i=A_leave then send to die/ \. G2 K8 ~: j! c# ]
else inc A_i by 1
7 P$ T, v7 Y+ s4 G, ]- H- c end
0 G, \' X/ e' e! ~$ C3 cend# D- c6 D4 q, ~4 x4 [
( h- W' ]4 U+ _+ jbegin P_pick3 arriving
8 [3 i8 o! e* y g5 c- S set A_i to 21' i& B, F; H! y) y9 g) e
move into Q_induct3$ i# |3 j v5 D9 E
move into pickaisle.induct31 ?& n+ y4 m! p# D5 p9 r, \) I
while A_i<=30 do begin
Q3 a' K6 F4 Z( @# `/ u travel to pickaisle.con(A_i)
" {1 i0 f e; |. a8 q( j0 b s# s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
d" R- r7 x% N% b* Q: }1 F else wait for 10 sec8 o. w- M. S9 n# e
if A_i=A_leave then send to die
9 [+ ~2 w2 x, s/ a* \ else inc A_i by 1
+ K" o$ W: }5 u. ~# A3 T$ L4 L end# c! z$ D1 @ \% c
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,其它按你的 ...
|