|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* u) \, N: Y5 _. r7 {/ a
3 I+ `( P$ e3 W( c
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ J& v, v4 e! m9 b a" `7 O$ T) A* T. |7 V) r
begin P_read arriving/ `3 y1 X$ `5 K" y! v0 Y
while 1=1 do begin% P( a" ]4 V }( G" {7 e
read A_tote from "data.txt" with delimiter "\n"
/ ^! t a' z a read A_time from "data.txt" with delimiter "\n"
: N$ H. D; _3 I4 j4 S/ b% e% p read A_leave from "data.txt" with delimiter "\n"
/ J' u! m7 t# {: n$ p read A_picks from "data.txt" with delimiter "\n"8 a# L' x' w5 ^
set load type to A_tote( u8 Z; _% B; i% ?( n5 t+ F8 q
if A_tote="tote 1" then set A_induct to 11 |1 r S% G* o ^/ \. i
else if A_tote="tote 2" then set A_induct to 2
+ z* w6 b0 ~& [3 Z else set A_induct to 3 ; M5 U. g" M' {
set A_i to 0
! e6 E6 s9 h1 g5 o clone 1 load to P_induction
; ~8 s3 z! B* k: t: m N wait for A_time sec
4 r; b: V! `# M% m- h4 a end+ f) P& {: k6 N" s( `& d
end
3 x- M. a4 ^# \7 B/ i$ b- P1 e) Z" J5 T I9 V
begin P_induction arriving
* y+ X7 ]7 G9 G4 ^5 {" a3 V* U if A_induct=1 then clone 1 load to P_pick1
2 O0 Y& }6 O( c; q+ V else if A_induct=2 then clone 1 load to P_pick2" [& X+ a& G, h2 A
else clone 1 load to P_pick32 B$ o* D l, V3 x
end
& L& M, x! E9 ^; I+ e, w$ E
4 E5 T% k* a1 p ^begin P_pick1 arriving
r8 P8 v7 u: F8 c set A_i to 1# f0 W$ K1 a- ^% @7 c
move into Q_induct1; H: h4 j& V3 l7 u( N n0 h
move into pickaisle.induct1- p6 T6 {) p( U1 `/ J
while A_i<=30 do begin
# r5 S0 a) Z5 X2 H: ? travel to pickaisle.con(A_i); l% _( g* c4 g( \2 w I+ c7 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 M/ [; m3 |1 p6 e3 H; V. t
else wait for 10 sec# Z, _9 U1 b# C5 l$ O& \
if A_i=A_leave then send to die& A* K& |0 e) {$ U2 |( Z' g
else inc A_i by 1, |3 @2 H. S f, [; k! `! R& e
end/ J3 J# s8 F$ g: z
end
0 O3 {( {) C& P% J# p4 R' z2 |: {! t2 C3 ?: B
begin P_pick2 arriving4 L0 K* G& l0 O) U4 Z) K6 y
set A_i to 11
% i3 K) J0 V' v# M! K move into Q_induct2
6 ^3 c$ H" p0 _& x% M move into pickaisle.induct2
; y" m7 ]& k% \( ^ while A_i<=30 do begin
1 Y% m, P( T) O travel to pickaisle.con(A_i)
# c* z Y" B0 A, c. I8 i4 w" \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |+ D# L7 M, w else wait for 10 sec( } N6 N# L8 d$ L+ [- t) F+ M6 Q
if A_i=A_leave then send to die
4 \1 o# P* m! s0 E: p; |" D9 O else inc A_i by 1! N) P# _6 s# W; g
end
5 j$ i! K3 y/ H e1 i$ n, Nend
# x7 e) P1 h% @6 n# { t% t! B$ v, J9 L# y1 [( L% @$ K
begin P_pick3 arriving
. e& t; S$ r3 q" e N" [3 t set A_i to 21
% m6 Z0 o$ r3 B u N move into Q_induct33 z' u& A7 F7 E% w6 \( U
move into pickaisle.induct3
# L8 L- {/ i8 L: u while A_i<=30 do begin: ^6 _* U5 W" Q4 B/ L
travel to pickaisle.con(A_i)
^( Z& U2 j/ d5 [# c: ]- Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ G+ m" Y; Z7 `6 p+ G' k else wait for 10 sec" _$ h/ r2 Z- ~$ D! v
if A_i=A_leave then send to die3 o$ u0 B% M8 x; J! i p2 |6 K
else inc A_i by 15 p; N. ?% y6 q- I1 q9 Z1 {" v
end
+ i! J* K3 l& k1 s2 p& lend |
最佳答案
查看完整内容
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,其它按你的 ...
|