|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) c7 ~9 I* ?6 p( t, K; s, B
2 `0 e0 o& q/ h. k: ?2 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中的数值,不知道会不会有什么不妥。
8 @5 S/ H' F5 |4 ]+ z, {; c: V( z$ r. Y8 M ?+ `. L) [. |2 e
begin P_read arriving
( U: J P, S; t) I# ~7 M) y0 G while 1=1 do begin9 E! v2 k& C0 h& m- Z! |5 i
read A_tote from "data.txt" with delimiter "\n"7 _, y! p$ z0 E
read A_time from "data.txt" with delimiter "\n"/ A2 S7 `' `0 T. E
read A_leave from "data.txt" with delimiter "\n"
6 Y* J- k/ v" y- i" { ? read A_picks from "data.txt" with delimiter "\n"
# x, }9 K6 ~; x9 H% q9 c set load type to A_tote
; m g. H4 N; Y3 X$ ]# Y if A_tote="tote 1" then set A_induct to 1 x9 | W) F4 T M" }. a( D Y
else if A_tote="tote 2" then set A_induct to 23 W& y% [5 f8 j
else set A_induct to 3
) t3 I8 T* [- O D4 O' G; T set A_i to 0
7 N9 G0 E, F. l clone 1 load to P_induction/ Q' U/ A: q7 J. E+ k1 y1 z+ h D% ?
wait for A_time sec I1 o4 r' F- S7 Z
end
2 w( P/ z- f3 n' I" I% X; }end
; h) A( H. |: E0 s5 g; v ^; y0 D' {# K9 S6 H: J& P
begin P_induction arriving% Y, u6 C3 |, ~# V
if A_induct=1 then clone 1 load to P_pick1
) f: G6 |) p( r* L else if A_induct=2 then clone 1 load to P_pick2
, C1 \/ W6 ^1 M& K else clone 1 load to P_pick3$ \# U5 E1 g$ H1 t9 Y9 x: [
end
1 r/ L/ E) R7 ~# p( I- t- [2 U$ O
begin P_pick1 arriving
1 [- C, i2 J$ d ] set A_i to 1- d$ u" Q2 w& D4 p
move into Q_induct1
5 S" u! {+ a; P' L/ C; m move into pickaisle.induct17 J8 R' z0 X/ z& b
while A_i<=30 do begin
; N/ `4 B3 L- t% y* g t travel to pickaisle.con(A_i)
6 l! Z. i- O# X if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# V I9 ] m* R, t3 g& } else wait for 10 sec- j2 D# H6 k- X4 E$ h# P
if A_i=A_leave then send to die
& f6 c( v$ b3 D u [8 q else inc A_i by 1
; O4 n% j/ C8 q( y; l4 V2 E- Q9 v end- R* f: Y- b/ m+ {: s
end0 J8 J0 l3 Y& T, y1 t( V+ _
* R7 e1 ~7 [5 T# V7 A* hbegin P_pick2 arriving2 b: g9 D: ]' C+ c) Y0 `
set A_i to 11
, i! y) C" m+ r$ d move into Q_induct22 l ]5 s$ q' A* C8 v
move into pickaisle.induct2
% V. j% ^0 p9 m7 i! y5 M$ [3 w while A_i<=30 do begin6 v! D M- ~6 A+ j- S. W7 S
travel to pickaisle.con(A_i)4 r" r- l! ^3 G4 [; B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 U3 q0 H- {2 |7 D
else wait for 10 sec) K1 e3 |7 n! \( G: T# n ?
if A_i=A_leave then send to die6 |3 G. `9 u7 [9 {- Z3 p
else inc A_i by 1
2 Z; n8 m3 s3 L& b end
$ K5 L2 W& F3 ?9 t+ r0 t0 M/ nend
3 e. t- o# V8 K- e* Z# h* W; y
, _$ Z1 m* D7 y& y% Tbegin P_pick3 arriving7 Z4 I2 ]! S' u$ E! z; c* [
set A_i to 21' k) X( u# C$ j
move into Q_induct3/ B; Y3 I- N5 v6 i
move into pickaisle.induct3
- V, @0 Z- }$ M V while A_i<=30 do begin0 w$ m1 I5 q, H' v( Q, z3 O2 E
travel to pickaisle.con(A_i)9 W+ | M! |% F" `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ a1 G" `6 F. M3 O4 c0 @) k* y else wait for 10 sec6 Y* X# G: Y/ P6 Q d
if A_i=A_leave then send to die$ k& h- Y- S C2 S
else inc A_i by 1
: s# l Q# V9 ?* B9 q8 o* M7 d& ~ end; e% P8 Z% _& e/ i. j2 I1 k9 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,其它按你的 ...
|