|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- U+ d- I& m( k2 [+ W
5 P) l, c& w4 i我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* O* _# {; b% D- G5 \! Q$ H1 _% @
2 e: B! ^4 {. R4 I% g6 ebegin P_read arriving* j0 \' M9 G, q. J5 b) |/ h
while 1=1 do begin3 @$ G; M, Z' y) c% n- z. _0 j
read A_tote from "data.txt" with delimiter "\n"8 k5 ]! S* V5 K( f: q* t4 L
read A_time from "data.txt" with delimiter "\n"
+ A1 [' Z$ h! q. ^ read A_leave from "data.txt" with delimiter "\n"
/ Y) U* f) D( q( u3 C5 b read A_picks from "data.txt" with delimiter "\n"
8 s% K& J% g! P' L set load type to A_tote: d0 T" l; |' r/ N, F' N
if A_tote="tote 1" then set A_induct to 12 O/ l A. y# ? {: B; S
else if A_tote="tote 2" then set A_induct to 2, }9 X* }2 B2 N& o" |7 B4 y$ {
else set A_induct to 3 ! b) w" @: {4 N H, b
set A_i to 0
. U/ h! l; [, _4 g! B: k clone 1 load to P_induction
- Q. |& i* [2 \! C# E% S) S wait for A_time sec
# Y$ b. O# T: _1 Z end
" S, d& }$ |6 v; Gend
0 N6 e, A6 P- l a; t/ [2 u1 \0 L+ o
$ _ X2 `6 h# {2 H8 `begin P_induction arriving1 g- [. v1 K, }0 Q# x# o
if A_induct=1 then clone 1 load to P_pick1& F" b! w% |- ]: k
else if A_induct=2 then clone 1 load to P_pick2( e( Q6 h0 Q1 V- p5 s5 |
else clone 1 load to P_pick3/ ~, w# n: i* Q
end
' Q+ _3 L$ Z7 f! l
: d1 L' W9 b8 cbegin P_pick1 arriving7 l7 |# b; ?2 P
set A_i to 1, [- q3 q/ u3 z, i
move into Q_induct1
7 x& |- @# H+ Z0 T& r move into pickaisle.induct1+ x2 Q% N% P& E, b. w
while A_i<=30 do begin
6 a7 J5 S! M6 L+ s/ @3 n5 l travel to pickaisle.con(A_i) V( V7 d- Z1 q# W( v. o! O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ C1 ]; x$ D4 I3 s
else wait for 10 sec/ r9 {5 ]: b( p0 ? Y1 U
if A_i=A_leave then send to die
$ U+ k, S5 e) y else inc A_i by 1" S* _/ k. a% o( p2 h6 I, _ V
end
6 ?) a+ R2 i [ Hend% g" e* Z; R$ l/ o' P6 x& F! i; Q
: X$ H2 A) h, Q2 d/ Hbegin P_pick2 arriving
3 w" n( O5 ] _' ]: V; V set A_i to 11* F( a( S* ^7 x
move into Q_induct2% h! Z9 M% s) N: E2 f3 D, _0 i
move into pickaisle.induct2- S ~9 \/ z' x6 Z/ ?+ L
while A_i<=30 do begin
' }) V1 E4 a5 @9 @ travel to pickaisle.con(A_i)+ B2 O2 d! D! `% ]1 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& Y5 y# ^) {5 W/ F* m, }
else wait for 10 sec5 d0 b" R, Z: p- N
if A_i=A_leave then send to die
' M" `2 U/ Z6 I else inc A_i by 1
% a& w& d5 j6 l4 z( z end) I9 f4 g( b3 p2 N. x. `+ g# B
end
5 J- l# u: u$ c
' U$ J! c c2 m- C3 S( T- m/ _$ f! P/ Wbegin P_pick3 arriving
% P2 S o4 G( J( }7 n. ?: j set A_i to 21. O' h6 n: b( s5 M. Q
move into Q_induct3
5 C6 a; N4 l9 v& x: N- v move into pickaisle.induct3
& L: b+ T4 K3 U* k8 R5 O3 C while A_i<=30 do begin
0 C& l- F. d: n! \ travel to pickaisle.con(A_i)# q y. k9 ^, L k2 s/ q4 N6 p
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 _; q, h2 p6 S( j
else wait for 10 sec
! E. M( r `" L T* w- p. Q if A_i=A_leave then send to die
) w# a Q0 | G9 q else inc A_i by 1
' |' l0 }- _3 A8 h# S1 H end
: ~4 X. }8 ~6 [' G6 B9 }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,其它按你的 ...
|