|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
! B5 ^* z5 ^4 H& w9 }
9 E+ i3 M7 B$ B9 q4 q' z我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& G! p8 |1 e5 }. S( V6 C0 b9 x+ h$ O" r) I. P5 \& X" _# F
begin P_read arriving0 P7 ~( z, t6 b N# ~, M5 o) W
while 1=1 do begin
) ]( P) E: K5 n. b% \7 _- v read A_tote from "data.txt" with delimiter "\n"( a2 H& D- ^* W4 q" p
read A_time from "data.txt" with delimiter "\n"
' U' d' E; E( z read A_leave from "data.txt" with delimiter "\n"
6 D$ h3 _. F, J! e% x( l2 X4 b: J read A_picks from "data.txt" with delimiter "\n"6 N7 _* [/ K' b3 H$ s1 l
set load type to A_tote2 k+ N3 [3 \! {/ G, [2 x$ c! Y
if A_tote="tote 1" then set A_induct to 1
8 X' X- i" |2 g! ~ else if A_tote="tote 2" then set A_induct to 20 v: w9 s: S9 {- s: H
else set A_induct to 3
+ z$ C6 E% `& V* X' ?8 P: X* _$ f( x set A_i to 03 x4 i% T9 x) G0 _
clone 1 load to P_induction& {: d4 P% R% W, |
wait for A_time sec2 t9 W& N7 }/ P& F) y" ^7 |# ^/ L. A
end; O0 c4 _) q. w0 O2 j' X
end# b( L8 N7 Z: P0 i
: M' K; |/ ^3 Z0 H" x2 zbegin P_induction arriving
. S# q$ L2 _0 m" A8 X2 A* R8 E6 g if A_induct=1 then clone 1 load to P_pick1
7 A L% U. K% X1 h5 e. e else if A_induct=2 then clone 1 load to P_pick2/ {0 n3 f1 p$ D) `+ Y9 Z; j, K5 T
else clone 1 load to P_pick3
; u9 B- ^1 u1 j# D) f* H+ cend
1 A: ^# \8 U! w9 ]/ K" S$ K9 a8 i: y; `/ ?; g2 Y
begin P_pick1 arriving
7 \5 x' _% ^4 n set A_i to 1) l% w& O! [( ?* `1 Q
move into Q_induct1
8 C( i. u @% z/ Q. G, C7 h1 c move into pickaisle.induct1
* L' C, r7 C' i$ F( V2 S while A_i<=30 do begin
, R! x U6 G# i4 i1 P travel to pickaisle.con(A_i)7 G" y$ Z) h0 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ B8 ]' w& [# f# M4 e8 \( w
else wait for 10 sec& \4 X/ M: X3 ~3 V. P
if A_i=A_leave then send to die: Z F( V0 J, L* P
else inc A_i by 1! b% v7 M. C8 s: ?4 Y4 }1 v1 }: Y
end% D, s% v" i( r; _; Q2 u
end$ e6 @; y$ ?! y) f- U6 Z2 R
4 ?) I( O, R$ S# N8 s! {4 K5 D% D
begin P_pick2 arriving
$ S7 G! x4 x- E; j7 u+ T. i# G9 w. X set A_i to 11
" X; Q; [& c) z+ n3 U8 }; C move into Q_induct2/ n J# M% N; y7 {- U$ K! O: `
move into pickaisle.induct2
8 {* `) a- m6 d0 I while A_i<=30 do begin0 W& j+ j- [' u6 q
travel to pickaisle.con(A_i)
1 K( w: i+ G* L0 T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& D% Z7 H9 \( t2 n% A9 I
else wait for 10 sec- \: w( A( V Y; d( u0 O8 l
if A_i=A_leave then send to die; ` V, s& ^8 r, j5 D
else inc A_i by 1
$ \. Z( r, ]! {- C end: \ x' _6 Z1 Q5 Q$ ^! T4 N# n
end
% r ]9 v7 s$ L6 C8 T& J0 e+ D7 C5 ~3 H( `( q/ ]1 D* q W& b) h
begin P_pick3 arriving
6 U% y7 w1 P; e set A_i to 21 c5 c7 w& ?4 |: j3 a
move into Q_induct3
& u; C0 i9 E1 n- M5 f9 T4 n4 `" L move into pickaisle.induct3+ F0 k2 [ F' d" p
while A_i<=30 do begin9 }0 Z5 ]' q4 _) z9 u7 C6 g
travel to pickaisle.con(A_i)0 g6 h6 v8 P& ^' I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* p- G- T1 I& D; E$ h
else wait for 10 sec2 n' Z9 [4 g6 j$ S
if A_i=A_leave then send to die+ ]* t! z6 T1 r
else inc A_i by 1) `+ b( m- K% K& Y, F5 ^
end
6 m+ B- F7 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,其它按你的 ...
|