|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' i' v3 @9 B$ ] A% n, ]
1 l l, C2 c+ V! ~5 d; @9 L! Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。4 q) x: k5 {6 Z7 K* q9 [- l% a4 ~4 J
7 n& w6 U: Z6 t Z" ~, Y. D: L
begin P_read arriving
/ M% K+ Y: F+ | b1 ^, { while 1=1 do begin7 n n, \0 v# D$ H, I8 v6 N' l% I
read A_tote from "data.txt" with delimiter "\n"
9 t8 M3 Y& X" ^1 ~5 ^% d read A_time from "data.txt" with delimiter "\n", d/ N6 Q8 J& y; G+ n9 y& C
read A_leave from "data.txt" with delimiter "\n"# X' Q" e& L7 ~. u" K- q( P
read A_picks from "data.txt" with delimiter "\n"
' ?( ~. L4 H* Q! s _5 C* e set load type to A_tote" n! }: Q* w: W! f7 E2 a
if A_tote="tote 1" then set A_induct to 1
' V' {4 X& {3 |! _. r else if A_tote="tote 2" then set A_induct to 2! |7 \# x0 O0 {) h
else set A_induct to 3 * A+ P( h9 Q6 m( G5 E
set A_i to 0
7 o! C7 F! G$ P" \# ] f clone 1 load to P_induction5 Y9 ?5 v" `1 l3 r2 H1 T; Q
wait for A_time sec9 r. N7 D" M% U4 A. d
end; e& I% m% {$ f7 I
end
8 E2 k6 [" W1 y! |* T9 L$ x: o. q5 B/ s
begin P_induction arriving- z! O( v( x& o* h: J$ c& C' K7 D4 R
if A_induct=1 then clone 1 load to P_pick1! V. r' G# E: I% G! }) B! u+ H
else if A_induct=2 then clone 1 load to P_pick2! w3 z7 S5 T' _5 t7 ^
else clone 1 load to P_pick30 W9 C1 @& Q/ Q0 b3 F1 m
end# Q/ B2 o2 ^- l" K
) r5 T' @0 D* a1 c
begin P_pick1 arriving
4 x# V7 y* n8 K; p% f- j set A_i to 15 ^# V. W! j3 {2 H% l! a/ U
move into Q_induct1
0 j" Z0 d' f" U4 ^$ g move into pickaisle.induct11 R$ D5 K: n6 G
while A_i<=30 do begin
- S" K% a. w t# x$ ~* U6 y travel to pickaisle.con(A_i), _ E/ i* @/ r3 Q, s; [6 X
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& R3 v5 z/ c' q, x8 m
else wait for 10 sec- O z2 [- U7 o. S' W2 F8 X
if A_i=A_leave then send to die
6 C8 L3 o7 F b% Z5 z1 H else inc A_i by 1
8 I. m' u. b6 H$ o N' w+ D! b# B, [ end
6 k! \: u7 C( }( nend6 ^6 U8 R: [! C% i. n# V1 y
, W5 d) f& \2 u ?( L: }begin P_pick2 arriving0 t" h! W% `3 a( Q9 `0 x
set A_i to 11
$ C, J% j! h2 f+ q, g6 r move into Q_induct2# u/ m9 m, J. i8 W
move into pickaisle.induct29 F) d0 |: C, [6 ~/ K* z/ j
while A_i<=30 do begin1 x l; V5 e4 M
travel to pickaisle.con(A_i)
) g( I' p9 X0 g1 Q. v) } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( r: ~" V/ h) f7 G else wait for 10 sec+ Z2 K# \# G7 A/ ?
if A_i=A_leave then send to die
# L' n* u' C% I8 ^2 l6 f* ?- J( n else inc A_i by 1
" l; d- Y! U4 {5 s! N8 Z end @4 j9 f) Q5 b6 G4 a! |3 x# v
end
# @3 `7 k0 i% D
! p9 t6 d9 v; p, jbegin P_pick3 arriving& [& T7 P ^' ^+ Y' T/ I# a
set A_i to 21
! X' \# F; i0 N% Z2 r7 z move into Q_induct3# B7 X) L+ r( l
move into pickaisle.induct36 o9 y7 j) v/ J$ W3 Y: C3 ?
while A_i<=30 do begin
, ?2 j' f4 ^3 z! z. c! M7 L; V travel to pickaisle.con(A_i)
5 m! Y$ T, T3 _' B$ ^5 L# Y; Y- S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 q! ^* _0 N# W- d" b7 \- v else wait for 10 sec
6 K$ K4 C& W5 ~/ n- t7 f if A_i=A_leave then send to die P$ N$ Y; [9 o( m% Z0 @6 ]
else inc A_i by 1
6 e/ h4 q5 Z i7 B# ^ end
* {3 u( |0 H! E; {5 cend |
最佳答案
查看完整内容
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,其它按你的 ...
|