|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢9 `' W5 i0 B1 X" e+ A8 J0 u
! Y7 |$ J6 |% l6 o8 a4 i, E我的问题是,在每个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中的数值,不知道会不会有什么不妥。' L9 f. |/ E# ]- i' W
; Q+ ?5 Z9 b$ mbegin P_read arriving
, P3 j" ^. `; {/ n while 1=1 do begin
' o0 I& ]. k l read A_tote from "data.txt" with delimiter "\n"8 A$ A* O/ U7 t$ @" M4 N
read A_time from "data.txt" with delimiter "\n"
4 L( L4 [$ ]% m! ~5 d" B read A_leave from "data.txt" with delimiter "\n"
& _7 c, X* O$ p read A_picks from "data.txt" with delimiter "\n"0 C; S) ~0 h+ D" C
set load type to A_tote
* t2 ^& u# J. L9 ^5 c) l' }7 {$ E7 A if A_tote="tote 1" then set A_induct to 1
) @* L8 i3 r7 t: J. b, ?- e else if A_tote="tote 2" then set A_induct to 25 r1 d2 s6 W; U+ Z1 q
else set A_induct to 3
$ q5 P# G+ W) j- u* r set A_i to 0
( t' O" [6 q, u! D& o clone 1 load to P_induction
, k9 J7 @4 w* s5 |# j/ f4 M2 F& { wait for A_time sec$ w3 B8 a% A7 v P x M! A5 e7 X
end
/ P! u0 _7 n! P" Qend) _$ I `: F$ N( d% Q1 n4 C
, j4 ]( c: z3 k2 s8 ?" d/ E, {begin P_induction arriving
9 ]7 N: J5 r/ i: |# T$ \ if A_induct=1 then clone 1 load to P_pick16 C0 E% _4 s/ y: h/ m& N
else if A_induct=2 then clone 1 load to P_pick2# j d, u0 g3 p2 E) R& i
else clone 1 load to P_pick35 k7 a# E5 ^7 v1 A3 L
end: a1 l5 [, i8 t& L. U( |# F+ A
" n7 t4 B; ]+ \; B
begin P_pick1 arriving! A" n. I+ B) f. f9 M
set A_i to 1
. h" w9 k+ d5 `. A/ X4 Z6 R. q+ [! V move into Q_induct1
, ?& a \" C4 X2 e move into pickaisle.induct12 _$ d9 d6 F' T
while A_i<=30 do begin
9 ?; W! S9 A. k8 C2 f travel to pickaisle.con(A_i); b- L, |8 S# c* `9 M# H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% N' L! Z9 g3 J* |. ]# D0 G else wait for 10 sec
/ d2 O- U! P* M5 N, _ if A_i=A_leave then send to die
8 R$ A3 g1 n; X0 z else inc A_i by 1/ L W' a" g8 \9 c5 `4 q
end
, R4 e H8 L1 R$ u/ Vend
; W- U. X5 ~6 N% e# E* x0 p5 O9 g7 l* ^4 h L. K( q
begin P_pick2 arriving
7 v: \& ~0 \2 Y: x/ P: u: w# Z) r set A_i to 11
7 Y$ o9 l* ~ v* t2 v& f move into Q_induct20 D6 d) t) J6 P: f5 t. d2 [9 j
move into pickaisle.induct2
" V+ U" ~/ o8 |. R' O while A_i<=30 do begin9 N- b- U4 M/ j% u6 Z' x' j8 v6 y
travel to pickaisle.con(A_i)
9 R; y: P2 B1 [6 `1 `$ T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 F6 d% j0 S1 q1 T3 _" w$ ` else wait for 10 sec
$ M7 b' O4 b; V1 B) Q* L if A_i=A_leave then send to die2 X7 {% g! q7 C) H- P- A
else inc A_i by 1( ?9 m, u/ G, o2 {1 J( M
end# F* f! i6 g# Z7 y+ y. f) b1 K
end, R/ J) L- Q) r& j- r' x
. l2 [: N/ h. M* Cbegin P_pick3 arriving
* G! }/ ~# }; K# v3 } set A_i to 21
; t9 y' B! V6 g/ l. W; G move into Q_induct3
/ m0 [6 r( ^/ _/ [ move into pickaisle.induct3
& q6 s! }7 @/ t! _ k while A_i<=30 do begin
! m1 Q; e- w/ j travel to pickaisle.con(A_i)
0 n/ ^& x" Q0 ]7 Y& n0 x if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ w! j# B4 X4 x else wait for 10 sec
, K1 n' ?, z3 L0 N9 x6 y if A_i=A_leave then send to die, i! t6 C: b" m1 m1 b
else inc A_i by 1/ N f/ m$ h+ O+ T! K
end
3 [1 `# d; R1 g: B4 ]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,其它按你的 ...
|