|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 P, e4 J, _' X! q& c- e3 Q `" O7 m9 V& H, {) S* E# F V# J0 I3 d1 {
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
J0 [3 E2 g( k4 S& T" i$ p" w
' l- c0 Z) P* X+ `2 Z4 H, Sbegin P_read arriving/ }( F+ r- g6 V. r# K p
while 1=1 do begin
. `( x5 ]0 R: u8 d. O8 E2 q read A_tote from "data.txt" with delimiter "\n"0 c" ], y" j; J# s
read A_time from "data.txt" with delimiter "\n"
, F7 G) T1 I( l1 }+ a2 f, a read A_leave from "data.txt" with delimiter "\n"! s0 e8 S8 G( c0 |5 G5 o
read A_picks from "data.txt" with delimiter "\n"
+ l( ?. T+ C. F, S7 w& G set load type to A_tote( W k# a' k$ d
if A_tote="tote 1" then set A_induct to 1: ]* n- S! d' b7 P t1 ]
else if A_tote="tote 2" then set A_induct to 2- }2 S/ f% a4 l* E, l- x; u
else set A_induct to 3
2 W8 @% M. r4 t5 W set A_i to 0! m4 z- B, V* V" x& z! A& E
clone 1 load to P_induction) b3 o0 {" L; e0 s/ S" `
wait for A_time sec# |+ A' f4 c/ q) ?
end7 A. A) I( q i
end- X- j' _1 ~( r g
# M( e5 J( k( G ]+ o4 f0 |
begin P_induction arriving
. N/ H9 |- e, E; U" I7 y if A_induct=1 then clone 1 load to P_pick1+ v E2 M+ \1 s- W$ W
else if A_induct=2 then clone 1 load to P_pick2
+ m5 q' X4 [" D9 U/ p6 y1 f else clone 1 load to P_pick3
; H6 Y M2 a6 A6 I; g, x. Tend
t. M9 H2 E j* R: V5 Y+ X5 @: q! c$ j% M: ]/ C( u
begin P_pick1 arriving
. z8 ^" L3 Z, f set A_i to 1; r' k0 a' a: E5 {- ]4 E
move into Q_induct11 A& D* v2 k3 A* I A
move into pickaisle.induct1
) p \/ x( E5 A# ^4 D while A_i<=30 do begin# J) |# k9 H1 m. c
travel to pickaisle.con(A_i)
0 d# R, x. z3 j$ U2 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 G% W) h+ F2 l6 E" C else wait for 10 sec7 _; N- K9 o/ b# J9 s
if A_i=A_leave then send to die4 v, l. Y" j: u
else inc A_i by 1
$ d6 j5 v2 q! ]4 F end# K% J3 f% b$ w. i- s4 Q5 Y
end
+ v0 L% D+ ^: @1 }6 Y" s
' S |' M* F' B$ V1 Fbegin P_pick2 arriving
* j# R" n1 F) O! { set A_i to 11( q: ?& P2 X/ ]8 K# t9 n
move into Q_induct2
8 {3 I4 @" M& ^) ~- I+ j; m R: K move into pickaisle.induct23 M9 n1 v. w- J/ W2 G- o+ n
while A_i<=30 do begin
7 M* h. Y5 I' X# [0 U8 l, y travel to pickaisle.con(A_i)
1 I1 p) c, R, {; \# M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a* A% b* X( ~# ~% R5 O) @ N: `
else wait for 10 sec
8 R* v8 V, p. S1 |* p6 W+ Q7 t. j if A_i=A_leave then send to die
6 D- |* m: `3 z- @9 \2 K# R" M else inc A_i by 1+ ?* }/ G. N+ B( [
end% L. M# J/ ^$ n3 F* h/ b' W
end
( @5 a6 R+ G8 F. {* b8 G$ d/ N, P( G8 ^; S9 n2 X
begin P_pick3 arriving
" k/ h+ H/ E, Q2 d) P" C set A_i to 21: D" {! |2 G/ ]& q- w8 O6 r* v
move into Q_induct3
4 P9 ?3 R/ N8 o3 ~9 O: ` move into pickaisle.induct3
/ T$ j/ M! u5 g X. S7 U while A_i<=30 do begin
5 U7 Y i+ V6 b! C0 B5 O/ f travel to pickaisle.con(A_i)% C# L6 v/ X9 l0 Q! ?/ J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. y- F6 l9 z5 a" a3 D; r# q, e
else wait for 10 sec
1 _1 h3 h3 g1 G if A_i=A_leave then send to die5 r) } f8 G) x3 u
else inc A_i by 1' b2 r3 h7 M7 x: Q
end
5 W6 N: ?1 d, z' yend |
最佳答案
查看完整内容
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,其它按你的 ...
|