|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* K' x8 \( X8 }9 Q* Y* z9 ~+ {! l* G7 O5 W, 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中的数值,不知道会不会有什么不妥。5 Z' i0 b3 E8 I/ }
0 l, j; A0 b. ~8 b
begin P_read arriving
u# G" `* m- |: O while 1=1 do begin: L) g8 ]8 \" N. t; ^' t/ F
read A_tote from "data.txt" with delimiter "\n"
$ O' e0 h+ T- V0 f$ U4 i1 K+ _7 \ read A_time from "data.txt" with delimiter "\n"3 [9 M. n2 n$ e- M. q
read A_leave from "data.txt" with delimiter "\n"
2 x* o4 K3 Y) \9 s read A_picks from "data.txt" with delimiter "\n"
* j1 T8 Z; w1 _' k7 h) | set load type to A_tote0 f s6 d) P- T% f
if A_tote="tote 1" then set A_induct to 1& F+ G, X5 |. E2 y& o8 S
else if A_tote="tote 2" then set A_induct to 2
! C; A+ ], u( }0 R- J, ^/ @ else set A_induct to 3
/ j. d9 a& m; A: c( h set A_i to 0
* l5 n0 p1 ~" ?! u. y/ z7 u clone 1 load to P_induction
9 w# A- v$ }8 W4 G wait for A_time sec
# p3 o% [3 g4 \" h3 Y/ I$ |/ G$ U end# ]& o3 n$ ^ l- z7 N
end
) e8 ?5 H" }5 ~/ m L' L# k7 y; G3 U' [6 X
begin P_induction arriving/ J( x+ ~0 o) r, G6 b# r K
if A_induct=1 then clone 1 load to P_pick1
8 c- g+ e& {- s7 r1 s% W% Y3 P( M else if A_induct=2 then clone 1 load to P_pick2
# x- e# q E6 d! L U1 ? else clone 1 load to P_pick3
" }, N/ I9 t5 B- aend* y$ A4 w; K3 N! c I
: f/ K; ^7 k/ `) Mbegin P_pick1 arriving v; I6 ^: _% ], ^3 C' j
set A_i to 1- @3 X/ ]; I& M' e g/ E7 \
move into Q_induct1% `- |& i& u/ Y. Q4 U* S1 i3 B% h
move into pickaisle.induct17 N. ?1 c3 y j. b' b: m" \
while A_i<=30 do begin) |# |# u. [- O2 y) W6 W
travel to pickaisle.con(A_i)8 h- U' o, @5 q5 D( r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 s9 t, M' K* X. T
else wait for 10 sec {- S- v. D L/ [/ U0 Y
if A_i=A_leave then send to die# }2 z5 E3 A/ _# h
else inc A_i by 1. Y6 G ~/ l* _) P- B* {1 m
end
- n' D5 t ~: I; M- ^/ V% o" Tend
+ j( B$ J+ L: U% q& o8 y4 U! Q; t) f6 u. c7 c6 F
begin P_pick2 arriving3 Y6 z. A* [7 J, C
set A_i to 11
# E$ |, h0 G+ }5 U+ @* a move into Q_induct2
1 w, p2 Q# l7 v move into pickaisle.induct29 G1 Q$ M( O, {9 c- F8 U1 I4 g
while A_i<=30 do begin
: L5 o: C* k/ j/ T- v9 u8 f travel to pickaisle.con(A_i) _2 S0 [8 x0 w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 q) N$ [2 q% N% i
else wait for 10 sec. D( L3 ~0 ~$ D
if A_i=A_leave then send to die0 I; E7 Z% x* Q, {" W
else inc A_i by 1
6 F' f; y! i: o) R, i end
# I9 c2 M3 e, Send: t& m# _; |# s( R$ C0 [9 p
0 O) R! d+ D7 A5 P7 X
begin P_pick3 arriving! S* Q6 F" {/ m! e
set A_i to 211 {1 L1 n, {% u
move into Q_induct3
' }! g* ]+ A9 ~ move into pickaisle.induct3) p' ~7 S- u6 y& I5 c1 }
while A_i<=30 do begin
& ?! B5 u# n% A& { travel to pickaisle.con(A_i)* W8 q( F4 ?3 } l
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' {. ?' h% t0 P- F2 K- y2 [: n
else wait for 10 sec
5 N( @$ ~8 Y$ K if A_i=A_leave then send to die( M. ^/ a, \4 ~5 b1 X6 n
else inc A_i by 19 D9 g v7 G6 g
end _( ]$ c6 q: [6 x) r
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,其它按你的 ...
|