|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ~" J. F8 x( M5 n1 a+ v# X. @3 R) |' O2 p$ {' x, P
我的问题是,在每个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, ` E9 c" V) y9 M1 \7 I3 ]- E U) ?4 J$ B; m- D
begin P_read arriving% Q- X& a$ W; H, x3 N* U
while 1=1 do begin5 `% Y- Y' p* A* M7 n; B& \
read A_tote from "data.txt" with delimiter "\n", {) X+ P% F6 a
read A_time from "data.txt" with delimiter "\n"
! J$ \0 _" B& [9 y8 \ read A_leave from "data.txt" with delimiter "\n"6 T n/ }/ k' a* Z# N2 S9 `' O
read A_picks from "data.txt" with delimiter "\n"( i/ H% z+ h3 b/ |
set load type to A_tote2 `7 b% t6 \% W0 l7 T8 U
if A_tote="tote 1" then set A_induct to 1
; L! `3 }, y% a- L) m* G. c else if A_tote="tote 2" then set A_induct to 2
" R( r; t* K: L# ^1 K( I( P6 X else set A_induct to 3
2 ^: g5 b3 d; t ~ set A_i to 04 t" h0 b; |: S& n6 r$ ?
clone 1 load to P_induction/ n5 V$ y& C* _1 W6 b' G/ K
wait for A_time sec
* k5 u5 @0 W8 i* q4 [: a end* r7 m' j) h+ T3 j# W
end
8 U/ [$ v x4 H: X! X
/ i! X& |* t% F; D i7 Ubegin P_induction arriving- _3 [2 E: `. w4 g' g; c, a/ r6 [4 f
if A_induct=1 then clone 1 load to P_pick1
' x3 _9 ^5 e& H9 u4 I else if A_induct=2 then clone 1 load to P_pick2
1 R! w6 d$ K2 l8 c2 e" w7 L' j else clone 1 load to P_pick3
8 A1 n# s. Q2 y6 Y0 o# _end) Z% ?7 P4 y O, ^9 z
; r A5 q- w: i0 D8 u4 s. r% Jbegin P_pick1 arriving
, ]0 s) B, q8 u" x4 f set A_i to 1: O v1 y; M- E4 J
move into Q_induct1 S1 l" j1 t1 J9 z) A
move into pickaisle.induct15 L' `6 c* X: w$ R. u8 u
while A_i<=30 do begin
) w$ R# x' e- z( A$ G- [ travel to pickaisle.con(A_i)
/ P5 {6 i# ?: q0 M) z1 J/ A- I4 v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) B @, d! W! T. m- c
else wait for 10 sec9 o4 Z+ @2 l; \
if A_i=A_leave then send to die7 \" F5 {1 C9 |$ N& Y
else inc A_i by 17 v: b0 _# r7 m& h% x8 u7 n
end$ R: }1 R- ]6 k7 h6 P3 t: \
end
# W" o+ r+ B/ c3 {' Y
9 Y+ B3 O. V, k6 q3 H; Pbegin P_pick2 arriving# {$ h+ P/ R5 w# u
set A_i to 11: p+ i: W% J' r8 B4 R- d: y! R
move into Q_induct27 y8 S) c) [: y5 P2 T. \
move into pickaisle.induct2
( t& Y3 Y: a. } while A_i<=30 do begin4 x: P8 m& }# c
travel to pickaisle.con(A_i)3 B. G- y( R0 X8 G( v9 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& H0 N: f4 J3 |( O% k& x* V
else wait for 10 sec
# J8 I# ?8 a6 z' ]4 L if A_i=A_leave then send to die! b5 c- W. R' l) F0 T- P! [: h
else inc A_i by 1
+ V. M4 ?% h$ C& M' B end
" h Z, e, Z: u% H& j' tend
) V( y8 K8 ]* X1 T
+ U* D* e/ x7 L( K2 n4 G- Hbegin P_pick3 arriving
- P/ `, w0 M/ d' r( @0 P set A_i to 218 |) T" W5 T" y# W0 H* O+ u
move into Q_induct3
3 y9 i+ F( y) y& c3 I move into pickaisle.induct3
4 t" o Q- c- z" j while A_i<=30 do begin: Z& G4 T/ }$ o3 ?) I
travel to pickaisle.con(A_i)
' A5 f/ q# F/ D* N3 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i8 x i. H" q" I/ L: e+ P
else wait for 10 sec4 h% t# Y/ m# x* Z4 c& \3 k
if A_i=A_leave then send to die- o; I+ f p x* m/ \
else inc A_i by 1
_3 C( N: Z6 a+ J2 M end
1 H1 ~: o9 S* @) ^9 {" F; z1 zend |
最佳答案
查看完整内容
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,其它按你的 ...
|