|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 H; [% G6 {) v. ^1 I
$ K* ~/ |, Z1 ]- g我的问题是,在每个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中的数值,不知道会不会有什么不妥。
5 X. B# H/ `$ ~4 L* x
. D! X- B+ |& y$ C1 G2 |begin P_read arriving8 {. A+ n' {% Z4 x0 z6 G
while 1=1 do begin
: P! J' {; W- w6 F read A_tote from "data.txt" with delimiter "\n"
1 l/ j7 c: W7 M4 s1 w read A_time from "data.txt" with delimiter "\n"! \+ m) G& Z# E" g- Z( J" {( G
read A_leave from "data.txt" with delimiter "\n"
6 o( }! W7 @/ P" U read A_picks from "data.txt" with delimiter "\n"5 g7 a/ |! A5 @, Y1 ?4 A
set load type to A_tote. H5 s) K' k( J: v" n1 Z) Z
if A_tote="tote 1" then set A_induct to 1
1 N, V' J/ N, L; T$ w' h else if A_tote="tote 2" then set A_induct to 20 Q9 L2 P+ X: y. h3 D/ M- m9 ]
else set A_induct to 3 + I6 k7 O" o3 V
set A_i to 0
& r5 R6 }, K1 ?) ~1 Z clone 1 load to P_induction
! N% R# E/ r0 C wait for A_time sec
7 R4 C" `/ _- I$ W end: @ p; z5 @" x1 E! S5 t! Z
end. @. Y' V! o! \- Y6 T
0 n0 d7 M# ^" ^begin P_induction arriving+ B6 u; y# V- W- Y0 a& F
if A_induct=1 then clone 1 load to P_pick1
8 P, x, N% a) G9 p5 X else if A_induct=2 then clone 1 load to P_pick2
, R0 D3 D* h. @ else clone 1 load to P_pick3
/ ~5 E, `* c4 M$ s' @3 T4 N/ Send1 F4 o& b0 j: _7 s4 m y# S
/ p; B- S v$ E: Sbegin P_pick1 arriving
; {2 i) M) u# y7 n: n3 N set A_i to 1% m: ]+ y! B0 N! s, V
move into Q_induct16 q; K+ ~! l4 x5 G! k
move into pickaisle.induct17 Z# B( t* B- ]+ q
while A_i<=30 do begin
$ f) V! n( r2 A& f. b) i3 z6 z travel to pickaisle.con(A_i)
( P- ~$ }) V. w% w( R5 a' n if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 D" O7 y5 x# |! F7 A& }* [ k; m else wait for 10 sec' d$ H5 Z. c1 u7 X( ]- O
if A_i=A_leave then send to die7 T' v" t* E# x+ G' j6 E* L$ c$ a4 V
else inc A_i by 1
~& ?+ Y" o% s7 W+ X end6 d& U, X8 E$ `! [' n: O& c
end
- @! V+ n0 r; ~8 o( t
?4 p: e- L+ A* F2 L1 ?begin P_pick2 arriving
4 E/ t% {+ m2 I0 Y1 w- Z set A_i to 11
4 }' `% d( M, e7 I move into Q_induct22 g- e4 v; e% y6 }
move into pickaisle.induct2
) I l' m& L- m' v* u1 N while A_i<=30 do begin
% t& b% }) \) @% p5 J travel to pickaisle.con(A_i)" v3 @- W* E3 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( V; Q; \4 a8 r+ g# n" t
else wait for 10 sec
' f. `& l4 [% L6 j' z. x; W if A_i=A_leave then send to die* o$ }5 ~% C7 N( N. Z
else inc A_i by 1( U) ]$ [6 I" f$ A. H; [5 k0 m! j$ P
end1 D+ i( {$ i& H @
end
# \8 s) z2 Q. x& }! m5 b- C. w+ U2 S! D& ?- @2 R
begin P_pick3 arriving
& E. r- U- O: U+ D* S; X) E set A_i to 21
0 m7 _6 g3 g5 C move into Q_induct3
' |/ q; b$ \3 g) k: M. H; m5 ?/ { move into pickaisle.induct30 T7 U' j$ V; x8 R: ^
while A_i<=30 do begin
: N' q9 _1 f/ H+ z travel to pickaisle.con(A_i)
" q) B0 V, D9 E4 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) J1 g8 @* |" d& F9 d else wait for 10 sec
S0 C( S2 D8 y. l$ ?) Y' L if A_i=A_leave then send to die/ {- d3 }1 b2 \) A: Z
else inc A_i by 1
: C) [/ c. G2 p1 d( X( i: A end
2 T& K, `3 J2 d2 _. k oend |
最佳答案
查看完整内容
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,其它按你的 ...
|