|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) J" g* d$ D( Z) _
$ @ Y) l6 Q/ D! 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中的数值,不知道会不会有什么不妥。- R: [9 }$ r# T5 M6 `
2 K3 n7 ]4 n+ ]6 x$ [begin P_read arriving
2 `. } T% T+ x8 s9 }1 p while 1=1 do begin
/ j# W; ?) n4 K0 P8 m read A_tote from "data.txt" with delimiter "\n"/ T: y5 ]/ a$ `5 m5 m( `
read A_time from "data.txt" with delimiter "\n"
, V; S) ~+ g( R( f2 C' m6 K @ read A_leave from "data.txt" with delimiter "\n"( @" C: M( X# E1 c! T% }
read A_picks from "data.txt" with delimiter "\n"2 O4 v8 k+ p% ?7 P M3 e$ F
set load type to A_tote# g8 l& u" L3 a5 F0 M- ]
if A_tote="tote 1" then set A_induct to 1
$ _: p) J" r, A: l4 |9 C: f else if A_tote="tote 2" then set A_induct to 2
B5 k y" i; ]' L5 g8 v- B/ W else set A_induct to 3
* C5 K4 W w. M set A_i to 0
& i1 k" l) e8 P; _5 I7 U/ I clone 1 load to P_induction
( @5 \* f7 F' F5 p wait for A_time sec
; }, R* D0 \( R$ E end5 k) u2 H9 k( g8 g' H4 [
end
" V; B: `0 B6 n6 y. \1 k3 A6 C1 O. w( ~' O2 U8 {3 d
begin P_induction arriving
: C. t3 u# p. o7 ]5 h6 ~2 _/ S2 Y) | if A_induct=1 then clone 1 load to P_pick1
% _! D, H5 J6 n else if A_induct=2 then clone 1 load to P_pick2, k' U3 j$ x A
else clone 1 load to P_pick37 J# ~# c: e0 x1 z
end$ q1 b) @9 U" j. i0 }* _
' b: P- M6 f5 D4 O+ }7 L% ~
begin P_pick1 arriving& X+ ]1 e3 w7 b/ m' e6 V B: `3 o
set A_i to 1
|3 v2 A; r/ B4 x, I move into Q_induct17 O/ X R. q6 F/ E- H3 ]
move into pickaisle.induct1# J, L2 i3 a1 t/ D
while A_i<=30 do begin" y% S0 u) y2 ~* H
travel to pickaisle.con(A_i)
2 f% R I$ V5 K" t4 S5 M if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 H& w) O [$ t* n
else wait for 10 sec4 r5 D. Y. e+ H: T# D/ K
if A_i=A_leave then send to die; m# s3 H [6 [# ^1 k/ J" j
else inc A_i by 1
' j9 O8 [' X) S p7 R( W end: ?% x S/ \4 c5 E+ [* g( G
end
( s( {2 x+ S* y! @9 r2 ^
, o3 W1 e2 e' O! E8 D% t. Ybegin P_pick2 arriving
. R6 e, Y% A% p set A_i to 11/ [5 k& l/ _* k4 d. {9 ~) \
move into Q_induct2' n% ~1 r- x3 q
move into pickaisle.induct2
) J9 G; }' w V. N8 W while A_i<=30 do begin* o6 C* a# Z( L4 H0 S$ |% D/ ]
travel to pickaisle.con(A_i)
- ~+ y0 _! e( F. x5 Y$ E- R" ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J/ L4 _& @! d, ^- f& f else wait for 10 sec" E! i3 h- _* g
if A_i=A_leave then send to die, _$ }# {: z& e
else inc A_i by 1
; r7 V. u1 V+ n2 M6 j8 k1 V: t end
5 M X6 L1 d$ uend: E- o1 Z' X# ?6 x- q
1 @. i& A" i8 |" _% v0 bbegin P_pick3 arriving3 c; l2 R& R' j1 Z; Y$ G
set A_i to 21
: i4 _0 C! ^# D+ R, h/ u move into Q_induct37 G) A# Z7 {7 G; Q, v
move into pickaisle.induct3# E+ }; _) b% Z& U6 b5 ~3 Q
while A_i<=30 do begin
+ M& p8 H) n+ l3 l) Q' x# |; K travel to pickaisle.con(A_i); \+ w& f) X& s8 l/ D6 ^3 ~. k
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' \( e7 @2 y- U- w. r% |0 O1 ^% {5 w5 f else wait for 10 sec$ K/ _+ y% G+ k" p7 D" S
if A_i=A_leave then send to die
- c- e+ w0 j7 n& X- o else inc A_i by 1* P. r( c: t& `) u, Z3 A( _8 ]5 J
end
, C& P3 j. b9 [) s' s* E; oend |
最佳答案
查看完整内容
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,其它按你的 ...
|