|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& q7 ]0 U- q; X; [0 p- T! |
' w. N' Z6 P/ r/ k我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 P M) c3 X' _9 `9 l6 U) n" n. y" C Z, Q
begin P_read arriving
+ _& r/ @# g' G& r; v; T" U while 1=1 do begin7 \; b5 R: w2 L- _) }$ v$ u
read A_tote from "data.txt" with delimiter "\n"
' B3 R; q; C4 ^1 p: H read A_time from "data.txt" with delimiter "\n"
- |; U( e. ^: C- X4 q read A_leave from "data.txt" with delimiter "\n"0 }& E3 P6 J' j: C
read A_picks from "data.txt" with delimiter "\n"! M# w1 ~: C" J7 j5 Z
set load type to A_tote* V+ o0 N, S0 q9 M9 H
if A_tote="tote 1" then set A_induct to 1
* L8 _; @2 C6 e5 f# p! E else if A_tote="tote 2" then set A_induct to 2: D5 M6 f+ D: P6 L
else set A_induct to 3 . M6 q6 `7 w; z9 A% ]
set A_i to 0
8 T2 o9 D' P% b6 J9 y* R- r clone 1 load to P_induction
; k2 e6 x3 h* S4 {/ v4 B6 {$ A wait for A_time sec. E+ S2 F7 I4 s2 M F) e
end2 O- _7 n4 J; W9 V
end
6 u4 ], C; ^; g' n1 m" r
9 M1 G5 X2 W9 |; y- wbegin P_induction arriving2 A9 a; Q. X. ^; @ \
if A_induct=1 then clone 1 load to P_pick1
# |, \3 b; H# U. ^9 t# I, ? else if A_induct=2 then clone 1 load to P_pick24 J T K5 N P
else clone 1 load to P_pick3
$ F, Z3 {: M( @9 Kend$ x {6 f: p! c1 V. D& A
2 H3 V' A {7 ~7 e' z
begin P_pick1 arriving* a/ d4 b2 Z, p
set A_i to 1
- T+ Y* q. x' I( M1 J3 k7 H3 X* D move into Q_induct1
* _) M. B# e3 T9 g0 k7 M move into pickaisle.induct1
y3 [4 Y* S" k5 e, T2 G% r while A_i<=30 do begin
' e; ^$ ]5 S9 P! U, e' f2 d* J travel to pickaisle.con(A_i)0 @$ M% Y; k0 `. J' s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* m5 C% N9 f! ~. j
else wait for 10 sec
& c! w J! x z if A_i=A_leave then send to die
% G' p6 ^6 O" w( G, u+ {3 Q else inc A_i by 1
1 y( T7 G3 U" S& P5 E$ Y# p end6 P N# r2 B9 ~# Z6 {- D( @# z
end
+ D8 u( ]: o- U$ ]7 g( A* J( i3 i# Z2 v' V' c
begin P_pick2 arriving
0 Q9 J5 c' ?8 k+ Q6 V: a" y' C set A_i to 11
6 E1 _& Q9 P' J' P move into Q_induct2
) S3 i5 ]! z" P move into pickaisle.induct2
1 j- N& @0 q6 s( y& o/ J while A_i<=30 do begin
; N. J$ d3 Q; `9 H travel to pickaisle.con(A_i), N. o* G) V( I2 `# w5 t- m9 o3 Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
L# t* h8 o% Y0 Y; W; O% d2 H else wait for 10 sec$ t' `. \( g/ M8 s2 v
if A_i=A_leave then send to die
7 X1 h: D6 R0 V3 l/ x: I0 H5 Z, m else inc A_i by 1* f8 R; c% a8 d- d" [8 f4 y
end
. P H, d1 l, x; L) ]; E" r3 Oend0 ~4 \9 v) r+ r. n
7 C0 {: g+ h( @" g7 C- C" n9 \
begin P_pick3 arriving& e8 X# o- d3 C# b' |. s
set A_i to 212 @8 u' E- I7 I4 C
move into Q_induct3
0 v* {. q8 z8 u0 c- C4 y move into pickaisle.induct3& o. K" q4 f) W4 w7 f
while A_i<=30 do begin
8 J* x1 @, k+ I! I3 u" H travel to pickaisle.con(A_i)1 ^6 ]/ n% o2 X7 s B0 d& H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( |. x! B# k% W( t1 ?4 m else wait for 10 sec
' _* t, a+ g; t; x& ] if A_i=A_leave then send to die
% Z1 h7 m% \6 t% o& ~ else inc A_i by 11 y& R. ^5 E* }' h
end
) Y+ t1 `5 Y& Q' Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|