|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. j4 q+ j( m. W0 L9 ]% e& E. T1 W6 _. R- L( k) t
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ u. V: t2 b& N& A0 |. r9 J
, `" b- c; N7 N; }begin P_read arriving
4 \3 d6 T( P' p' G+ u* W* K while 1=1 do begin
. P B% a) b+ T read A_tote from "data.txt" with delimiter "\n"
9 o' u% D2 ?9 S q0 W; X read A_time from "data.txt" with delimiter "\n"! \6 `% F5 h0 a
read A_leave from "data.txt" with delimiter "\n"
. [' @1 a( G' b( R read A_picks from "data.txt" with delimiter "\n"
( v8 B$ t4 u" [; i/ t' ] set load type to A_tote1 w- Q" }4 u& \3 j5 g: x. d
if A_tote="tote 1" then set A_induct to 1
4 Y; V9 |- T' u* @7 p else if A_tote="tote 2" then set A_induct to 2. A( [0 s8 h/ _! {* l) F
else set A_induct to 3
0 J- Z) p; b5 c9 J2 z. ] set A_i to 0" C. F& J: z7 j: [7 ~& |% [
clone 1 load to P_induction
4 j3 h- R2 W% l% a% S/ v" |2 r wait for A_time sec
' E7 O9 a- k! l4 L9 H1 ] end+ `$ o; [% M- w% y& b
end& J! R6 Z0 t0 e, s3 O8 n5 u
" |) L6 V" \# _1 G7 j2 S& i4 V4 H
begin P_induction arriving
5 p7 v5 m# P; n5 U" R/ a if A_induct=1 then clone 1 load to P_pick1
2 U- g5 j: m+ Q8 s else if A_induct=2 then clone 1 load to P_pick2
& d4 e% W9 J8 X6 e/ g else clone 1 load to P_pick3# a% ^# X( P, I1 w4 ?
end
: _4 Q ?2 J& z/ s$ `9 m5 E P4 [0 S: z3 j3 ^
begin P_pick1 arriving, Z! ?) W: c3 g$ U! H
set A_i to 1. b* }( b0 l( S. g1 m$ i) ~
move into Q_induct1; [! D$ J2 S, i* z/ p
move into pickaisle.induct1
' r9 t. I& b% z. ]: R8 t+ m0 ~ while A_i<=30 do begin7 k: ~0 r# c. p2 {% l6 C% q4 a3 f+ d
travel to pickaisle.con(A_i)
- S; L! M2 M" P+ U5 G0 d. R" i4 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ j% R3 \3 n3 ?& E' r
else wait for 10 sec
0 r4 B) L$ B4 ^ if A_i=A_leave then send to die- d! ?9 ^3 q6 D: J: G2 m, B
else inc A_i by 1
+ v0 e3 L n7 S* R% B, F0 q$ V- E end
' ]% d. e0 P, m: mend7 |/ f% W, j4 |! a
5 {7 u$ e, M+ T" b
begin P_pick2 arriving0 b$ l7 P+ ?/ @
set A_i to 11
2 V' I( a* U3 i7 o: s move into Q_induct2
, E( p _$ I3 l5 t move into pickaisle.induct29 r3 q" m! j l* x# Q: w& k
while A_i<=30 do begin
6 q' X6 L& G6 T/ K, U9 R, o travel to pickaisle.con(A_i)
' ^* Q% _# J+ d# z8 P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 R) U% b9 q. I5 J
else wait for 10 sec: T- U9 y- Q/ t' F0 h O+ L
if A_i=A_leave then send to die, d% R& X' K9 O/ M& x) D
else inc A_i by 1
5 Y$ d! q* q' B9 k+ q, h& | end' T. r' v+ w4 Q; H. ^
end5 Q7 R% g3 ?$ u- e# R' p1 p1 S
+ M) m6 H7 r5 M! c6 b( d
begin P_pick3 arriving$ X5 t& n; Y4 O, \: |' f$ G
set A_i to 212 s( _5 C9 A i9 Y/ b& a0 t @
move into Q_induct30 h7 _2 U6 V2 D4 z" z
move into pickaisle.induct37 m B5 N2 G5 e |6 d0 m
while A_i<=30 do begin
7 v' E) ^" n) b) m+ C0 k4 m. d8 R* H2 k travel to pickaisle.con(A_i)
) I! F1 u2 S& u1 b0 K if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% a' O* J3 V; j' Y: [& r else wait for 10 sec
* J8 x2 ]7 T3 M, S; s if A_i=A_leave then send to die, C0 i/ c# P/ N! a# e; e2 l
else inc A_i by 1
, d" Y+ \: m l7 E4 g end4 O4 ~. w2 u- j8 a A
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,其它按你的 ...
|