|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢/ y# u% F% Y y( a @4 l
5 S# @9 A J- i- c我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 m2 D O. R( k1 ?4 v8 U' k
7 f \8 `/ k5 k9 ?begin P_read arriving& @( d8 j/ l: j/ R9 j7 }9 e
while 1=1 do begin
; h" ^8 A; h9 K0 s& J read A_tote from "data.txt" with delimiter "\n"; ]( S5 L' N9 W' v0 i! Y% l
read A_time from "data.txt" with delimiter "\n": g( q# P$ L: z( D- S" m
read A_leave from "data.txt" with delimiter "\n"
' D, h# a4 |7 D5 C read A_picks from "data.txt" with delimiter "\n"
+ ]! E2 m3 d+ Z8 O) K ` set load type to A_tote
# U i) J/ Y9 p# Y3 I if A_tote="tote 1" then set A_induct to 1- |, f' I* q& k3 I
else if A_tote="tote 2" then set A_induct to 2
8 ^& @) Q+ K( a4 e9 k6 t2 _ else set A_induct to 3
3 X( X& A2 E3 ^+ b+ R9 h' I set A_i to 0' S1 F* ^- F! H& C$ g, Q
clone 1 load to P_induction
1 q$ A# M% g% M- T wait for A_time sec
% i" q+ c5 n1 }$ S& z% q. w6 {$ j end! B* Y( T+ H8 c; H# u, K0 }$ u
end4 z1 U' T) i. x x" o
* r8 A# y: m7 ?: y( P2 hbegin P_induction arriving/ b' F, `1 n( l8 Z S
if A_induct=1 then clone 1 load to P_pick1' X5 _9 Q( V- T- H2 E" u$ b. X( p
else if A_induct=2 then clone 1 load to P_pick2& J: X5 f/ k- B* K R
else clone 1 load to P_pick3
; v* e$ v* @6 O- j& E( h, `end; C/ u, S0 q2 E
3 i: m$ \5 f8 i. i& H& t( m, J+ ~2 B
begin P_pick1 arriving
& q: @; w; D: z. N# {/ l; V+ Z set A_i to 1
2 r; [! K4 _3 R move into Q_induct1
1 D6 Q6 t) d7 j2 v move into pickaisle.induct1
9 V: e, Z$ g& p/ n. g while A_i<=30 do begin% E' K3 N( @' n* f
travel to pickaisle.con(A_i)
1 h# k! {' s( S( C( o: S T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ v9 `0 C, s/ R( ?% o: \8 q' o
else wait for 10 sec( Y& c& G3 x' ]
if A_i=A_leave then send to die! y- ?) S5 Y$ S* k
else inc A_i by 1
4 W9 `$ G* K; m! C+ L% e end
. v2 j4 f8 o5 g# Xend
: q- D% w; `4 X z' v5 }0 d0 T' d3 G7 T9 d: `! r7 B/ O
begin P_pick2 arriving; v& e% p. H- G
set A_i to 11
& P) j* @8 v* o9 Z$ F1 h( a) I move into Q_induct2/ [( t) c! T) p- N) c& l
move into pickaisle.induct2
e4 B# [) M$ `7 Q( O) Y3 W while A_i<=30 do begin
* [3 l# E+ r! ?) U, {: A travel to pickaisle.con(A_i)) ~7 C1 D% K- M5 W5 ]
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 ]+ E0 b! u7 e0 w1 S$ K
else wait for 10 sec7 t% Q s7 S8 x8 U9 W5 j
if A_i=A_leave then send to die
2 Y+ P3 y1 V( U else inc A_i by 1! W; V0 o$ q% i: O n' C. W- P
end
, e& s0 S' |& d7 kend
* h4 J. E. j6 _6 r! X2 ]7 Q
; k8 y% G8 H" j4 `- V- u2 Tbegin P_pick3 arriving
) W% y- F' d# ?& M set A_i to 21: ~( t9 x' S& m
move into Q_induct3( e) j- S z0 s; L7 P1 k/ z6 A, }
move into pickaisle.induct3
: L' P- ~' {+ ^) B7 K. x4 I while A_i<=30 do begin
% p" q6 _! Y# M: R, l# a, r1 } travel to pickaisle.con(A_i)
8 R& n! X+ q7 g$ R V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% i$ O, m& L% @7 W a: m else wait for 10 sec, {4 A2 p3 @/ M+ u# [
if A_i=A_leave then send to die
- P) {% D" x: @( i& r else inc A_i by 13 D8 e( |6 \" t5 |' V; o0 |
end
* g; V& o) [. Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|