|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢+ a0 f/ B+ K4 D1 L0 j R7 J
, m5 |- e! u$ ~1 I) u7 Z2 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 L6 @$ U |. d; y* ?; W* ]9 A+ ?: V
begin P_read arriving
2 Y6 l; K0 m! N while 1=1 do begin$ e) w) |; U( Y, @+ f
read A_tote from "data.txt" with delimiter "\n"
/ j# | `, O( K z9 {. j; P; C read A_time from "data.txt" with delimiter "\n"9 F, P6 V! s4 d& C( {9 W
read A_leave from "data.txt" with delimiter "\n", z) M" G1 m" M! p+ M$ Y# ]
read A_picks from "data.txt" with delimiter "\n"
$ C. m0 o) x7 m! N set load type to A_tote
+ M0 Q3 I' X3 ^( q: h if A_tote="tote 1" then set A_induct to 11 U& N" J3 L2 F- J2 m) J) K {
else if A_tote="tote 2" then set A_induct to 2
' H' ?) h( V) P# Q. v& Z3 a else set A_induct to 3 , l7 j7 ^5 e3 ], b; g
set A_i to 0# U4 e: F8 ~$ j3 O/ D" {
clone 1 load to P_induction" B9 O1 I7 b7 S& l
wait for A_time sec
! m7 t) ~. d3 _% G" X end
, V3 O& X, ^+ `& ^end, E1 o% D/ s% z# c& q6 c Y
" K( n$ V3 [. B$ S1 a2 \" N
begin P_induction arriving3 {6 c/ r5 Z3 W8 V
if A_induct=1 then clone 1 load to P_pick1$ Q' H2 N+ }! V0 i5 H
else if A_induct=2 then clone 1 load to P_pick28 S: f' I+ b9 \5 G* R# ^
else clone 1 load to P_pick3( \, N9 e% {6 D# M9 A1 S a; Y
end
; c% }$ o) x" N
}, L7 W* f) `) \8 I3 Xbegin P_pick1 arriving& S7 Q) Q* Y v, ]
set A_i to 1
- D# w9 y$ }5 v. x/ A move into Q_induct1
2 h4 x7 G) \ K( b- Y move into pickaisle.induct1
2 \6 b( Q$ ]5 V% v0 O2 g1 ] while A_i<=30 do begin7 o# B) M5 `9 h# R4 \
travel to pickaisle.con(A_i)+ r0 }$ I1 S1 f" m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 t" J) ~* @7 T% I) g& h3 t6 M else wait for 10 sec* [1 g6 V. N7 M+ w6 o
if A_i=A_leave then send to die0 M K% c$ e: ^
else inc A_i by 1
0 g* `5 n5 ]( N end0 j* h6 M! H4 s4 p+ W
end) \! X, M5 v9 k. e4 M
6 B) H( m5 [8 ~4 v3 H' ?begin P_pick2 arriving
6 Y" c1 g* E$ E6 C. E5 F set A_i to 11# N- a( l( x& X1 h4 X7 R: r; X
move into Q_induct20 S, T5 k' `1 ^* L3 z% r, I* [
move into pickaisle.induct2
o* Y5 R1 _3 F+ K) M7 v3 v9 B while A_i<=30 do begin! O- b2 v8 F9 O& W
travel to pickaisle.con(A_i)
, {* d4 }2 C: J8 |* k4 @& ~8 Q" L" p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- y% p& q6 v7 v% ?- | else wait for 10 sec
$ j0 P6 I$ d e if A_i=A_leave then send to die4 V/ F. i4 P: j1 y3 Y9 I8 u
else inc A_i by 12 t; i- w6 A' s" e, R- O) S4 w
end
~7 D1 b7 F2 u+ [end- D+ p8 v* n, v9 W% g
* T2 G- u4 C9 F8 h4 Mbegin P_pick3 arriving8 ?3 V7 Z2 k1 m) r: c
set A_i to 211 Y! E% K3 l9 _7 a. U Z1 d+ X( J- ?
move into Q_induct3
$ W5 p R; s) ~& z move into pickaisle.induct3* l* T4 x c- }0 `
while A_i<=30 do begin9 @) P) q& o+ v9 e( @
travel to pickaisle.con(A_i)
) d. h' Y% F1 D6 Y% M% N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 t& F" [- B4 T) B! s8 b( @ else wait for 10 sec5 H- x3 D6 h) | {* O
if A_i=A_leave then send to die
; z: n7 t3 L, _2 {% g else inc A_i by 1
0 ^+ c4 y. V( p# B6 \# I end
! g6 }# j' x2 }( @+ _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,其它按你的 ...
|