|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 I' h9 f. h a2 N; O2 `+ l
* L: j; ?; V& h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, S( @/ q$ r# _( X a6 s9 I/ s: C8 C6 |( i, b2 w6 U# C
begin P_read arriving7 G& P9 J$ b2 |% k/ ]
while 1=1 do begin+ I. B: X7 e8 U
read A_tote from "data.txt" with delimiter "\n"
3 N: h! t; A! s" |# M2 f read A_time from "data.txt" with delimiter "\n"
8 \3 `/ c$ |' q T+ x' [ read A_leave from "data.txt" with delimiter "\n"0 s2 \ m4 d0 g' Y6 J
read A_picks from "data.txt" with delimiter "\n"
3 R+ t2 o9 C! Y. J5 u set load type to A_tote
' j2 Z0 S2 f: W if A_tote="tote 1" then set A_induct to 1
, A( q6 U2 g! S else if A_tote="tote 2" then set A_induct to 2: x$ G) y& y" Y1 `8 O U
else set A_induct to 3
0 C) y. f( k5 K5 F set A_i to 09 E5 h8 l5 x, l6 W( x2 H
clone 1 load to P_induction
/ f ^) B$ c" m wait for A_time sec
+ F( I! ]9 V' ~4 l8 X% [& X4 e end
6 t( `; X; N) R0 aend
/ e0 I+ z) o$ G5 [$ H8 z) I2 {8 [! m, W. i4 h1 m9 n
begin P_induction arriving7 Z+ W! T7 C4 b" B
if A_induct=1 then clone 1 load to P_pick1
' Q! n% B E1 O5 U# P8 Y: _ else if A_induct=2 then clone 1 load to P_pick2
3 m8 H" K. f9 L3 H9 _ else clone 1 load to P_pick3( `8 S/ j/ P. _' I, F
end
% {, ?' B5 C. P6 _
* x' x! U. u. q6 ?9 {begin P_pick1 arriving$ U3 ]% E) ?# A3 ]4 u G) S- A& @
set A_i to 1, B, H7 @4 k! T0 v0 s$ ?
move into Q_induct1& V: e/ f, P: k# z" n* E
move into pickaisle.induct1
3 h* q1 \. `. [4 `6 C/ W S while A_i<=30 do begin
9 E& ]: i. C2 A" O1 b U* q travel to pickaisle.con(A_i)
+ O+ p( P4 l& F. C1 k. [7 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 v, P: P2 H2 m4 b! @# c else wait for 10 sec
* d7 y# S" x7 E; T, ?1 t6 r# M; @ if A_i=A_leave then send to die
. D, j/ z. m! ?. ?" }1 s; D e- b else inc A_i by 1
) l6 n* I- W3 H( j' f2 T end8 v' F( D6 w& @$ N/ V
end: p. ?; `4 {% ]6 `5 `
- o, I& m. S. _
begin P_pick2 arriving
6 ]) H9 C; h( \& R$ }; j set A_i to 11
* \! G8 a- }4 I/ }* P! j move into Q_induct2
+ L8 L) Y5 N- x/ l7 W move into pickaisle.induct2$ k9 n7 i* G' x1 J$ D/ a
while A_i<=30 do begin
( w/ \0 o: a: b) R travel to pickaisle.con(A_i)
9 M$ B) g1 _( P8 l8 I$ @5 s6 N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H8 T9 A [0 z6 E4 H5 v4 Q1 V
else wait for 10 sec
6 M5 q4 [* C! a* h ~, L9 ^7 D if A_i=A_leave then send to die
7 Q( b0 L* Q. b, N6 W$ _ else inc A_i by 1
/ m7 g# Y- c1 h& s- d, w0 Z# v7 x end
% O1 _- s0 m! D, ~1 Lend
7 p' H* c3 {7 t! n7 O- N$ ^
( e& G: i- Y; w0 r: ~9 G: ybegin P_pick3 arriving2 f/ Y; C% V( x. t* ~: s+ q& Y
set A_i to 21
+ [2 f) ~% F# {3 O, }* w move into Q_induct38 c" v8 ^1 v. S- C8 U' D% w
move into pickaisle.induct3. z" O5 D: k% i9 }& e+ A
while A_i<=30 do begin/ k: o- H9 s& {1 g& t0 q
travel to pickaisle.con(A_i)- C9 o8 X0 z0 @$ E8 Z5 K2 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. m% c& P- |- K4 D- |1 \
else wait for 10 sec
9 v4 u! `+ q! v5 o if A_i=A_leave then send to die1 I m' ?7 v& ]. }
else inc A_i by 1, h ]8 I7 B6 N( r- P
end+ d+ o. \+ l; ^0 u
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,其它按你的 ...
|