|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, _. q# C! f& f" i0 s1 c; n; |% [( n* V! e; ]
我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 @6 ^, ?7 G6 z5 h" K2 ]$ ]! R5 `
( x9 F" q% i' ]3 }1 _" Tbegin P_read arriving
% Y8 c2 F( M0 B4 m while 1=1 do begin
) |9 q, j' z2 f' O; w9 @+ N read A_tote from "data.txt" with delimiter "\n"
2 f Y2 K& Y0 j; a! x( Y+ g/ ? read A_time from "data.txt" with delimiter "\n"
; V1 R1 }. M4 _3 _! \8 J read A_leave from "data.txt" with delimiter "\n"5 c( c0 @4 L7 D6 @, F$ n
read A_picks from "data.txt" with delimiter "\n" F0 f: P* a/ g$ {4 ]
set load type to A_tote
: w" U3 T% ~# m- n if A_tote="tote 1" then set A_induct to 1( _- }8 \; U( M Z5 B9 _
else if A_tote="tote 2" then set A_induct to 2
5 l: G. T- P4 e' h. q5 C else set A_induct to 3
4 s4 g8 w& g% q6 L0 i* @ set A_i to 0" ^6 g% z2 S9 y, \7 e2 q* K$ v
clone 1 load to P_induction
R# H# [5 X3 q8 f wait for A_time sec+ Q9 e: y, ?, K( {# ]
end' V0 }( ~8 O/ p6 j
end3 q e) o. L- ]2 V* W' c- n/ j
* U `) t& K3 Pbegin P_induction arriving
' j" h& R% C" ?; B* Q; H. f if A_induct=1 then clone 1 load to P_pick1
# Y. w: V0 l* ?7 B) G# \ else if A_induct=2 then clone 1 load to P_pick28 t. X t) a# j( M
else clone 1 load to P_pick3
: X: @+ z; O, e/ t* vend" u" W4 [. ] Y6 T3 r* v
2 L9 \! B A" E) Z* ~. ?" {
begin P_pick1 arriving6 \& M; `0 H1 S, h2 U4 {
set A_i to 1
5 z. K' B) w0 p9 m/ v+ F7 J: @ move into Q_induct1
$ U% ?! v3 }' y move into pickaisle.induct1, T. G# R; }2 r) C6 {
while A_i<=30 do begin9 C# [/ q9 V: k3 o+ s
travel to pickaisle.con(A_i)4 \6 u' m1 k w0 G" {+ m' J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 c+ M$ x# T! r6 T else wait for 10 sec X# C, P7 ]0 x$ ]& g9 S
if A_i=A_leave then send to die5 R' `7 u2 f0 S l
else inc A_i by 1
/ O( i8 Y: u2 m# C' h end
6 _! L; h. P$ p& wend
, f2 t) N; ? z) u# x$ I! F1 f* G) }2 x- L
begin P_pick2 arriving
" s; ?! r9 r% y6 o+ {* m/ u7 a/ i set A_i to 118 M, G0 S% a% Z( O
move into Q_induct2/ O) r6 M0 s+ y. ~& h6 K/ d
move into pickaisle.induct2
6 K0 S; w5 z# A& n$ _ while A_i<=30 do begin
9 A% k4 s( T5 l travel to pickaisle.con(A_i)
, N0 Q/ K4 v( ]8 g- [* y, ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 h( m1 Y0 W; D/ F5 T( G else wait for 10 sec
/ _7 m1 ?% c$ h) ?* Q6 P if A_i=A_leave then send to die
# z H7 m0 ?* x1 D else inc A_i by 1( g6 P5 _2 {+ ^9 f' M- `
end
& {8 ^* u j( q3 _5 b7 Xend
% Y. T: x1 J' I
# R* o& F: q9 q$ |# Y4 v2 h9 D, [begin P_pick3 arriving* G& e" w0 t% \4 `4 a7 p- o
set A_i to 21) J3 L$ y/ l4 ]& ~) _: w# ~4 {1 l; j
move into Q_induct3- q8 y. k, P4 X6 }* h
move into pickaisle.induct3
U* J5 R9 C" S while A_i<=30 do begin
9 \* ]$ W* l7 Y2 S) D travel to pickaisle.con(A_i)' m! T, u. ` {9 Q3 D2 C
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec L4 `0 b6 T: P, j7 @" M; D
else wait for 10 sec
) _8 p* r$ c* e& M if A_i=A_leave then send to die4 U* `) W, d, a- s8 I' Z; w
else inc A_i by 17 n Y) J. y: p ?, a/ f5 |
end
! E2 f3 B2 |) h. N5 c5 `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,其它按你的 ...
|