|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ I) u6 e r2 V* z* D: [8 s
3 w+ A- m# j+ b/ X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- @7 c Z7 s2 ~# e# [) B
3 c! Z( i3 S I; j( K( m; ~5 n4 @begin P_read arriving
: s! {2 X+ R& S6 ~, v while 1=1 do begin
: [. ?- Y9 M& ~ Q read A_tote from "data.txt" with delimiter "\n"
5 r9 }: R; z. c5 z0 E read A_time from "data.txt" with delimiter "\n"0 |* K2 \$ E5 R6 h- @; c2 a1 ?
read A_leave from "data.txt" with delimiter "\n"6 D; j5 M. u& x# d0 n
read A_picks from "data.txt" with delimiter "\n"
) {( Y i, q: r set load type to A_tote
; i/ P) F6 ?) r+ w" E Q: E9 A2 |! ? if A_tote="tote 1" then set A_induct to 1
& J, u1 j% t l5 J5 ]+ k0 H2 Y else if A_tote="tote 2" then set A_induct to 2
, q1 w' p+ Z A/ Z! _ else set A_induct to 3 ; l0 P( s* z* a, i' U9 V
set A_i to 0
: K! e# _3 J- r3 x; V! m6 V clone 1 load to P_induction
* q# ~( a+ Z4 n wait for A_time sec
8 M( }* N2 u6 ?6 [$ F9 l1 Z2 k2 Y2 p end
* O" k" G1 c9 b0 ~$ L3 ]end
7 E0 Y8 l) ~6 i( m. x$ \7 \; g# {$ g3 I9 A$ t
begin P_induction arriving! n, n6 h3 q N# j8 @3 k
if A_induct=1 then clone 1 load to P_pick1, E$ f2 l& q$ ^! o# M3 O
else if A_induct=2 then clone 1 load to P_pick2( z( n) P6 y' q) p8 o) K& D$ ~; P
else clone 1 load to P_pick38 V( [$ q& X. a) T( r$ u" m2 ?% J
end
" }8 @3 _5 U( u+ R6 ]" Z: R$ n3 j& c, F: D5 R
begin P_pick1 arriving
# \. \& I) w( v set A_i to 1
7 L' M0 |5 x) b, ?8 J move into Q_induct1
5 |; P. y8 U y9 m3 l move into pickaisle.induct1
& j8 f5 a. q: t- }9 A while A_i<=30 do begin3 q$ e5 N3 E5 u* x. K
travel to pickaisle.con(A_i); w0 d M* ~2 x4 V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' |$ _( Q7 H6 `7 ^
else wait for 10 sec
A2 v7 g! L1 q5 _* T( ~ if A_i=A_leave then send to die5 @1 R/ L; z k, N6 S2 N
else inc A_i by 1
$ ], j$ x. |6 V/ H7 ?( E3 L end% F4 j" v |$ G
end( e4 T0 {! A u% B) N2 C
+ @2 F! }. F2 J# A) @1 ?, T) D
begin P_pick2 arriving2 o7 _% D" s1 P, J7 x
set A_i to 114 T+ M# z# ~+ v
move into Q_induct2, Y9 o2 u8 j' u% k& ?' |2 t
move into pickaisle.induct2$ w5 k- q! W2 e7 Y5 K' }( Y: j
while A_i<=30 do begin
1 [+ Z; y3 z1 x5 g& Y x8 l, Z travel to pickaisle.con(A_i). f! c7 j3 N$ M+ f* i; h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! e$ M, i# }) z* y" X4 \7 B7 f else wait for 10 sec
8 {5 A z5 A! q if A_i=A_leave then send to die Z+ [- Q* O" j: g3 e
else inc A_i by 1) a! L# q7 X' ]6 w
end$ D4 J8 t) D* W1 A- A- s
end
6 v. X0 H( d7 {; [$ y0 a* S
% o3 H% V+ P$ i8 k3 j3 ^3 Ibegin P_pick3 arriving
7 q/ {3 d* M! E+ ]& D set A_i to 21- a6 n& }: y$ \* D! d+ a6 T
move into Q_induct3
) Z2 B* ~5 M& v, g; q move into pickaisle.induct35 j' M3 D, T3 j4 N3 r
while A_i<=30 do begin! N/ y4 J; A P; a8 E
travel to pickaisle.con(A_i): z+ b( k: d1 X5 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 |! L% N( J6 n* y: ]; _
else wait for 10 sec
+ `5 u1 K3 D, f if A_i=A_leave then send to die' [( M% ~6 t: r5 ^1 G# w
else inc A_i by 1& k% c8 @5 b. Z7 I0 h# G
end
5 u6 \) z; e: R6 i3 s7 k* h- n$ n' ?. b3 _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,其它按你的 ...
|