|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ @& s1 q; Q5 y6 F. ]) m
- [1 R' z e) S, C- ^9 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中的数值,不知道会不会有什么不妥。
+ i" g: A) h) T( h- n- I+ V3 j4 }5 Y& X
begin P_read arriving
' U5 l" V( ^/ B5 P) G, A3 c while 1=1 do begin5 q2 I& L* M U) K9 L1 Z- {
read A_tote from "data.txt" with delimiter "\n"5 R# p2 f" D$ h* h
read A_time from "data.txt" with delimiter "\n"% y Q2 Q% l# a( n8 Y8 a# |" k3 p
read A_leave from "data.txt" with delimiter "\n"
# _' Y0 v- Q x( F4 a1 T) g read A_picks from "data.txt" with delimiter "\n"5 x4 M" w5 A# H
set load type to A_tote
( @: \' c$ k% ~! N/ o E; L if A_tote="tote 1" then set A_induct to 1
2 Z) ] S- u. t# t1 N else if A_tote="tote 2" then set A_induct to 2' |% d8 q6 J' z) G
else set A_induct to 3
1 v2 _2 q9 j+ x9 C. g X set A_i to 04 [# C/ E! Q. M9 ]. Y" K
clone 1 load to P_induction7 [; U5 i5 v1 {: [
wait for A_time sec
/ H9 K+ J2 b( ~" e end
P S% l% H; rend
4 S" M) b8 X% R+ q: E2 @6 f
2 N5 D! H/ x( d# T" ~# `begin P_induction arriving
5 R* ?$ ^+ V0 i2 a, v2 H if A_induct=1 then clone 1 load to P_pick1
' A5 M! m) u( E- o$ O3 I" \, | else if A_induct=2 then clone 1 load to P_pick2+ k' X" k- a9 D
else clone 1 load to P_pick3& X9 v1 ~) x. D' ^5 n( K
end! I1 r) M. o* R P/ W' a
8 U" `: o4 F* P4 f6 x* t
begin P_pick1 arriving% C* P6 k. i5 E5 N: H, b
set A_i to 1$ n+ {, A9 d' X3 P( D, n( P& ]
move into Q_induct1* v8 Y Y& Y$ J" w# p" j
move into pickaisle.induct1) U& e6 s. W* |6 K4 b+ H/ b
while A_i<=30 do begin
" F1 |, N8 H1 q- c8 h1 G travel to pickaisle.con(A_i)
2 D; v$ L7 W, Y: N, `6 z, x2 N& m/ p2 D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 S8 B0 l( U" i! T$ K) a8 ]
else wait for 10 sec3 u5 |4 K* Y1 ]
if A_i=A_leave then send to die2 I+ V( Y5 `, ?9 o! y J
else inc A_i by 1. l* g. }! ^+ x' S4 h w
end5 e, W# w/ l- n
end0 J5 p, V' f4 B" C7 h. j
2 u4 f. M$ J$ e+ b0 g) N% v4 ]6 J
begin P_pick2 arriving& S1 `+ a6 V! n
set A_i to 11. R7 o2 W. S% Z1 o$ J
move into Q_induct2
: X$ u1 j( f" s; z5 t move into pickaisle.induct2+ s X! F2 x C B" s( |9 F' ~. J% ~
while A_i<=30 do begin7 s6 G) w0 a1 |3 D
travel to pickaisle.con(A_i)2 `/ e& s% v5 ^8 _" [; Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 r8 P% ?: {/ V3 `. R8 e) U) M, l" a else wait for 10 sec3 a5 ]& W8 O2 C. X" M
if A_i=A_leave then send to die
% ]" ]: T+ l" F) ?! u) ` else inc A_i by 15 ~3 v+ i: H$ y
end7 {( g. x# G) y, [4 v/ A, |! v
end
( e% v7 r4 I1 z+ a1 S
) T+ N7 Y: d, f" w8 Y, ?4 mbegin P_pick3 arriving
5 u5 }0 t: \. J }6 a set A_i to 21
" \) J/ `, W/ {/ H move into Q_induct3* G& _0 A+ `: @2 h; P& V
move into pickaisle.induct3; n3 d' {. o4 W' K
while A_i<=30 do begin8 l/ [# K1 O% p: s1 S: _* b9 [
travel to pickaisle.con(A_i)
8 ~+ A+ R" J' O: N, J7 B* ^! F2 t* {) a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 d p \( s/ A else wait for 10 sec
9 p4 e: y; e X' }' Y$ \ if A_i=A_leave then send to die9 X' K# E# s2 Q# N8 S+ |8 G
else inc A_i by 11 ?( c& b# h) E r% _# G" ]4 j- j7 ^
end
: ]& f ?* F7 W# u! bend |
最佳答案
查看完整内容
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,其它按你的 ...
|