|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
1 i! B5 P' u0 V' w9 u; ]4 Y b# I5 p4 f3 Y. ]) P4 q5 V7 \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 m- A1 ? X# Q& s! m$ U* i
q4 b' _: Z, g' E8 W! X8 h+ G6 Dbegin P_read arriving1 g; a2 H3 {* I- d0 c
while 1=1 do begin
/ |% Y! e. w6 \+ W, E; { read A_tote from "data.txt" with delimiter "\n", h+ h9 j* M# d: ~
read A_time from "data.txt" with delimiter "\n"
$ t; s& V) O/ b1 {$ j/ j) u! D0 u7 T read A_leave from "data.txt" with delimiter "\n"
" X4 S- c5 E0 M# r2 R" _ read A_picks from "data.txt" with delimiter "\n": Z0 l2 s( k" ]+ ^. M4 J
set load type to A_tote
5 F5 P+ |/ F, Z6 I if A_tote="tote 1" then set A_induct to 1' t; s c6 ~( T n+ @, m2 L
else if A_tote="tote 2" then set A_induct to 20 D, g' H/ L$ k/ ]4 A
else set A_induct to 3
/ {, y) b% ]" @2 @5 Z, F* [) {3 x set A_i to 0
, E# u5 \: a( i3 d) Y clone 1 load to P_induction
0 V4 H8 r% f9 f+ P6 I) C' D wait for A_time sec
2 s- I' l, A' n6 G end
% ^ V. k. Z2 r9 m$ H& Xend& w* ]' [+ s7 Y4 U! b: G* D0 r& D
' I4 Q& g1 N |6 N' Ebegin P_induction arriving
) i6 o) P3 F8 J8 r) j9 G if A_induct=1 then clone 1 load to P_pick1
! h* z$ E- x+ c4 V* l( b. h: S else if A_induct=2 then clone 1 load to P_pick2* N6 M) i8 K9 N: _6 b9 ~0 Z4 {
else clone 1 load to P_pick35 M# }. d0 @/ Z
end0 d$ |1 `0 g( t/ K: S8 u
4 ]0 e; S6 |" \4 R8 N# |3 C8 K/ Obegin P_pick1 arriving
/ l8 H9 E# a1 O8 l3 b* b8 u8 ~9 r0 P set A_i to 15 \# J/ B$ ?5 l; j2 w
move into Q_induct1
# {- G* N' U4 O7 d move into pickaisle.induct12 {# v$ @$ G* m t ^) n
while A_i<=30 do begin Y, V# |/ ]) a, n% X
travel to pickaisle.con(A_i)
- R. k9 p" c) P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% f; G$ {. H) F/ n p! r
else wait for 10 sec: T/ {* `" l7 z
if A_i=A_leave then send to die" H& ~' V, R; O/ E9 t
else inc A_i by 1
5 A# Q# i4 t9 a) _1 C end
D" ]& i% {: J- y, E$ G) zend: D, G) y7 j# \/ \: O
4 K0 D6 i0 M1 J* b s( v! a6 }begin P_pick2 arriving
2 e( X9 u. \) p. V# S/ n) n7 ]2 Z9 ^ set A_i to 11: ^' ^0 b9 R6 |0 B' } @5 r3 b y
move into Q_induct2
' c l3 l* L; K3 P& e) J+ M) J, }, }6 v3 ^ move into pickaisle.induct2 z5 N$ ]4 S" C* ~/ H0 C% @
while A_i<=30 do begin7 H9 K i/ ~/ i+ f( u0 y
travel to pickaisle.con(A_i)
! W9 S- T2 B* T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 [( {# ]6 z# {. q. \/ {5 @ e0 b
else wait for 10 sec, h, _$ _/ w2 G! }3 J1 M
if A_i=A_leave then send to die& R/ G# Y1 W( y* s1 z' E+ K
else inc A_i by 1* _' m! O( [6 Q2 A4 C$ o
end
8 ~7 T! o" [7 i- y' Lend' e$ ~* G& }1 Q5 g' b
2 q( p1 a" T5 c7 n
begin P_pick3 arriving5 s' {! I' X, G% g: f0 ^9 w
set A_i to 21
( j# S0 a S! H: s* } move into Q_induct3
8 o* Q% M3 ]( ?) y2 c) d( { move into pickaisle.induct3
+ @, Y. d) E7 ]$ | while A_i<=30 do begin
; w/ A) m8 D5 a$ a- A' c travel to pickaisle.con(A_i)2 L/ d$ R* j2 w5 G2 G2 J- f- N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 i. L! P; Z4 ]3 ?6 Y; |' s
else wait for 10 sec4 A `( [; u$ ]$ @% N* l( j# X
if A_i=A_leave then send to die
Q4 y7 Y s) Z; m4 Q/ H" P else inc A_i by 1
" E. p$ e$ B; l3 g: M2 ~) O( s end7 I9 L% p: _( @! ~; Y1 ]
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,其它按你的 ...
|