|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- M$ g1 H4 h) i$ M3 y' `8 L
0 |8 ]9 c4 U5 p( M! M& }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ u0 p0 Y( ]% M, o
9 A( h# d: n! J1 K: p, A3 D2 Jbegin P_read arriving F. S, S3 U& e& ?, q% O% s+ v }
while 1=1 do begin
* H4 M1 P& V, S+ O1 E1 C read A_tote from "data.txt" with delimiter "\n"0 B$ R+ G" Z0 q, }
read A_time from "data.txt" with delimiter "\n"* l+ D! I% P; m& Q
read A_leave from "data.txt" with delimiter "\n", ^) b2 \0 G& ?0 q
read A_picks from "data.txt" with delimiter "\n"0 t( E; K! @( \* S; U7 r0 m
set load type to A_tote, r; {- i: P8 o7 k* p. s
if A_tote="tote 1" then set A_induct to 1
- I6 S# `( M) |/ k: s* S& \ r$ P else if A_tote="tote 2" then set A_induct to 2
3 K3 d5 s) s% V& O, R7 F else set A_induct to 3 1 b/ N' z' Y* |; ~' o' o r
set A_i to 02 F5 o! m: W2 {+ u/ C4 F, J% B
clone 1 load to P_induction% A+ s* ~1 V* @
wait for A_time sec
+ W. Z9 H6 m: |# S v end
+ H; f$ C4 j2 b) }9 ?end
0 u" y9 D3 G3 _1 g3 L
, e( J6 e$ @$ Ybegin P_induction arriving
+ d# G& H: s7 n4 X' f6 Q if A_induct=1 then clone 1 load to P_pick1
6 \2 U6 b: B# y( ~8 [5 q0 d2 D else if A_induct=2 then clone 1 load to P_pick2; `: p1 \# ]! s$ ~, U4 M
else clone 1 load to P_pick3( [/ X' T7 }( i& F" @
end
$ G( o0 ~5 _# b& e9 u
" o$ Q' O$ a2 B( |begin P_pick1 arriving
0 d- F# _- ?9 f( m! ~7 ]/ z6 m: ^ set A_i to 1- n# e8 v) `; o( D
move into Q_induct17 o; B& r' S* L: ?* y. ]
move into pickaisle.induct1
4 N/ L' J+ _! E) ^+ m while A_i<=30 do begin# H7 j$ H& R" B3 O
travel to pickaisle.con(A_i)) |" o8 W" g3 |$ J+ e3 f) v% H, n4 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ O# X; U v5 V* l7 S
else wait for 10 sec
5 I9 v8 Z/ o% l7 W2 g W" I if A_i=A_leave then send to die
- V5 \) n; j, f, C/ D" P. S else inc A_i by 1) {' o: X/ z* c
end
( t# a- X2 P+ Iend
, x) U- Y# f% z2 |* g* k
' d! Z. `) f7 w& A0 i0 e: zbegin P_pick2 arriving
( J( \' b6 U! V% Q8 k set A_i to 11# ^1 ^3 b. D9 L' c& ?
move into Q_induct21 i- `8 ?' b) q3 ?3 p
move into pickaisle.induct2
! a; J6 w) D+ Y$ d7 N while A_i<=30 do begin
0 [1 u2 [; R6 \: r4 l travel to pickaisle.con(A_i)" x) [2 q- u( I/ _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! h0 x% B$ u& P1 l* \% F# b- } d else wait for 10 sec
( F0 \4 O; U1 ~' G: _& I if A_i=A_leave then send to die
R2 X4 n' J: _0 R9 n else inc A_i by 1
3 H: b/ f/ ]% K3 @! `4 i end3 v. E2 ]# Q) y. {% @' z7 ^
end0 y8 e+ Z9 L. Z+ J5 u
6 D! C# G! r! |- F- x0 b6 G
begin P_pick3 arriving: b1 S+ o; q, g: c9 q
set A_i to 21. V5 w4 G+ A3 I$ ]
move into Q_induct3# f% `- e' w' A+ G
move into pickaisle.induct33 _5 g3 C- ] X, m
while A_i<=30 do begin
5 ~! Z: V* b y" d) ] travel to pickaisle.con(A_i)
' B {. e4 [7 T2 p$ d N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H7 \- m) @/ }3 ?( g
else wait for 10 sec
/ z+ x$ V. Z4 V+ R$ n if A_i=A_leave then send to die
& k+ a/ ~. h- C+ U6 X! ^ else inc A_i by 1. d% @% A) W9 y* q3 t0 v
end
5 c3 M+ u: W1 p+ ?! {" n4 Z. 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,其它按你的 ...
|