|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, Z o% s8 X9 i% s) L- u/ I0 T5 L% {. C) f( ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( F1 k0 `' F( A4 q3 z6 n
& H- S& } E: Z8 K5 ~begin P_read arriving
) f2 @5 o% n) b, F2 O while 1=1 do begin
) o' ^3 M: O) ` read A_tote from "data.txt" with delimiter "\n"
0 s% o5 b4 _0 I5 _! a read A_time from "data.txt" with delimiter "\n"
% H1 T9 @/ |, H! ~# h read A_leave from "data.txt" with delimiter "\n"0 Z4 [- I2 b# S9 U
read A_picks from "data.txt" with delimiter "\n"
0 k) x# P: a; |( V: c, q% S" B& S: w set load type to A_tote
& q% b3 b1 l& g6 i% e" d' d0 J if A_tote="tote 1" then set A_induct to 1
( y" c2 R" H+ A7 b, Y+ ~ else if A_tote="tote 2" then set A_induct to 2
4 o" t$ P3 P9 b# p1 G7 h+ Z else set A_induct to 3
1 t8 Q8 l. a. {- W' \9 M set A_i to 0
7 O9 p. c( B p0 q$ H clone 1 load to P_induction
9 G/ Q k1 D$ x/ E) T/ b wait for A_time sec9 e& U2 x) r( z P) p) y
end
0 X( E! ^2 v/ P, t( O: ^end
/ ]( y" e( U. Y0 ]# }+ o- W3 U; Q6 k* U- t( \
begin P_induction arriving
1 P% x9 D8 y, Y+ D- T% _$ Z if A_induct=1 then clone 1 load to P_pick1
( E E! ^4 l- H3 Q3 S else if A_induct=2 then clone 1 load to P_pick2+ ^# c0 C/ p7 H- V6 W
else clone 1 load to P_pick3. O4 r/ D6 Q h" l
end
8 B1 W# R" `3 x
7 e0 u0 z- X9 n& mbegin P_pick1 arriving
2 P2 R9 d" x$ y* O% o( m R set A_i to 17 W1 E ]+ j& K' z
move into Q_induct19 I1 I4 R o. N/ ?; e
move into pickaisle.induct1* U$ h7 ]& X+ H) J4 f6 H
while A_i<=30 do begin' s g: S, _" G; c
travel to pickaisle.con(A_i)
$ P$ C( k. E! P' M' |5 _" ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% t' T% q# q0 ?: i
else wait for 10 sec
- O+ A3 m% Y" v9 X$ d if A_i=A_leave then send to die/ Z5 H* q2 M! W/ K: A
else inc A_i by 1
/ O0 z }7 b8 |. u" i* K end* S/ J+ U+ o' o. U; |
end
# Y$ m J- F( u
+ F/ Y7 R) }3 B) Dbegin P_pick2 arriving* P% h4 Z% o# s0 O4 E6 A ~0 c
set A_i to 11
$ ^1 Q0 |& s& E; x move into Q_induct2" c- R" Z* d2 |1 s4 z
move into pickaisle.induct27 ?- _! \1 B3 \7 l) Q) O
while A_i<=30 do begin
' y- L o* d) B/ z travel to pickaisle.con(A_i)3 C7 I5 x7 f0 J9 \. B; `) E/ _, ?$ `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ D) q- y2 @. C6 z% J/ Y+ F else wait for 10 sec
; x4 d' a2 v* R6 P$ C, F( L if A_i=A_leave then send to die
6 N7 B, ^9 \6 c else inc A_i by 1
2 b5 G+ P' c2 v2 G9 M' x" x' K end, x8 H/ O- A, B
end9 d/ X& Q& s5 A1 S9 t
$ d( c1 X$ j# N* }/ B
begin P_pick3 arriving
6 I9 y Y. W5 L& R( O set A_i to 21, ?5 x- M# u% Z- d; H" ~
move into Q_induct3
; c: r; T k! [- Y5 h move into pickaisle.induct3) I" k* j6 J; @# `
while A_i<=30 do begin
{. A0 r Q5 J6 [. M- D travel to pickaisle.con(A_i)
% C7 h0 M* f, u/ ]: V2 A# Z& F2 Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z4 Q2 D: u) S: y
else wait for 10 sec
! b$ k, p, i8 f; \# l2 @ if A_i=A_leave then send to die. ]& L$ n( N$ L1 X! M/ o3 p
else inc A_i by 1
! ?: r) B$ s, W* S. t, B) p& Q2 o end% `$ e, x( ]1 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,其它按你的 ...
|