|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ m" y4 {: G3 U
6 |) J9 s" x" \我的问题是,在每个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中的数值,不知道会不会有什么不妥。; F1 e7 \/ C2 B; f) ]4 n- `
! R/ q% a# a x9 H: sbegin P_read arriving) Y, \! D- b! U+ R& }) G' x
while 1=1 do begin2 D, K9 r9 Q# J6 x" X4 f
read A_tote from "data.txt" with delimiter "\n"
( V; `4 j2 D; C2 I* i: j+ i read A_time from "data.txt" with delimiter "\n"
/ B L3 Q/ b7 x, t) M7 W" j+ G1 k1 w7 W1 \ read A_leave from "data.txt" with delimiter "\n"
; J9 }" k3 l! t: M read A_picks from "data.txt" with delimiter "\n"5 s# x U' [" t9 `. g1 G5 U/ K
set load type to A_tote; U) i8 r. L; h. @( G
if A_tote="tote 1" then set A_induct to 10 J$ [6 F' K" Y4 G" b7 r
else if A_tote="tote 2" then set A_induct to 2
' H% G, |. r2 D M+ J else set A_induct to 3 & p( X7 Y7 Q# y) W Y5 T8 u
set A_i to 0
1 J4 o/ E( y' j0 e6 p clone 1 load to P_induction
! g9 x6 t5 }; G* v wait for A_time sec
/ s% N2 c1 |, Z5 P; g end
: [# T' N' }1 e, p% q! j+ Gend' C' s$ ~0 M. i( [
% B% d8 i$ |* O3 _% @) h, ibegin P_induction arriving1 @, \& p9 y. K8 y0 @$ o4 p1 W
if A_induct=1 then clone 1 load to P_pick1
$ T, b" I! J3 r" [- n4 Q else if A_induct=2 then clone 1 load to P_pick2
% r4 y0 Y8 j4 b" ?2 L6 R. E; a else clone 1 load to P_pick3
0 E* |+ z: k6 ?& s" Zend5 C# p+ M5 C& g8 b$ Y
: k# l& x% c% d0 a9 N$ ? c- r. ]
begin P_pick1 arriving
0 J0 a: G& a* `* A/ N4 z set A_i to 1+ ?, u, T; Z# I1 n n4 \
move into Q_induct1
- h9 C% l3 `7 m3 ^ move into pickaisle.induct1
5 w. Q6 f2 v* c6 X* r, B while A_i<=30 do begin' ?! X+ E/ }0 r$ C: N5 T0 ?
travel to pickaisle.con(A_i)
+ H! o/ t: b" A* w$ u. O5 z/ A( i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' x% e+ g7 J/ U
else wait for 10 sec2 l" X5 X1 b+ \8 I9 ?( x
if A_i=A_leave then send to die
N d, f/ d; m; J! Y2 G+ Q else inc A_i by 1
, R8 V. E# a& c, {- C end) k; `; C) ?2 Q, F
end* x6 P+ x9 d- [3 u) U0 A& y& `( v
) a9 a( X5 R1 J3 o) h) c8 s
begin P_pick2 arriving
* f9 o, {& _( ^# F+ k& P1 H set A_i to 11% S# q( t& j9 u; Y/ `5 p
move into Q_induct2
* U7 y- Y* O8 N# v, P+ Y move into pickaisle.induct2
! b- \3 H0 z: E9 U9 a. I/ J5 E while A_i<=30 do begin2 @( F; G7 X' E/ X8 v5 m4 R/ `
travel to pickaisle.con(A_i)) J. p( b$ p" K9 ^8 u9 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 w/ Y2 O! p7 @3 [' s* [$ J5 d5 R' X5 J
else wait for 10 sec
# p4 [7 ~5 a0 m9 A0 } X if A_i=A_leave then send to die% Z/ Y7 Q4 C6 W% ?) r# u; U7 L. p
else inc A_i by 1! m# n% {$ m0 q# Q5 ^& W4 v
end& _ c+ s- |- j' G/ @
end
2 \* ]2 J) D2 v* A6 j; j( s7 y6 G z I- C
begin P_pick3 arriving9 S I" y7 y$ f3 G7 E3 D, a
set A_i to 21$ G+ r8 z, A, F2 U; a+ r
move into Q_induct3
/ z. w7 y* H4 U$ I. _- s move into pickaisle.induct3" _- k5 A- y% `
while A_i<=30 do begin
( B8 g3 J( k' y" i/ a travel to pickaisle.con(A_i)
3 N. G' D4 p [7 r; R- v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, D0 l2 K2 i' [0 e else wait for 10 sec* m/ D" P4 v& t( A" B
if A_i=A_leave then send to die$ t2 Q* X0 c. Q
else inc A_i by 1
2 ~; N5 F( b9 `' z; z5 y end* n- u- s+ `$ @+ O2 r8 f
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,其它按你的 ...
|