|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 G+ D4 x9 C* m$ \( k' }: q9 u
& b" d8 g- C3 {/ E# A) [# b我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 z" b% J1 a3 f* s) X
% A6 b% X# S, S* D; o' wbegin P_read arriving
, {0 L- N; y# J( I! _4 F" l- Y+ d while 1=1 do begin
# @. i4 L) l# y& a; a5 x; |" r read A_tote from "data.txt" with delimiter "\n"5 G' u0 b6 n; ~- Z3 P3 \; g$ ?
read A_time from "data.txt" with delimiter "\n"
& _1 T9 T8 t. }8 g4 b1 { read A_leave from "data.txt" with delimiter "\n"3 O, b' a3 W$ x( ^' N% J0 a; M
read A_picks from "data.txt" with delimiter "\n"
$ u3 A3 q" K4 W' @- h, k set load type to A_tote+ u% h) n5 }6 |0 k( U# ?% b% ]
if A_tote="tote 1" then set A_induct to 1
. ]: Z- Y: c; A! ~ else if A_tote="tote 2" then set A_induct to 2$ \% M0 Y# |6 ?. y( @. ~
else set A_induct to 3 % x; F9 S j9 S
set A_i to 0
0 o7 Z: [$ V# K4 J) H: S clone 1 load to P_induction0 M/ z6 r3 B2 t8 g
wait for A_time sec, \- l/ P) K( t- l! e
end0 \- C7 ~2 g9 A# i
end
: M' D+ S0 K8 Z1 u# t+ P
X. K" w3 ~8 p8 J( D9 m( G* }2 Ibegin P_induction arriving% w# z1 c# k& ?. J) a- I9 x
if A_induct=1 then clone 1 load to P_pick1
* Y5 h+ D* Y2 H else if A_induct=2 then clone 1 load to P_pick2
3 g& y; Z; `0 Q ` s' ] else clone 1 load to P_pick3. o% K; h6 }4 _$ }" K4 u* o9 z! u
end' t g, ~/ A) I4 t k
/ t; H7 x8 u- y! i' J% Obegin P_pick1 arriving
1 ~8 N7 ?& j! o# p* o3 n set A_i to 1+ U2 a L" t( Q5 q7 G
move into Q_induct1& m$ T/ J6 c9 H- ?/ T$ u' a+ E
move into pickaisle.induct1$ I& X! y# o- X8 ^+ W6 q
while A_i<=30 do begin
7 O5 O% a U+ U% ^' _ travel to pickaisle.con(A_i) ?& D( c3 j0 E$ p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ j! R5 H5 G9 G* k0 E# O+ Q3 P else wait for 10 sec- S' T3 q$ K# ?$ K* L, M+ C8 f. g
if A_i=A_leave then send to die
5 ]& ?( A; Z U- s: z else inc A_i by 1
7 N. C/ o1 ^) s" [6 | end) e( o _! h1 j6 A5 S
end5 M& s0 v9 @. ?4 }1 o
, I8 G- s1 | |" ?. m1 [5 q
begin P_pick2 arriving2 ~% }6 w7 |1 T9 O" |
set A_i to 11& j+ Q$ B0 C3 S, x: Q& r' i
move into Q_induct2; [; C6 Y* E) s3 {$ m4 k2 v! ?
move into pickaisle.induct2
) u' F, k! U0 u# z/ @ while A_i<=30 do begin s; }; |" k: l! j8 V0 n% Y- E4 i
travel to pickaisle.con(A_i)
' l* {0 k- e) t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 g* `4 |2 k3 O5 \ else wait for 10 sec6 G- j' {! Y8 b# p7 S' M! j& J& R
if A_i=A_leave then send to die
: ^* ~% x; Q, s+ } else inc A_i by 1
; p3 G/ V: W0 \4 B1 | end5 P( ] f& i% v- [) x
end
# Q u7 R: U" @6 z) O' {8 s; o4 I: v, l7 F7 w
begin P_pick3 arriving0 j3 }) U2 l' P2 W9 I
set A_i to 21
& @3 ]. [8 V! H, q- d7 h* N) j move into Q_induct3- I" G1 n! N8 r# {( x1 |
move into pickaisle.induct3/ d2 B: ]4 q Y5 U4 x+ x
while A_i<=30 do begin
8 D2 k t- c% G$ Q travel to pickaisle.con(A_i)
2 q! t; u/ _; W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 f4 X0 Y% q% s& {$ J0 m1 e else wait for 10 sec! y6 h4 }& U5 l; A; w% t- P9 h+ \
if A_i=A_leave then send to die
: S# `0 l, Y6 } else inc A_i by 1
. [: d$ t6 ]+ _. a$ H" _, ~1 p4 S end8 k% O/ ?9 z0 R5 q. n* V
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,其它按你的 ...
|