|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 i) Z0 z0 R; c' ^+ a
$ x- P, H+ v( C7 D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
N0 T8 c& D2 f8 ]1 f+ x9 l E9 Z4 e; A! z6 M2 r
begin P_read arriving+ z4 R2 Y8 R3 \
while 1=1 do begin
3 R# t d Y" F2 e! e: r read A_tote from "data.txt" with delimiter "\n"
5 K: h# K |; s# N) V read A_time from "data.txt" with delimiter "\n"
% j) H7 k/ h9 {" Q& L3 B read A_leave from "data.txt" with delimiter "\n"
7 l3 U6 F/ y) ]( Y; V, |, e read A_picks from "data.txt" with delimiter "\n"
) ^: R# |0 N$ T4 z1 z9 C4 N! f set load type to A_tote, @" d- V4 L' w- F, f- |
if A_tote="tote 1" then set A_induct to 1
* x1 i" S) g. `7 L/ |( J else if A_tote="tote 2" then set A_induct to 2; r% V( C. z$ a' B" q
else set A_induct to 3 7 o' L9 {$ Z7 C2 N! B) s
set A_i to 0
0 x3 N! ?% M. B7 c7 U& V9 R clone 1 load to P_induction; S8 D/ P) j) r4 A
wait for A_time sec
: C& p' w v6 ?" a8 m3 ~ end# s: x. f4 W# w* c0 H+ E- w
end
[% S9 v1 l, ^9 q$ k0 A7 J3 A! D& t, T$ U. V8 {
begin P_induction arriving* j1 `: a# l* B
if A_induct=1 then clone 1 load to P_pick1: g4 K" s3 h" O% I
else if A_induct=2 then clone 1 load to P_pick2
* L1 f @5 i- y else clone 1 load to P_pick3% T. Z1 \; i3 p4 C q# Q
end
, S* @! v; D/ S; c+ {
6 {/ R! [: A' z. }0 pbegin P_pick1 arriving
" {# R4 U3 W, A3 N" \ set A_i to 1" u& z; K7 L! s. O
move into Q_induct1
' T, {* {$ b2 _ move into pickaisle.induct1
/ |+ X: p1 x- L- ~# x& G& f while A_i<=30 do begin
9 X- w N- o! V/ j travel to pickaisle.con(A_i)
$ c" h' U& l" o3 O! I' G! p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 |4 e% O9 n/ |: D3 v
else wait for 10 sec( U* z5 C* N; k& S4 \
if A_i=A_leave then send to die
# i: p" y; I* ^ H# ^ else inc A_i by 1! I0 X- @% ?6 q5 V9 D
end% j! x' l$ v$ u; k
end
# x, J6 l8 P/ B# S6 \; ?3 \
7 ~$ H! d, z* c Z+ S8 pbegin P_pick2 arriving
! I: K M1 G1 K% X+ w5 N set A_i to 11* C0 y; H' W) w" `9 U% I
move into Q_induct29 X v) h, l/ j |. U, U5 s3 B
move into pickaisle.induct2
3 K& J) @" i1 [/ f while A_i<=30 do begin; I. J( P0 z8 J6 l( V$ Q2 M2 N/ [' D
travel to pickaisle.con(A_i) b0 q% i" M0 k) \, w) Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, f1 D7 m9 C R: z3 q. \
else wait for 10 sec
# F# T) V9 k& g$ N5 z' @( S if A_i=A_leave then send to die
$ r5 ~! U# Y0 [ else inc A_i by 18 ^" l; P/ I& \% s9 W# a
end5 U5 U( s3 g& q* a1 }
end; x+ i6 X) M. N, Q
t/ I+ P% v2 x+ }( ?
begin P_pick3 arriving4 d i! {4 m! t' w! Y- M
set A_i to 21; W6 |( I3 ^' w) o' t0 A
move into Q_induct32 Q1 ]: W7 t( _& ^6 f
move into pickaisle.induct3! B1 D) X6 T& Y, x& w% |! G
while A_i<=30 do begin
* o- h; |( o" C. o5 D travel to pickaisle.con(A_i)6 u: j+ o1 o- P) n6 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ a) r9 n Q+ r+ ]5 i
else wait for 10 sec
( _( w, S l, b if A_i=A_leave then send to die! o3 n, v: O7 Y E
else inc A_i by 1
( I1 C' {) J$ \1 A+ k1 @' ^! s8 x1 K end" P; j) e- v! S1 ^
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,其它按你的 ...
|