|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢! Q& }( `( |) _2 m V# D# l
- l. i4 f% d" I2 N7 P$ 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中的数值,不知道会不会有什么不妥。
) a) c# b0 O! u) @! M, R! C
0 G/ q3 p+ n& @begin P_read arriving
$ c6 P# S) `4 ]& y( e2 o9 Y U while 1=1 do begin& d0 z* k/ a& @" {
read A_tote from "data.txt" with delimiter "\n"! K ?% C; s5 u! f/ {8 l' u
read A_time from "data.txt" with delimiter "\n"2 l1 m- W) {% y: }8 L
read A_leave from "data.txt" with delimiter "\n"1 g. y2 R6 n9 z' {
read A_picks from "data.txt" with delimiter "\n"
/ z, c7 K d! p* x set load type to A_tote
) C0 b( c; G9 q& { if A_tote="tote 1" then set A_induct to 1
2 q7 q @$ Z/ q {+ m* Y% a4 Y else if A_tote="tote 2" then set A_induct to 2
( l! D8 w5 m9 W( ^ else set A_induct to 3
/ {! }1 t! q0 s6 o' Q* k set A_i to 01 p4 D2 e3 O$ o6 ^
clone 1 load to P_induction
9 I I Y4 p+ W0 q& o) c wait for A_time sec- P5 r6 F3 D8 m. w6 W: ?% V
end9 u# u4 I, G1 z6 N' u9 L- ?- u
end
* F3 C2 s" v/ c3 [4 f/ k7 ^
8 E* P% C% X/ K5 u! Jbegin P_induction arriving3 g1 D, f, U& B, ^5 z# z
if A_induct=1 then clone 1 load to P_pick1
/ x* B, M6 c/ }5 i else if A_induct=2 then clone 1 load to P_pick2* s+ b& ]$ Y7 _. Z8 x; f
else clone 1 load to P_pick3
$ q! [; `. S+ X1 I6 Tend6 X6 ^8 @5 ]5 w7 u' h/ J9 d! @( ~
: K- K; W; f5 ?/ F6 s a1 L
begin P_pick1 arriving' V$ m# r$ H( I: }4 @3 M- e
set A_i to 1( I: f/ b( Q8 A4 D5 m `
move into Q_induct1! X5 e% A* W- q( H1 n0 y
move into pickaisle.induct1
3 B6 D- @- V8 t while A_i<=30 do begin6 c/ j7 t& z1 a
travel to pickaisle.con(A_i)
; G& X, s/ S9 r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% S# P6 k$ y5 _5 y- e: t2 T7 { else wait for 10 sec: Q5 ?9 c* ^. u `
if A_i=A_leave then send to die4 t8 D. d! ]: l5 v2 H
else inc A_i by 1! N4 O+ _6 |2 u, w# b+ a
end
: o2 u4 L! x& ~8 S- f5 o" f" E. S2 pend$ T6 ^/ w+ c# ?6 M: Z% l( o: M- r
, N: H: h" {9 F6 [3 G! B, P
begin P_pick2 arriving
0 h7 I3 _0 M9 R5 `* ~! I; r/ M set A_i to 11# U4 m6 ]% y4 S" M" A7 |9 J. N
move into Q_induct2
3 v: ` F0 u, q& v move into pickaisle.induct21 F# M! a8 I4 k1 h& [3 W
while A_i<=30 do begin9 M/ g$ s* v) C. N. {
travel to pickaisle.con(A_i)4 v2 T9 d3 O* f6 `6 L0 r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: g5 Q! T; J ^ else wait for 10 sec
* t5 d1 C M! N. P if A_i=A_leave then send to die* }+ C4 D2 @' ?& O6 E6 @
else inc A_i by 1
9 ?, W' ?/ A3 d& d Y end
4 p, v. R) P5 @% zend, w4 C" ~6 Y4 U" }0 E
+ K4 ?' o; O$ [8 Y! o& f. j. ybegin P_pick3 arriving/ u" C) ] K/ _+ T
set A_i to 21/ F- |, C- B( s4 C* _6 L! h1 a
move into Q_induct3* a" I* e$ L- B& }8 L! }8 o
move into pickaisle.induct3; i5 X# H, j3 @) K5 s1 D
while A_i<=30 do begin
, u) m# w; t0 h4 ], L travel to pickaisle.con(A_i)- t1 Q7 l+ G4 V. M4 B: m/ u8 F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; r( u9 o7 o/ g
else wait for 10 sec
! Y2 o' c5 C, L7 s if A_i=A_leave then send to die
# t. y. e* u7 Z$ r7 a; Z# V9 ` else inc A_i by 1& s% @ D2 x* U! Z& f( b9 `1 `1 v
end- i+ y" r4 ~2 ^% u5 k0 |
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,其它按你的 ...
|