|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) s( b7 q; U) K0 V' t
5 F4 D" H4 W0 q7 B) [( e
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ m& F* v0 ]! |3 w4 ~
8 I1 e# b* s6 M4 Fbegin P_read arriving
+ @% l6 V. {) `* {* K1 r u' s while 1=1 do begin9 \4 j& e* Q9 ^9 i5 T5 A: G; Q
read A_tote from "data.txt" with delimiter "\n"
, g* Z5 ^# k( h2 a. O read A_time from "data.txt" with delimiter "\n"
/ w u4 _" n* [3 b- c read A_leave from "data.txt" with delimiter "\n"
1 \ z0 A7 X# c9 ^2 i* z! W read A_picks from "data.txt" with delimiter "\n"4 }3 `* i2 J( S' |
set load type to A_tote% X1 N# \0 p" j* t4 s( h8 N. R' X# @
if A_tote="tote 1" then set A_induct to 1
& G" d) J( w6 I9 [2 S) G else if A_tote="tote 2" then set A_induct to 2- p( B- v y. O8 l% J+ K1 k; f: A
else set A_induct to 3 0 ` v; X v( v4 @% f; t6 Q2 A) ?$ R
set A_i to 0
' E8 X% N. R6 \7 H5 P6 i clone 1 load to P_induction
2 n% t `0 U, a2 f8 y- c3 G5 b9 a! _+ C wait for A_time sec
9 @ Y+ R. c% k) w) b- k end
2 ^. Q( q7 O- ?( P$ I7 P5 w3 Y0 dend' [- u# e$ w& `2 O3 r7 i
* x4 a; m- X8 I9 d- G! ~. i5 [begin P_induction arriving! C9 g% o" R( }+ c
if A_induct=1 then clone 1 load to P_pick1
& z2 g7 F; x: h" J7 k else if A_induct=2 then clone 1 load to P_pick2) e; D' @7 H i8 B6 ^
else clone 1 load to P_pick3* u3 n9 {6 i. a1 ]$ ?7 L7 [" V
end
1 q* y( S- I( D- K7 h% l4 c9 s; i& v* ^0 b( r* p
begin P_pick1 arriving0 R' u9 H: D1 s
set A_i to 1* R2 l2 V1 G5 d+ s3 q
move into Q_induct1
, z# [) i% B) G0 k move into pickaisle.induct1; {6 u3 }5 R, A Y2 r: `' h
while A_i<=30 do begin N R4 ` }, |; x: H6 r& b
travel to pickaisle.con(A_i)1 T% o9 B8 X. H) H3 W6 Z. p9 g
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" a. C0 B7 S+ r0 l1 N
else wait for 10 sec) n1 R, d4 r, C1 O
if A_i=A_leave then send to die6 U) m O$ _3 `1 L5 v
else inc A_i by 1
B( z: O# e2 b8 Z end4 c* ?- N, A& ] L: f/ p- n+ q
end4 \ h, r$ {7 {0 t8 V7 f* D8 [
5 P6 m# K2 n; tbegin P_pick2 arriving& R" P0 N$ U# ^% Y# p
set A_i to 11 b- ?' p; G+ V# N
move into Q_induct2% X* d' M2 y7 W/ O& g
move into pickaisle.induct2
1 x3 Q* g8 |, |9 x( T! a! W while A_i<=30 do begin
8 _& t, g9 b" J0 [* a. R2 v travel to pickaisle.con(A_i)
: N P% ?1 s/ M' r) ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 D9 J. U5 P; |# b( }8 U0 r else wait for 10 sec" h1 ?( x. L9 I" x' J% |9 \+ _1 P
if A_i=A_leave then send to die
2 ]! }3 S6 a* ]! B; a( _ else inc A_i by 1- f$ y( V- E9 Z) T! S1 {
end2 _: V- n) i( p/ T
end
* C3 h0 T4 k( g: z
, }( r' R( g/ j ^: ~9 a/ pbegin P_pick3 arriving7 a# {6 j1 L: F, p' q
set A_i to 21- k5 |2 j3 \0 ?3 d
move into Q_induct3$ e) @9 m9 R6 u; W6 Z
move into pickaisle.induct3
3 E" W2 C( D+ r5 X* E% R8 v while A_i<=30 do begin
. f' T, d0 G5 L8 a travel to pickaisle.con(A_i)+ V4 {+ V7 O& Y* |3 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* `# S3 K L: B9 ` else wait for 10 sec7 N6 Z0 T& Y- v# M4 W+ b) e
if A_i=A_leave then send to die
G5 B% D$ }, [6 Q else inc A_i by 1
6 x+ H, {# |$ T. m1 j' w6 E end! D" S3 K% {( e8 X" y
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,其它按你的 ...
|