|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ^$ X5 t) m9 ?, W2 q. W1 V/ U
1 d) b& u! w' e7 l: s我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ l4 Q- s* W7 \1 ` u
5 S4 G" J4 ~7 a5 q; b7 R* Ybegin P_read arriving
1 F$ Z0 d# Q$ o while 1=1 do begin
/ Q9 Y1 d; p9 y! ~# i. I, S& k1 E# R read A_tote from "data.txt" with delimiter "\n"
8 O0 f. N, U) T. S A read A_time from "data.txt" with delimiter "\n") j6 Y( \: z4 C) j9 l; k# ]4 w7 i
read A_leave from "data.txt" with delimiter "\n"3 `* p! w4 p7 F: ~# j! L
read A_picks from "data.txt" with delimiter "\n"7 p) q. P9 _* o h; `
set load type to A_tote2 G/ J# {# A6 \! S5 K
if A_tote="tote 1" then set A_induct to 1
+ x0 D, g* p' | else if A_tote="tote 2" then set A_induct to 2% u8 j2 p& Z" y" }0 w
else set A_induct to 3
( N% h7 K1 H, T set A_i to 0+ `, N B+ c) k/ L7 ?7 U1 Y* G# W
clone 1 load to P_induction8 K: I7 h) l/ p) v
wait for A_time sec% j' \7 s/ e1 m1 ~
end e2 E5 b0 Z# `5 p; B8 ?6 P7 R# p
end3 N5 l! T0 V) E/ o1 ]6 [1 y4 x% K
0 \* e9 F, N6 }: d# L# e
begin P_induction arriving
- }" U* a: B" q# { g6 m8 B if A_induct=1 then clone 1 load to P_pick1
6 T; G0 j) x& D# _: j else if A_induct=2 then clone 1 load to P_pick2* a+ s @0 {- K% _
else clone 1 load to P_pick31 c, V+ Z8 v; O2 u3 c
end
, i2 O! P$ N: i+ [: L7 z% ]/ e) T' r2 u7 u3 q2 c' j) Z
begin P_pick1 arriving; z- `, s( M2 ]& [' y- m3 D
set A_i to 1
) U; X5 J' k4 F5 [1 V( R move into Q_induct19 ^: I9 G3 @' J$ ^+ ^2 L9 G8 ~
move into pickaisle.induct1
4 a( i$ O, K: b7 h while A_i<=30 do begin# {2 f( {' B$ `0 @
travel to pickaisle.con(A_i)
& F5 Q4 H; M0 y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* x! i9 U K" W7 l8 k% B. e
else wait for 10 sec
. R! ?, M6 A2 l" A! d* `% G if A_i=A_leave then send to die
( @/ t S2 r9 A4 J; e% f' L else inc A_i by 1: C' h2 Y" i5 x4 h& h! y
end+ g" y- s# N) p3 Z' G& R
end
' J! }& `' I5 u1 W
1 }" r' H t1 Z4 [3 r. ]4 Ibegin P_pick2 arriving
/ g' C9 y2 N0 a8 U0 Y set A_i to 115 j; @9 |. s$ [0 a' ]4 A
move into Q_induct2
4 q% u' Y2 A3 X$ P( z7 ~; Q move into pickaisle.induct2! U# J# o$ D9 ]2 j
while A_i<=30 do begin9 i/ X4 N$ _4 B: y
travel to pickaisle.con(A_i)3 @( c! D( u# [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* @+ j$ n" z: m' W9 L7 c: _ else wait for 10 sec
; ]4 p( {4 S; z* ^" i if A_i=A_leave then send to die/ k/ n% s% J5 q. |
else inc A_i by 1
% Q) a% D9 Z/ h2 Q. A) N end
( ~9 X# p2 p3 t, W0 C0 Yend4 x# W/ {% u; r2 D# U' j9 x! h7 a
( G0 U5 ^+ a8 T$ V% H& w i
begin P_pick3 arriving% i/ j8 ]9 e, E y8 p
set A_i to 21" l* x; ^- @7 G) m4 j* g
move into Q_induct34 _8 D0 X. V. Y( u
move into pickaisle.induct31 Q2 Z! v l$ Z; c! g3 ^
while A_i<=30 do begin
0 s- c# W. c. H* K6 Y$ s; O: s$ c travel to pickaisle.con(A_i)
2 T x Q0 w- B/ O. n& U6 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; A+ a" c, F0 e8 n# r8 S5 W else wait for 10 sec( k: F" C+ h4 Y0 r7 m% [1 b i
if A_i=A_leave then send to die
0 V) _: a* w* A+ Z else inc A_i by 1
0 S( f. U; L4 I$ t end
: `6 t5 H, [% Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|