|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 ]2 ]! O" G1 b* h t$ ]6 ]. X
. I. l/ J& N- [( T3 J6 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% e4 I! t" Z0 j% K0 ]1 I
5 G6 v4 |3 `0 R* S$ k* P: Ybegin P_read arriving. S3 A/ R: K- D' S. i: n
while 1=1 do begin6 [+ K2 p* v* H- Y/ j. ^( l
read A_tote from "data.txt" with delimiter "\n"9 ~3 M+ G. L+ }
read A_time from "data.txt" with delimiter "\n"/ c8 x _* ~; U! A# o) a
read A_leave from "data.txt" with delimiter "\n"7 ~( }3 X+ |+ @0 K* [4 P- i" x
read A_picks from "data.txt" with delimiter "\n"
* R4 n& q6 _! E% A set load type to A_tote
' s* v. {5 m: Z; d0 z2 D if A_tote="tote 1" then set A_induct to 1. Q1 o" {9 d0 O* A4 m
else if A_tote="tote 2" then set A_induct to 29 t2 p m I: u5 F2 a, N6 c
else set A_induct to 3
) I7 p9 x2 j* c: l2 J0 a8 z. }' k: ] set A_i to 0
& v+ b4 `; C9 G+ p* d& s: z clone 1 load to P_induction
2 ^0 e. H' C; o- ?( h$ v7 B wait for A_time sec L- V- W1 {1 D. f4 U4 n1 S
end; h! ?/ e4 i, a" D& ^( k" @' {
end
8 e6 s0 T! ~# |; Y2 `" P+ s p) { Z* L' j/ q
begin P_induction arriving
/ E0 y; P# P$ _! Z/ ]0 Y* u if A_induct=1 then clone 1 load to P_pick1# e) @$ ~8 n. h3 S0 Z
else if A_induct=2 then clone 1 load to P_pick2- l3 h9 H/ q8 u0 C8 }/ Q/ u9 P
else clone 1 load to P_pick3
- r& r1 K6 V3 v2 o; h8 ^9 P7 W5 bend
3 N" t# W7 _% c) Q$ F- _# u; _: q8 r1 J4 d: T0 _! p
begin P_pick1 arriving
3 B9 Q6 {5 U$ z% g0 | set A_i to 1
- F: g+ g1 g1 y move into Q_induct1- i. r8 z) X4 s2 M
move into pickaisle.induct1
, u* l% [( `, p! U9 {& m7 M' k while A_i<=30 do begin# A2 Y. v5 q7 u7 V; A; R
travel to pickaisle.con(A_i)
0 z. y) q+ y/ x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: H, F* ~4 ^ J; t f" I" W8 J9 U! v
else wait for 10 sec
+ [4 k. m( W1 p" C( l if A_i=A_leave then send to die
; i. e- ?; d+ K4 Z; D6 C else inc A_i by 1
0 V5 |) d' ^; A) G9 T end5 v6 Z: r0 \: w% ?1 J! b2 `
end
6 m$ h$ E. v& g9 u5 H; l4 {, z* l) q' z# p
begin P_pick2 arriving
' J! h @2 a+ o: a9 K6 p8 T set A_i to 11
+ }: [* B: O7 L( v) }, r move into Q_induct2
- Y$ m. a: \8 x0 T o. ~" E move into pickaisle.induct2
. l2 P' |! I! ^ while A_i<=30 do begin
, \* _: ]4 h0 Q: T3 r travel to pickaisle.con(A_i)
5 ~# s- E/ Y& u. e; e& [5 {: ^7 { if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 Z/ }! z6 _1 E/ B5 g
else wait for 10 sec
7 t- |8 ^4 ^0 L( s5 H if A_i=A_leave then send to die
) f9 b; {# U6 s7 ^ W else inc A_i by 1
4 `7 {& `% i) Y4 k% A end: S1 ]& P- @0 ]
end, M8 H: R8 l# n. M0 x$ P4 s* Z0 U8 n
3 ~5 F* M' t0 X- Z, E
begin P_pick3 arriving
. _7 Z' h/ V. H. u% A+ b set A_i to 21$ e2 g5 ]# u; g6 K' [% x" N3 |/ `4 Z
move into Q_induct3
, K0 O! p5 X4 O* y* U, L move into pickaisle.induct3
6 l$ T/ i$ c; Z5 e, b! P while A_i<=30 do begin t( n# F8 P$ Z5 a
travel to pickaisle.con(A_i)' W+ j n% x9 Z1 f6 d6 H, Z. _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 n: ~, _8 Y- _
else wait for 10 sec2 B6 Y, e) p' w- n7 ^
if A_i=A_leave then send to die5 S3 }5 F4 l( U* Q4 L
else inc A_i by 1# H4 j% P; I; }" p- V
end
+ Z# |4 V& G& b! C/ F5 m6 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,其它按你的 ...
|