|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( I" `; m% i5 S- f0 L4 O' M
4 d/ O4 `8 F$ q- `& Y" ^3 G
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
- j, h9 o- s2 Q& H; l! l! w! W5 U3 \+ h+ o& O0 X7 [5 P
begin P_read arriving
$ x( x# s. T+ \4 X8 b: s* h+ Z: s while 1=1 do begin
. g9 {: i8 N, v1 G# ^ Q read A_tote from "data.txt" with delimiter "\n"
7 E6 \; ~5 L& H) N1 i+ [ read A_time from "data.txt" with delimiter "\n"
( L/ w6 A$ [: F3 J) M+ ^ read A_leave from "data.txt" with delimiter "\n"
% E' ^3 n& e5 U4 k7 o. R read A_picks from "data.txt" with delimiter "\n"8 w2 t) U& b0 ]5 L# F
set load type to A_tote
1 L0 m: v2 _/ ?: N6 V2 j if A_tote="tote 1" then set A_induct to 15 T; p E1 I7 W: T( u1 i4 E
else if A_tote="tote 2" then set A_induct to 20 O8 I8 E( Q3 b i4 ]
else set A_induct to 3
, Y$ `7 p2 P* r2 E0 h set A_i to 0
. O6 i8 [0 j7 A, G; g, I( g clone 1 load to P_induction
" n3 v$ w5 p/ {6 {8 \: q, N wait for A_time sec
( W5 W$ V/ d6 L: Y& U end
# D6 R# d/ v0 a3 l4 ^end( v& t" r. c1 ]. C6 V& H( U
" Z3 P/ X9 Y$ z& r. X. ^5 b- H& ubegin P_induction arriving
. _% g* R3 x7 j- B if A_induct=1 then clone 1 load to P_pick1
, j' C; ?; v v2 W else if A_induct=2 then clone 1 load to P_pick2
/ N7 Y* T. }& ~: ^7 z else clone 1 load to P_pick35 h1 a! q% D; p8 P0 `
end l* m) q9 _* `% W/ Y, S, y. z: |
1 p( p' y5 P+ [. T% W. w* hbegin P_pick1 arriving
2 G0 y% ~( V8 e+ v set A_i to 1
, s' @7 K- x( p move into Q_induct1" E& _$ m0 Y6 V& E9 S! E# u' h
move into pickaisle.induct1
- H, i7 ], \2 ^: V8 Y while A_i<=30 do begin
3 U; d0 ~+ u& r8 Q: W/ r travel to pickaisle.con(A_i)
, j. `# B$ A) E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 h( P( G; E+ d
else wait for 10 sec& r% J, A0 O' `% }
if A_i=A_leave then send to die( A9 w3 A5 N8 G2 v8 R2 {+ V
else inc A_i by 1. h1 P) t, \ @) F
end, x* T4 g6 p! n4 j$ W# f7 D
end
5 j$ p: {* t/ Y) H$ z' c. G& D* A
7 r" n* C8 \, s& S8 |/ e( X: xbegin P_pick2 arriving
" L* l+ W- @7 E set A_i to 11( M1 g' p6 J( v/ p; Z+ l% l- O$ m
move into Q_induct2
. A$ o$ {0 Q& o# | move into pickaisle.induct27 Z7 i1 N+ Z* f3 Z, |; e/ n2 v+ G! J
while A_i<=30 do begin
/ K: T D" Y6 Y4 F- s5 J' ~, p travel to pickaisle.con(A_i)/ z" g3 Z- E% H$ O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 b# N3 C a+ p9 a: ?
else wait for 10 sec+ c0 U( @0 c9 t! a" A c# m
if A_i=A_leave then send to die) o" |! y O$ E$ }
else inc A_i by 19 B0 o7 @& ?& G, C3 K4 s
end
+ Q/ J3 x% j4 t6 cend
( b+ J8 S& D& ?: m' D' \, ?5 l# s! t) A, C1 R
begin P_pick3 arriving# A# Y" \$ d% v' I( x; t# j, j" m
set A_i to 211 [5 F! s1 D: z: Q4 m/ ^( _
move into Q_induct38 _+ W5 p5 q; @( v* m
move into pickaisle.induct34 F; H! P4 K- @$ s
while A_i<=30 do begin& K/ x+ d" V! W) i- E& _7 T# x5 B
travel to pickaisle.con(A_i)
; H. p# j, H/ g: l3 i x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: ]/ b" O9 l7 m6 }) g, c( e J else wait for 10 sec
- J/ [, }% {" x E0 b9 Y if A_i=A_leave then send to die6 j8 z* O4 l6 y2 D/ k5 m
else inc A_i by 1
: B; x. _8 }) z% \ end' @: J' Y- x' e2 i1 ^& U
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,其它按你的 ...
|