|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" K% C0 P m7 \1 \" b
8 r) f1 E X$ J7 ~# q4 B6 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中的数值,不知道会不会有什么不妥。0 z# i! @ [3 \6 {1 S' ]
7 h @; i. `) Y: p: N, o0 mbegin P_read arriving
0 \' N" D- I5 \) v' }( H- ^ j while 1=1 do begin
/ w7 A/ g) O/ I read A_tote from "data.txt" with delimiter "\n"
( u" V- [5 [ h$ W' H# _! T3 U+ i/ H; G read A_time from "data.txt" with delimiter "\n"6 {% k$ u7 c9 J8 z# V7 n
read A_leave from "data.txt" with delimiter "\n"
/ G- j& k7 \ j read A_picks from "data.txt" with delimiter "\n"0 T2 \( Z8 S* c$ k2 q* P
set load type to A_tote
; v s0 n% ?) @8 d! Q$ F" h' ] if A_tote="tote 1" then set A_induct to 1% ~. ~! m1 u5 T) c2 X2 ~" |
else if A_tote="tote 2" then set A_induct to 2
- Q1 u1 }' p, k3 V) k else set A_induct to 3 2 y! X0 x' A, g$ [
set A_i to 0* y* ~& t1 ]/ G
clone 1 load to P_induction+ A( ]' k7 H' c9 e, b. i
wait for A_time sec' X- q" n. _: ?
end
! V' w% j! N9 |5 g3 ^) Nend
' n" W8 h- w4 |' n3 k8 E1 ]/ P$ p' p# H3 a8 ?1 Q
begin P_induction arriving
% W& n/ m2 Z2 B h, P, H. q9 g% S7 F if A_induct=1 then clone 1 load to P_pick1
1 _2 R- n: r6 u( O" A else if A_induct=2 then clone 1 load to P_pick2
: r! t2 \% J6 Z1 d) ^3 \6 |: f else clone 1 load to P_pick3% V5 b B; [* x5 c# o6 k( V
end; B, N d7 l) J+ [7 b. p) B0 u
2 |- B; s' S8 o9 }; m2 q4 U
begin P_pick1 arriving: p) [1 @5 P, ]# U& I
set A_i to 1
2 }3 Y8 H, @8 f7 {: K move into Q_induct17 j8 z: J5 Y% E3 N) r# [
move into pickaisle.induct1
9 ^6 ]/ M U# P0 J9 c0 D7 G while A_i<=30 do begin
9 F( C! ~+ W) O0 g( `1 P travel to pickaisle.con(A_i)
& y, G% L8 ~/ @4 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 e1 x% Z' T$ Q else wait for 10 sec7 C! T! D- r0 Y. w4 o' |
if A_i=A_leave then send to die
; u# _$ F. c' w) v$ @ ?+ n else inc A_i by 1) z& {1 T4 g; p H+ |6 Q& J
end
$ }3 L+ [* e/ G( x" cend
! E" o z8 G( H, K8 Y% y6 a
, s) H, ? q# U4 [: f1 f" Zbegin P_pick2 arriving
( P5 j8 U" s4 b6 ]% m) s set A_i to 11
7 M; C% r) u, @# B move into Q_induct2, }( q& T3 p1 |) G
move into pickaisle.induct2
' L' U( W1 H' [ while A_i<=30 do begin! e. K8 v4 k! J m, C1 \3 ~
travel to pickaisle.con(A_i)2 e! c ]6 M/ K1 o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* ?! d: D4 ~# W. ]4 O
else wait for 10 sec
% o" ]' s1 w7 f1 _" Y% b' M _ if A_i=A_leave then send to die, u4 Y" F+ [& q) w0 H& @9 S$ A
else inc A_i by 1
- K7 V! b9 _ ` W* }2 m2 O end
' h8 U5 N* n6 v3 r. F4 c/ ^/ Zend
) X4 X4 Y% F% B& M( m4 r0 e' b; x! {
begin P_pick3 arriving! w" b6 y3 x- ]' D7 V$ } Z
set A_i to 21
6 f' Z- L$ M% m( _* h move into Q_induct30 U# o" H6 E. f. L5 l! N1 S7 W
move into pickaisle.induct3$ s! x! [8 l ~+ s3 s9 R
while A_i<=30 do begin7 Z) U$ g7 b5 ~; b) w. j
travel to pickaisle.con(A_i)3 B" t, q( [; J( v/ d, f1 i P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: U" L( ^; t: }0 J
else wait for 10 sec" U) _$ P% {+ [$ }1 @( }0 M
if A_i=A_leave then send to die9 y. P4 u) y% D3 z% s
else inc A_i by 1' @0 T% N% O1 F- Q2 H2 k1 [% f
end9 W9 V& ]( ?/ K7 ` r9 F
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,其它按你的 ...
|