|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" \, r& H! c% T( n
0 R- E3 {) z6 |$ w) b我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& Z% }9 {5 ~ }) J" t! |$ ]
( f% ~9 u7 V& @+ V2 ?0 R, Jbegin P_read arriving
( t8 }' E% s, g4 Q+ p2 I2 M while 1=1 do begin
& q* b( w. }* [* k read A_tote from "data.txt" with delimiter "\n"7 G' Z: p1 T0 A0 P) x8 |2 K
read A_time from "data.txt" with delimiter "\n"- c6 E# Z& r8 o3 c2 e3 @/ M
read A_leave from "data.txt" with delimiter "\n"$ ]! T3 N2 F8 ?5 T a" Q/ Z
read A_picks from "data.txt" with delimiter "\n"
- W; @8 L$ \4 y3 q& A set load type to A_tote
, _1 S" x3 p3 s; G5 y if A_tote="tote 1" then set A_induct to 1/ G; H# Z* L: f4 a
else if A_tote="tote 2" then set A_induct to 2 @# U* N! ^6 i9 ~+ Z$ o
else set A_induct to 3 8 q9 m5 ~' h/ g5 V1 |( p6 _
set A_i to 0; l9 e& E6 p: f
clone 1 load to P_induction8 J* k+ z# `' E3 F/ V9 A
wait for A_time sec
' t6 y5 T) y$ R u, [) h N% D end
$ w3 J2 g) d4 [7 O8 Tend
* |* l- S1 I2 a3 L8 S& n7 F2 W) ^/ J* a% E
begin P_induction arriving* T7 S: v- m- f5 J, }5 I" B
if A_induct=1 then clone 1 load to P_pick1
0 u: F7 R3 \" f0 R7 a# | else if A_induct=2 then clone 1 load to P_pick22 _ [: }. I' w1 S* x
else clone 1 load to P_pick3
2 K/ ]; Y2 P+ c. j2 X2 a0 C# i( fend9 C& N) n) [0 h) t- H; j1 H8 ]' c6 j7 G
6 {1 ^1 `7 N# X$ ?1 _begin P_pick1 arriving8 I }$ H2 ]+ H3 t% f! V: P
set A_i to 1# b o* d* e1 `: L, r. g
move into Q_induct1
8 s' r, ]$ t% k& u& U3 h- Z move into pickaisle.induct1; Y. p2 r7 ]& a3 b9 g5 g5 T- k
while A_i<=30 do begin
0 ^- H5 |3 x3 f3 R. l: Z travel to pickaisle.con(A_i) X- }( v3 N q( t: J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 W5 l6 N: K3 m2 \7 ?3 ]) O else wait for 10 sec) K+ U$ }, B# y& w( g) [
if A_i=A_leave then send to die
. H# P0 f C, A6 Z9 ^; T* V else inc A_i by 1
. h* c( i$ [7 A$ o7 e+ G H' q end6 ]; ~) e5 \6 q: A* l D/ i
end, y2 q9 ~" ?- W
/ Z8 G0 h- Q3 y$ _+ M5 b" C
begin P_pick2 arriving
% J% q" Z# O& y# d' c' G set A_i to 11
% m4 j% h6 R( X. Q# h; y1 x move into Q_induct25 C% v4 a8 Q0 {
move into pickaisle.induct2! _8 \) p. J+ u, N- W
while A_i<=30 do begin
0 _/ f. n* C0 P. l. T+ v$ W* i travel to pickaisle.con(A_i)
3 d4 ~0 R# W! c4 s# s A5 k T9 N" B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 f. L+ ~& i8 ?. W& Q
else wait for 10 sec
% @! o! @6 d! b' g2 O if A_i=A_leave then send to die
# e7 A7 L6 k$ H5 q8 }4 W4 G else inc A_i by 1
1 `% a9 k# h2 b( T* V end
" C/ a) c4 ] o7 u5 s' ~& K2 m8 t& X. Zend
& d* S3 q0 F7 a8 i+ i3 k6 d' P% d3 g3 U$ i! A
begin P_pick3 arriving
8 n0 X6 X, C/ r6 n# N set A_i to 21
+ o* a2 b1 h# |; Z move into Q_induct3
1 ]& j; Z1 c; [9 F move into pickaisle.induct3* b' N6 a9 `3 b
while A_i<=30 do begin
' h% A- m/ |2 m% A travel to pickaisle.con(A_i). t0 ~, u2 p- W* a/ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 T4 z( } R( M( @& D/ P else wait for 10 sec
3 O7 V0 z1 H1 ]' a$ A, X3 e if A_i=A_leave then send to die
! [$ q) k5 b J+ w% d6 Z$ N else inc A_i by 11 F/ s+ s6 d# ]* K
end, m3 h2 f8 b( Q+ W8 o
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,其它按你的 ...
|