|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: ^4 z; I/ y' d3 h0 W5 p0 g% D
2 q# N6 J+ H% ?1 P; r
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ _) v* s# J6 d9 N( A* B
+ H! z! O: [* b0 t! f' u# ?begin P_read arriving
- d9 T1 _$ y& p5 [" ^5 B while 1=1 do begin
9 U" o! ]# z9 A5 b# [ read A_tote from "data.txt" with delimiter "\n"
# f& z( p% h% z" V. c read A_time from "data.txt" with delimiter "\n"
2 l, S2 I) L- y, H5 `6 M- Z& j read A_leave from "data.txt" with delimiter "\n"; e- c, m4 F, O, E! b. H
read A_picks from "data.txt" with delimiter "\n"3 n+ t9 B) f9 X
set load type to A_tote+ W3 K! B. u# c* h v, Z
if A_tote="tote 1" then set A_induct to 1
. w" B1 ]+ X* e* I- D3 a i! C9 f- ^" H else if A_tote="tote 2" then set A_induct to 2
5 L+ v/ j _, h r3 D else set A_induct to 3 8 o- v* F3 Y& M& R
set A_i to 0
& S6 N! i1 V4 M7 v clone 1 load to P_induction+ X* N8 m- n! @7 g
wait for A_time sec
; e) d, k D4 d! F, Y H+ d end: x7 G2 l1 F* z1 C3 Z3 M
end
7 g# \ r- m5 V! n, O
, @- I+ _; \( Z* O2 abegin P_induction arriving
1 h* s# M P) R+ H" h1 U9 ~9 I if A_induct=1 then clone 1 load to P_pick1; g. `4 `8 C6 j; }/ @1 D
else if A_induct=2 then clone 1 load to P_pick2
- f+ a( V% L7 b6 o2 W. ? else clone 1 load to P_pick36 N* X; z* j+ r& s1 O/ ]% }) W
end
% b; {. t8 U4 Z) M c3 F r! N6 S
+ ?8 B8 k5 E* ~4 xbegin P_pick1 arriving
" t, l5 H) M4 c set A_i to 1$ ?* W) V" Q! m
move into Q_induct1
: U7 s5 W8 ?/ s$ T move into pickaisle.induct1
" A1 z0 j" ~ u5 {& @ while A_i<=30 do begin
3 D3 E5 _1 R) g' {# A travel to pickaisle.con(A_i)2 V: p M- k) f0 E! n
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ], V5 D) Y$ r4 x2 H( g. n4 _) w else wait for 10 sec
+ g7 Y1 i x# G: p8 L" D if A_i=A_leave then send to die9 }3 x3 L* A! ^, m6 p0 c s
else inc A_i by 1+ F4 @! ?/ I Z0 r0 l
end) h6 i4 `& V2 ~; d' r) R
end
- k9 X" }* l" S. O1 N
: D6 Q. z: v+ _ Vbegin P_pick2 arriving
% d$ l0 |- Y! O2 P, A9 T" [5 ~5 E set A_i to 119 y: s! t2 x+ O4 n% L+ r* q- Q
move into Q_induct2
/ O5 v: f+ q# j q+ I+ w; e move into pickaisle.induct2
4 E o1 B4 Z2 U7 G% @ while A_i<=30 do begin
$ v! G. Q$ m) k; A ]+ i travel to pickaisle.con(A_i)
8 p y. l' m9 a5 l" i \: _8 l0 q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 d! J% @) S/ _# ?$ a
else wait for 10 sec
- o7 f W6 |6 u if A_i=A_leave then send to die
" H ~3 b% k7 C else inc A_i by 12 q9 t. e& M9 r8 m" M4 R* f, _
end5 m I; H- A# ^ `+ T8 f' ]
end1 t B$ p- a6 v6 r E& G: p
4 O! y5 K$ c3 ?* R' e7 L7 ibegin P_pick3 arriving* [) h! P, F# L- d4 a' s
set A_i to 21* S! j# \* C: N" b; Z* K m
move into Q_induct3
1 m) j& b4 }# J* m9 w5 \2 [ move into pickaisle.induct3
0 d, [; b. O( J, h9 f7 | while A_i<=30 do begin" ?5 ]2 }% ^( f% u1 \
travel to pickaisle.con(A_i)4 H6 D B% k7 u2 }! u2 H ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 G$ q4 Y$ f8 p- T/ b$ ~: ^3 k else wait for 10 sec
/ \) z) ~# S$ d3 g; V6 t; l if A_i=A_leave then send to die9 l8 A* [5 p3 S9 Y, y$ s( m
else inc A_i by 11 r$ Z& s( ]. G# |( E' G
end
8 s4 V' V. y7 `7 O4 p/ iend |
最佳答案
查看完整内容
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,其它按你的 ...
|