|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ?. l; Z, T+ X1 B- }* ~0 e
1 h! c. o' C4 G5 Y我的问题是,在每个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中的数值,不知道会不会有什么不妥。
! P) @3 S' e5 x' T) k
+ j9 N& g' C6 X- C3 V1 Y$ Sbegin P_read arriving; @6 n1 Z9 ^: s: \9 L: B
while 1=1 do begin
- I0 a4 |( c- X3 B( T. n3 i3 q read A_tote from "data.txt" with delimiter "\n", o+ K6 y. m7 g7 }: }7 L
read A_time from "data.txt" with delimiter "\n"
! I* Z' G$ ~9 L read A_leave from "data.txt" with delimiter "\n"
9 L2 @) U5 L' ?. Y read A_picks from "data.txt" with delimiter "\n"
2 q% ~$ U& w- p3 P set load type to A_tote
" A9 Y" [+ e) U% g5 k7 M) r if A_tote="tote 1" then set A_induct to 1
P5 c2 l z. y8 X3 G. n else if A_tote="tote 2" then set A_induct to 2
* A' c) n8 {- ?- K# I% f& ?" V else set A_induct to 3 % E ]& {. ?9 [" Z% W1 b
set A_i to 0
1 x$ D" I" j6 ] y" u0 f' G clone 1 load to P_induction
9 {# A$ ^# V7 J( u! |1 y* k5 R wait for A_time sec! A- J/ Y- ?% `) q
end
# v' _( L: d8 a( D& b6 ?! w5 k% kend
4 H1 A* Q9 Z* n
; f3 K1 M; l) r* fbegin P_induction arriving# S) N' c' o4 \" D- p4 P/ y/ o/ |
if A_induct=1 then clone 1 load to P_pick15 I, k9 w/ L! m# R# i
else if A_induct=2 then clone 1 load to P_pick2
) |- P/ P6 Q$ A5 J else clone 1 load to P_pick3- z k, q) w, J' a; I0 y
end
6 D& d- C* M1 s9 x: r
2 s- q' e6 z# i% r5 Q% [! R0 Gbegin P_pick1 arriving
$ l/ b$ q4 u! Y5 X( C1 C1 Z1 f set A_i to 14 F, l9 L! n# H
move into Q_induct1
/ V) e+ w ~9 p( N4 u+ N! X7 W move into pickaisle.induct1
- D& Y/ G3 e2 j" b6 E! s4 s while A_i<=30 do begin
: D! X* U& G! j. v( z; j& Y* W travel to pickaisle.con(A_i)" i, C5 s! V' y( z0 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 \+ `7 v7 T, `4 v8 X5 {" Q else wait for 10 sec2 T" X3 r8 R: X1 E5 l u) v) N; t
if A_i=A_leave then send to die
6 N. {; U' h$ p4 K5 q/ q% E/ I else inc A_i by 1
3 s, e9 C8 V) W end1 h* d+ w4 a' h5 j
end* i N; X/ d$ U( ^
* U, w- h! m0 T/ p4 n1 g% `/ f8 Q
begin P_pick2 arriving
- s4 |8 P- y0 o4 T( I set A_i to 11
; f6 t# A( W. Q e( V3 S% a move into Q_induct26 S; ~# Y* R- f, B1 o
move into pickaisle.induct2; \7 M7 r; s+ |" g
while A_i<=30 do begin
; V8 D0 H: |/ x; { travel to pickaisle.con(A_i)4 L' C J. ^; j+ j2 [4 W1 E' @$ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& n1 R9 K7 x5 Q P- V, l5 x7 W
else wait for 10 sec5 e1 i* u( o) p' R; g2 o
if A_i=A_leave then send to die
5 k+ _9 Z1 @% W9 Q" [6 r, B* N else inc A_i by 1
, r# K2 L: N( x5 x- D* } end
: j! N- r2 T* K9 O+ V7 Z) zend
" k7 K6 [' c/ r: m9 p: L. D/ ?5 `
begin P_pick3 arriving
+ D! n+ X, A* M4 ]8 z' M set A_i to 21' H2 h9 d3 J, L- V
move into Q_induct3; D5 Y& r1 \& p* z2 H& [
move into pickaisle.induct3, Z6 `% b9 q- x& A, f6 u
while A_i<=30 do begin. V; W6 \' W! T
travel to pickaisle.con(A_i)
5 ~+ W- T+ @& Z( c1 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ C, x" p- E% o% x+ `0 q5 j' V6 T5 M$ c
else wait for 10 sec) i2 s/ _) m0 N
if A_i=A_leave then send to die
% _, ~, f* j* _4 @ H else inc A_i by 1
3 v. ?: O- Z8 x- x+ ~; M end) Q. @, d2 ~, a% n
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,其它按你的 ...
|