|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 M1 E4 E6 _; C( @3 P9 B4 f
/ E) k' V8 r5 p6 C' [# v/ q我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ t7 Z9 `3 f" k+ i" O b
2 Q. _+ f6 b5 \begin P_read arriving
. ^! X; g: E& [5 s% e while 1=1 do begin5 T; [3 m F! I6 U2 L; b3 H
read A_tote from "data.txt" with delimiter "\n"
& `9 Y f9 i# p% ^5 ?& H# d read A_time from "data.txt" with delimiter "\n"
3 N/ i4 F8 w# g9 J8 c read A_leave from "data.txt" with delimiter "\n") u2 o, N$ S; M8 E
read A_picks from "data.txt" with delimiter "\n" T! ~5 A) J; P, y, r
set load type to A_tote
# g+ x) U! b" `5 D6 B, ]5 y if A_tote="tote 1" then set A_induct to 1- p. i( d9 o. K% S3 J' L3 l5 g
else if A_tote="tote 2" then set A_induct to 2
1 @$ @# }! }3 s! W5 x3 W( g, ] else set A_induct to 3
0 K% A( k: v2 m. j7 K set A_i to 0
0 @( u/ T, n; q2 y7 m clone 1 load to P_induction
& j! q, @3 ^3 x2 ]6 I wait for A_time sec
3 p6 j# J1 m2 }) m end X1 @ N* `. l0 B! `
end) [" u r. T6 j6 m, G
5 g8 F; }7 A3 ]: g h' Z
begin P_induction arriving
7 X, [# h& t5 z v- _ if A_induct=1 then clone 1 load to P_pick12 o, p. n( l: K9 ?5 ~- S$ Y* i% `
else if A_induct=2 then clone 1 load to P_pick2
9 I8 Z6 G: N* H" ? ~8 T' h- ^ else clone 1 load to P_pick3; [0 R4 l7 Z- l# E+ L x! v! i
end @/ _' s Y, x+ B/ V
/ f, _# a/ @6 Q) O
begin P_pick1 arriving$ U/ t6 F% \) H$ \ v8 ^3 O* a, l
set A_i to 13 {8 t$ q' j8 @9 p) i9 t. \$ c
move into Q_induct1
6 |5 A- P" K: F: k/ C) k7 K: l2 K move into pickaisle.induct1
/ P, W. p/ t3 E+ J4 q6 X7 ]( b while A_i<=30 do begin' g4 m0 n* s& l' X& ]
travel to pickaisle.con(A_i)
, w, G: P$ V( ^" p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 N8 Z1 l$ O, q else wait for 10 sec
6 K8 [: D; R" M* w if A_i=A_leave then send to die% b, T1 Y2 A p5 n# {7 |
else inc A_i by 1
' p$ ?) K( w" K$ b- g( h* i end
# R5 O! k$ l, h; V! Vend
9 M; S% ?4 S% H) _2 O, N0 u- Z) Q" N6 p$ U
begin P_pick2 arriving
' e. Q. }4 s1 g4 r2 n. v9 f" o+ O set A_i to 11
- d/ ]6 L( ~, D6 G move into Q_induct2
) N# }9 P# w& x move into pickaisle.induct2
2 g3 B8 E% D0 V2 l* j while A_i<=30 do begin
9 D8 |" l$ b1 a travel to pickaisle.con(A_i)8 A1 q b! `# M( V$ h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% X9 c% ^* e" x else wait for 10 sec
1 ^+ W: \1 G+ a9 i. X* V if A_i=A_leave then send to die; b8 h. v8 G% F7 v
else inc A_i by 1
0 M$ {# V- T% p Q( {5 ?! R end3 W ^: ~, G8 G
end
- J; c$ n: @+ Q* G8 B, U* m
$ R0 D. K5 B, o7 p7 u, ebegin P_pick3 arriving/ C1 M& C# q$ ~. x7 B( a, F
set A_i to 21: G, ^2 P6 ?5 S/ q0 ~# x
move into Q_induct32 Y3 i9 ~. N% A2 c- J
move into pickaisle.induct37 x. K4 p; O9 c; x# |
while A_i<=30 do begin+ }6 z# P2 j" X/ |7 q
travel to pickaisle.con(A_i)8 G1 `9 q9 k% |. v6 I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- [) r" E! Q, d4 S* z( z6 ~( p else wait for 10 sec2 b3 d. K# {" G- I
if A_i=A_leave then send to die
$ b* S- A7 P) d. _1 x& T4 _# O else inc A_i by 13 u9 W, d6 I# j7 l5 a( V
end! U3 U. k8 V* L4 u( S" @# R3 g
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,其它按你的 ...
|