|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, X2 O" G( q0 V$ H, v0 j
& B7 g. X& E' c2 C4 z/ L( R我的问题是,在每个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 F, H, R3 M/ i9 n; u# c
8 K [9 n: A y" o0 M$ Dbegin P_read arriving8 Z) Y0 _7 N# k# E( D
while 1=1 do begin3 w; t b! H) ^: f, I( O* P
read A_tote from "data.txt" with delimiter "\n"
: K) s+ }. i# M1 O N7 s+ A: Q read A_time from "data.txt" with delimiter "\n"
2 X$ g0 D8 Q8 U, U read A_leave from "data.txt" with delimiter "\n"8 A$ ?/ ?/ }" a7 x* J' M) u$ r: G, u
read A_picks from "data.txt" with delimiter "\n"' M& [( ^5 Z% s. h! h
set load type to A_tote$ K4 |9 E1 f7 a9 B( Y" u
if A_tote="tote 1" then set A_induct to 1
% z% ~. t C+ A; t5 s1 t T else if A_tote="tote 2" then set A_induct to 2$ b5 E% K! {7 r' W
else set A_induct to 3 8 }, C% i! g' ?7 W
set A_i to 0% H, ]' S7 G6 T
clone 1 load to P_induction: T5 t/ K' e8 [: J- T. N
wait for A_time sec
: d: x7 y; y- [7 n* t ], V! r end
- o: B' F+ j- r* i3 Zend& v! T) c* o- A% ~/ k9 r
) k, B( l9 O- E8 r$ @5 r6 Zbegin P_induction arriving
9 U- b. G4 W3 @" S if A_induct=1 then clone 1 load to P_pick1
8 j5 k( n$ h j. D else if A_induct=2 then clone 1 load to P_pick2
8 @0 d; v. g2 r& X; K else clone 1 load to P_pick3# k4 x8 ~0 G6 q# x! p
end# [1 ^1 c5 v, x( x! i( r
( L# S3 }, J* ^) f! J
begin P_pick1 arriving
: q0 H! D @' m" Q# C set A_i to 1 [6 _% c. u u) h. X! C. T; X
move into Q_induct1
( @8 r3 |, F3 _ B move into pickaisle.induct17 N% u( J6 y" P. n
while A_i<=30 do begin
2 d2 p, c5 _/ V% K' M travel to pickaisle.con(A_i)) S: v- Y8 B6 `, X$ u
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& L/ L7 a$ E& a5 a
else wait for 10 sec
: K) i* d. f0 u7 T0 q% J if A_i=A_leave then send to die2 u: V# H8 X3 s( Z6 A
else inc A_i by 10 x- D' y* H8 b4 R; @7 v' Y9 n
end
/ g. y, j# p6 x4 Z* d9 l* D' Fend
6 d4 [! ]6 h. N' H7 V: V
- K; W. l- |, ~1 Z1 }1 S0 abegin P_pick2 arriving
1 Q- O6 o2 C; [# H) ~$ U set A_i to 11
- ?1 `( z" o4 j4 w! I( |$ k9 k" a+ C2 i move into Q_induct2
+ P6 e0 b. {% u6 ~ move into pickaisle.induct2
& E% Q$ R5 v* G3 F while A_i<=30 do begin
# |* I7 j- {& ^) F4 l# r travel to pickaisle.con(A_i)4 K3 _7 Q0 ?4 D6 f$ Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 @8 m i8 J2 `4 _6 q$ _7 O( b0 P
else wait for 10 sec8 O9 O8 H2 Y: Z) ?
if A_i=A_leave then send to die
/ c! p( e/ f$ K/ O7 b8 t% [ else inc A_i by 1
6 k# ?" z* h$ r% @ end
- c* s' c# @, M: C1 v& c5 {& i+ L! u2 Pend% A3 `- ~, r) M* z/ j9 R9 v+ m
" \0 D6 o+ E- {+ v7 e, hbegin P_pick3 arriving$ Q$ Z, G. s0 ?. ]- i& f( a
set A_i to 21+ ~; ?, I" _$ |: W! v
move into Q_induct3
3 P1 {+ o, z) N ]( U* I i move into pickaisle.induct3
. t3 |( {7 F& _. b7 A+ ~& R5 ~ while A_i<=30 do begin
# |( t& C w: m) V! M- l! n" V3 J travel to pickaisle.con(A_i)
* L* b0 q7 l, k7 m) t7 W0 X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 i7 Q4 \+ f. r0 l( _4 Z3 p else wait for 10 sec
2 H. z1 g8 c1 k: z if A_i=A_leave then send to die' P7 O( \6 l% v3 k
else inc A_i by 1
7 t6 l+ `% K- k3 B end+ m; u% ?' q. K) J4 ]7 r
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,其它按你的 ...
|