|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! z' }& g, G" x# P9 D
: h8 u* O- O- z7 r4 o我的问题是,在每个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中的数值,不知道会不会有什么不妥。& `/ x2 e9 ]% v! W5 N
1 R1 k' w$ I& Sbegin P_read arriving
$ d* ]: {/ |* X: r( B% ^' p, @% \ while 1=1 do begin& V# F) ^3 a% z, ~9 F* j2 l! ]
read A_tote from "data.txt" with delimiter "\n"
6 D& o [/ H6 P! E+ t read A_time from "data.txt" with delimiter "\n"
2 X! |, q7 S0 l read A_leave from "data.txt" with delimiter "\n"
3 ?! ]: Q) v+ N0 u0 U2 @ read A_picks from "data.txt" with delimiter "\n". ^7 L8 Q* {. q- Z4 p* x
set load type to A_tote
+ ]" E- C* u" \2 N6 S) n if A_tote="tote 1" then set A_induct to 1* B. J- [" \7 l! f2 X
else if A_tote="tote 2" then set A_induct to 2
; Z) k1 l* P; a else set A_induct to 3
; K. R, N! N- Y) l* l) O set A_i to 0
, R% D- p2 s3 @' S r o1 w: w clone 1 load to P_induction" m$ \4 P* g& S) M X: N9 O; r
wait for A_time sec
+ k' X( Z! N8 f end
! J* v, Q" ^( b6 c6 E j6 B7 Z/ Bend
* A n7 x: r9 ?/ g( \
' G+ U, {* J$ x* U" l- dbegin P_induction arriving: T: Y; f4 z' O5 ^+ K/ ]% a
if A_induct=1 then clone 1 load to P_pick1
; {/ C Z$ m. H6 A7 [ else if A_induct=2 then clone 1 load to P_pick25 S, E6 D# z4 m& x
else clone 1 load to P_pick3' i. [0 N6 n! q* ~
end" M, q: d) G7 O% ^
' z* P1 y; X3 v" s0 _+ z# t
begin P_pick1 arriving
' a2 r/ y" O- d set A_i to 13 ]9 F" B4 i6 z/ |6 ?& @4 W
move into Q_induct1
4 X7 x `: W) s" l move into pickaisle.induct1- b/ C7 Z+ s; b5 M
while A_i<=30 do begin
# j% m( h' m% R% v$ X travel to pickaisle.con(A_i)
/ A7 l+ w3 S. h. J* r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 K) m, k* ] O4 W else wait for 10 sec2 o; b& r, ?9 m3 A9 N
if A_i=A_leave then send to die7 j! |) N$ _5 |) ^7 f
else inc A_i by 1' d1 |, g; E$ F+ D
end
4 A# l" K9 K% T( Oend
6 B) Z4 k3 f Z# ~2 t; \0 I# u. ^) W& I1 v, |+ d' x0 p3 T
begin P_pick2 arriving
) u5 k5 G/ l: l' W set A_i to 116 R& V( D% C' G6 N7 B
move into Q_induct20 s* k- V9 L+ h) \
move into pickaisle.induct2
" E* j+ Z' w; ]$ V while A_i<=30 do begin
( h% ~. X# H* v' k3 q/ e# Q travel to pickaisle.con(A_i)
+ ~& i' ]5 z+ ]( R8 r' L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 p+ z$ f8 u2 {0 n8 I8 T: c else wait for 10 sec% d. s" r4 K1 ]+ x
if A_i=A_leave then send to die
G6 k2 ~8 Q0 ~) E else inc A_i by 1
3 P& B5 [% ?. ^) E9 C end0 i, _1 h( N3 B
end
- `/ M& {: P; X, C4 P
. d H% A4 P+ I$ }4 n+ o/ |begin P_pick3 arriving
7 k0 n6 @' A7 Y. Z! k: L# J set A_i to 21
. Y- _- B& w* o move into Q_induct3% ] r6 x8 U/ n& c
move into pickaisle.induct3
0 n: l3 ^ [6 S1 u$ r7 S while A_i<=30 do begin" B! \9 c/ G# j6 V+ {6 S+ @' F8 N
travel to pickaisle.con(A_i)
" u( y: Z% f" x7 q, z7 q( u' j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& r1 t2 |6 Y4 W0 s else wait for 10 sec
, q% a6 B! }( Z9 p- M if A_i=A_leave then send to die
" I$ T# {% S9 f! h else inc A_i by 1
4 V) x7 ~" p# P, Z/ x+ r end& R: x3 K. L/ F: Q% Q7 Y
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,其它按你的 ...
|