|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" ~5 c( _: s! `, q+ e" |, [* `! X5 P t( {3 _8 w
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
( X7 _" l/ d7 r* w; V8 n; y y1 q
7 E, w! p) l Z6 t/ f$ @; y$ J! N3 {, Pbegin P_read arriving+ n9 o5 ^+ J9 [, f" D+ B9 v
while 1=1 do begin
; S' t1 j8 P2 N7 V2 ~7 W7 B read A_tote from "data.txt" with delimiter "\n"
l: R1 z3 g. l8 P+ _' E read A_time from "data.txt" with delimiter "\n"0 b3 g& |: s3 Y8 [. {
read A_leave from "data.txt" with delimiter "\n"7 F( |' @. j8 @: [8 x6 C/ B
read A_picks from "data.txt" with delimiter "\n"6 q& N& ~6 E9 Q( Y# y/ i4 x5 {) }
set load type to A_tote) F+ k. t( S: g2 e0 Y
if A_tote="tote 1" then set A_induct to 1# m7 L8 B* n8 D" ?0 d9 |1 Z4 x
else if A_tote="tote 2" then set A_induct to 2# P& s: [4 _0 G9 j+ ?$ U
else set A_induct to 3 1 `2 X- _; N% a1 ]$ v5 I/ V
set A_i to 0) R' }. Q" z( p
clone 1 load to P_induction* L" j4 w# x' r; A
wait for A_time sec
% }3 q" ^' I0 _- Q8 ] end$ [, ^2 t z U5 A9 M& o' \# H
end$ |6 r$ C$ q, |/ R3 q& c1 \- \
' @8 c5 ^6 d+ A; a9 K8 a% K* Qbegin P_induction arriving
( M3 _# p, N5 _ if A_induct=1 then clone 1 load to P_pick1! ?5 K, ^; u# L. J. ?
else if A_induct=2 then clone 1 load to P_pick22 a- u. H6 f' e! t! w. G
else clone 1 load to P_pick37 b. t6 S0 w Q1 Q- v* V- k. }
end
1 E! y3 J! |8 P3 S8 j, ~, a
% Y2 ~+ g# y) T0 p+ v2 rbegin P_pick1 arriving% [" d6 L/ ]1 u* A2 |
set A_i to 10 V6 r" C! n6 u$ U
move into Q_induct1- n' S8 ^0 y0 c5 E
move into pickaisle.induct16 E! a% P0 I; ^8 L& e1 X |
while A_i<=30 do begin. O, q1 o9 l W1 I* C- N
travel to pickaisle.con(A_i)% \) Z" ~" b5 x' W$ u5 x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 x! `9 |8 I7 t3 V7 ]
else wait for 10 sec
$ T0 t. y$ K% I, r/ [ if A_i=A_leave then send to die
L, W8 R, S* O0 B& z" X else inc A_i by 1+ r4 q0 K# H8 u3 l7 V0 }. u# s
end: w7 n% o' t9 b6 B3 @6 ]% _) C
end3 ^& {) q3 a; E* x
5 R% V# \3 f# J' ]) w
begin P_pick2 arriving' B' |9 F, }' e7 ^7 k
set A_i to 11
1 A' W, u5 v6 c; ]" E* B move into Q_induct22 Y9 L7 c% B! y
move into pickaisle.induct2" a2 i0 L _% L% U; T
while A_i<=30 do begin- k9 n" C4 C8 I0 g" Z
travel to pickaisle.con(A_i)
* }1 f5 w+ ?: `& L if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 w" z% z) \/ @* _
else wait for 10 sec
* W k6 N3 [0 w$ {8 R; n if A_i=A_leave then send to die
- k, }4 o5 j" a+ J* a5 Y+ @ else inc A_i by 1
/ h ^4 T) o, X8 ?- e3 H end e: s/ ]( t; i
end1 h$ z+ v2 [, @, @6 Y4 I
+ D& c4 Z# g) bbegin P_pick3 arriving
6 u% b J( H* o4 l9 G set A_i to 21
6 u' Y: S& X2 s& S8 C move into Q_induct33 u D8 d# k. D# ?5 z% J! ?4 t, n
move into pickaisle.induct3. ~) u6 n( [+ f7 Z
while A_i<=30 do begin, Z+ \0 [% B6 v2 P
travel to pickaisle.con(A_i). o3 r" d# Q' p# _5 e S5 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ k4 \* O% }1 ^1 j# O2 D z
else wait for 10 sec
0 D, X" a8 Z1 d. W) k if A_i=A_leave then send to die4 k1 Y1 z/ \ f- ^8 a; B
else inc A_i by 1
) p7 t9 y1 Z' F, A' F ~ end: ? |) x3 c; q. ?4 w+ H+ x
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,其它按你的 ...
|