|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 ? ?: m. G) p3 ?8 r+ U4 h! p
2 h# P6 q5 f8 {7 |7 n% 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中的数值,不知道会不会有什么不妥。
& t s) ?" c( p8 E' R
" W- p2 l5 j$ @& M8 d7 Gbegin P_read arriving. R; C2 \. D1 q$ W
while 1=1 do begin
, k" Z: w) g" l% f; } read A_tote from "data.txt" with delimiter "\n"0 p8 k8 }3 W4 U+ \) h0 V# V8 `
read A_time from "data.txt" with delimiter "\n"' `7 o. Z. h* ~0 s& g6 T& ^8 C' N
read A_leave from "data.txt" with delimiter "\n"
( R1 p3 y7 U; } read A_picks from "data.txt" with delimiter "\n"
8 ^0 T; y, Y( f7 d set load type to A_tote
: E8 m8 H6 j! n/ ~% l if A_tote="tote 1" then set A_induct to 1
8 ]" a2 I& W; G else if A_tote="tote 2" then set A_induct to 2
* z9 a! @6 }$ b1 }; N else set A_induct to 3
M1 l& |" a u: i$ I set A_i to 0
8 o; R! @4 Q" S) p( w clone 1 load to P_induction1 Y; j( E/ V6 ~% F* i% G
wait for A_time sec* q+ F d. T7 {+ M! J
end/ r9 G- |! \- [5 d: h: d1 u
end% `5 e, M v2 @1 z. G; i& t
/ f$ T6 N2 @( W" S; R- [begin P_induction arriving
# U }5 {# A5 x' _ if A_induct=1 then clone 1 load to P_pick1
$ H. v) [6 O4 F' E) }% F2 P else if A_induct=2 then clone 1 load to P_pick21 p6 J: v0 r9 m
else clone 1 load to P_pick3# i% |1 _8 [- Z. ^
end
% s/ t( L3 ?2 N3 u3 R- ^! V! J1 ? R9 {# q h9 w2 @
begin P_pick1 arriving, B$ K2 ~! @9 G6 M1 E
set A_i to 1
8 ]0 _' f& y2 q8 f move into Q_induct1
7 C; r ^; X/ ] T$ R; s move into pickaisle.induct1
( u7 E* g% L' J6 K1 Y) _: } while A_i<=30 do begin/ e& C* \( ?/ E0 v
travel to pickaisle.con(A_i)7 { [0 H+ Z5 y! h7 e0 F \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- u3 D" K5 s5 O Q& p) d k4 `
else wait for 10 sec3 z, `: y- t; U. }, `/ y. ]; q0 U
if A_i=A_leave then send to die- m2 \ B; b2 h
else inc A_i by 1' J' ` B; e( _% k& F- z2 j
end
+ L% J5 H! o' W# M0 c; Nend
% o+ F1 b% h8 r2 o) S4 \/ v& _; m9 N
begin P_pick2 arriving# G. S+ K; Y A- y' W" ^* o
set A_i to 11, ` T) N6 P) k: a0 ^
move into Q_induct2
8 N! {/ N* P$ c move into pickaisle.induct2
7 z5 ?/ b3 l/ p! f$ r while A_i<=30 do begin l. `9 C8 R% ^- ~! \9 {
travel to pickaisle.con(A_i)' A" z/ }3 ]8 h k. g. Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 G& A# S. P Z" {/ ]
else wait for 10 sec9 V4 L1 F- _ c2 c& I& r
if A_i=A_leave then send to die5 y k, B9 V1 q
else inc A_i by 1 ?. G/ M- S+ I* p3 S) Y# i
end, f; D" h5 S2 k. e% i
end
" Z2 a) A9 l0 U9 X
) c6 l l9 s; F: R4 v' }begin P_pick3 arriving6 X9 s7 H5 F0 r3 l+ B: m
set A_i to 21
% u! C( ?' p: Q3 p6 I2 c move into Q_induct3: T, g9 ^) _$ J* j8 y/ m1 B' U# o
move into pickaisle.induct3! s8 O7 \2 y9 h0 D) }+ i
while A_i<=30 do begin; F% h, k+ O1 V) d/ `" _1 Y- Y
travel to pickaisle.con(A_i)
" @- T2 I7 U8 u4 o' D' I* y& g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; W0 r; i# M' @: Q8 \
else wait for 10 sec
/ q. o4 z5 A- ?& I" ` if A_i=A_leave then send to die
3 H3 w- M4 j3 ^' X6 q7 \8 t- A else inc A_i by 1
5 C9 g" Q( k0 f/ S+ M1 l9 }5 w; V end
( H3 C# D' T+ ~8 S( C6 ~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,其它按你的 ...
|