|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 T2 ^+ S; B0 A u' A N# e
% e) M2 X! `& z8 ?; ]+ x! l
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' g: c3 O }* g, X: p. T/ l, e
) j+ I6 {9 b. C" N: ~
begin P_read arriving0 W$ y5 o% O* q
while 1=1 do begin
6 m0 ^* N) S9 Y read A_tote from "data.txt" with delimiter "\n"% `. N' c. p E( N- ?1 h6 b$ N
read A_time from "data.txt" with delimiter "\n"
! l4 j! W* {+ k' F |0 v7 T read A_leave from "data.txt" with delimiter "\n"5 [' [) I5 A- J- p/ ]
read A_picks from "data.txt" with delimiter "\n") x- b, n+ I3 s# z! f
set load type to A_tote
, ]0 U. m+ d6 W% V7 _ if A_tote="tote 1" then set A_induct to 1
" q& ^4 f* f+ _! j V# D+ T else if A_tote="tote 2" then set A_induct to 2) d5 p, C* M# I
else set A_induct to 3
1 \) B; t" O9 v9 o5 t6 S( [ set A_i to 0, e. Z; r* E) b% v- n
clone 1 load to P_induction
) S; a) l9 v) O5 N9 b) _3 b, u wait for A_time sec
H) u; l; ?& r2 x5 h end
1 N; Q! G: ?, N& q( c) [end" ]& M9 v% [9 `+ `
x/ h# i- Z: @8 l) qbegin P_induction arriving
5 T) x- a1 s( ^ if A_induct=1 then clone 1 load to P_pick1+ ?; J. W) p$ i' {
else if A_induct=2 then clone 1 load to P_pick2 A7 I g( s* X0 h! e
else clone 1 load to P_pick3
, U) W2 B. N3 A6 y. M+ ^8 |end. @) e! D3 D$ M9 a6 r
! d* e- F2 P( C# P
begin P_pick1 arriving# T$ Y( d1 `! ~& K) U6 S8 s/ C* w
set A_i to 1
$ g0 t* c; _* y" h5 r6 H move into Q_induct1 r1 }% G& q* e' H1 \
move into pickaisle.induct1
# W2 ], }5 v% A2 b0 ? while A_i<=30 do begin* I3 @/ d7 L/ Z/ W9 D# }
travel to pickaisle.con(A_i)! [0 M8 [5 v/ F$ D3 p: q, S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 z6 W/ o2 v$ [1 M' Y" Q
else wait for 10 sec
- E/ E/ s9 _! u/ d U y. R' e if A_i=A_leave then send to die7 h5 u9 e2 S7 g" P5 `2 F a
else inc A_i by 1$ ^. f- n2 p' e: w0 D" S2 e
end/ k$ h j& d9 I( S4 ?3 s4 y
end7 s9 \4 l3 S% U) }% n6 m' p
2 l J9 C/ L6 C& C0 J: |
begin P_pick2 arriving( d; ~8 M+ H1 q7 l. Q5 t
set A_i to 11% z3 K. H+ `; J8 S
move into Q_induct2+ X' W& }: C! }' }0 X
move into pickaisle.induct2
$ y" M" X$ P, w: A1 D4 t while A_i<=30 do begin
# ?3 z0 Z T, a, _9 n0 B& w: p, [ travel to pickaisle.con(A_i)
9 U0 n$ g' N9 b8 j7 p" F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' w. y o6 @' m8 X, M* J7 s else wait for 10 sec
# ]; D3 o3 p4 W1 x, s if A_i=A_leave then send to die
) j0 f/ {6 H( W7 s else inc A_i by 1
: j6 t1 h3 t6 \8 a" [$ b( o/ h+ c4 I end/ _. E! E1 A5 K9 f+ \5 ^# i
end
# ?0 {' |5 r0 b
/ M. C. V) Y7 Z; _0 }begin P_pick3 arriving3 D5 `/ l, c: h B0 d; h8 t
set A_i to 21' Y7 R& h2 j/ `, N$ R# `
move into Q_induct3( s9 ^. i3 p" ^- X) S0 [
move into pickaisle.induct3 [" v4 X' a- U4 g# q
while A_i<=30 do begin
; C; o' V, S6 C. z6 Y travel to pickaisle.con(A_i)6 ^4 _1 K+ E7 G( A. p. [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; T; z" A$ e' `! O2 W
else wait for 10 sec5 q" ?; e- g, o" ^5 G) c8 ?
if A_i=A_leave then send to die
+ N, _9 b$ m( ~9 ]2 M3 ? else inc A_i by 1
% x5 @ M) ?& s7 Z& j) b: P. ] end
4 |* W- `3 H# Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|