|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, M7 Y t% F: I! V* |
. y- O7 K& |3 z9 \* h我的问题是,在每个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中的数值,不知道会不会有什么不妥。
; S; K5 k: X7 M9 H T9 d: k4 v j; c3 c) R
begin P_read arriving
0 K) ?. w# B6 f$ ?8 l! s8 N# N while 1=1 do begin, T6 R4 k) ]& j
read A_tote from "data.txt" with delimiter "\n"- ~$ G$ E3 }) Z8 `
read A_time from "data.txt" with delimiter "\n"
- d% [; E3 q2 N2 K, ] read A_leave from "data.txt" with delimiter "\n"
5 B0 Q+ E) O6 f( x- h" S read A_picks from "data.txt" with delimiter "\n"6 x/ i- i) D) B+ o) {
set load type to A_tote4 S" Q5 ~7 M3 X$ G# \; g6 e
if A_tote="tote 1" then set A_induct to 1, t' [, x* I; D* ~
else if A_tote="tote 2" then set A_induct to 2
) `% v7 }/ B- C0 q5 E else set A_induct to 3 7 R! I2 X) \6 O1 U) v3 S
set A_i to 0) U0 D, p7 A- `! \
clone 1 load to P_induction4 b) X: Q C& p J; ]# U
wait for A_time sec9 w( x& A) [9 y
end
% s8 N u, P2 p' nend
# k) T) l! L' i% Z% S9 C# @ A' i3 f% A# J
begin P_induction arriving& u# @) V. }" @; ^) t: L- G2 q# m# o
if A_induct=1 then clone 1 load to P_pick1
8 F. @5 b$ A: m8 x/ ]( N else if A_induct=2 then clone 1 load to P_pick2" q2 W! Y9 C- {: ]* D
else clone 1 load to P_pick3/ q2 j% x8 } x, L: {
end+ e- Y) x9 R o0 A/ ]) s0 r
! U0 F" [' H# t0 I
begin P_pick1 arriving
0 y% i2 C F8 U set A_i to 14 A/ y) i3 S! Z6 a! b! f
move into Q_induct1
% M& r$ N, ~7 \8 g0 P: |; ^2 w+ P move into pickaisle.induct1( y2 E- a6 [' ?' g2 w6 L
while A_i<=30 do begin
& N' D2 c8 V. B, R' N# C: o travel to pickaisle.con(A_i)8 x- P; e: G, G5 t; ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ]. O" h" Y. X5 b: \! i% U else wait for 10 sec1 F, h6 z+ A$ X# z9 M* a% Q
if A_i=A_leave then send to die0 u+ }% q7 S3 g- w
else inc A_i by 1
' C- J' x% D" ^1 u+ A end
0 Z4 b2 r5 u! ~" d% |8 Mend. R. r/ X9 i+ _6 m
- h9 U; _8 b8 [! G' Q& ~$ nbegin P_pick2 arriving5 K4 }, k8 o: n/ K: T+ h& U
set A_i to 11; I9 M) f6 R5 D& g& z6 d9 }
move into Q_induct2
$ n0 ]) I& [4 q" f move into pickaisle.induct2 W/ y6 U$ d7 v8 i0 Z2 T6 [- U9 S
while A_i<=30 do begin
* B4 }' [4 k1 i9 C& K travel to pickaisle.con(A_i)
9 [3 ^$ _. K& G W7 T3 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) G0 _$ U, S$ S4 `4 m( \
else wait for 10 sec- K) C3 A- _! v) [4 D4 z
if A_i=A_leave then send to die
" w' M' K7 q1 P% ] else inc A_i by 16 F8 V7 y+ a y" K3 S) f% [
end
* N% {+ T. o0 @+ T5 U2 p9 Y4 aend
' r, o& Q: ~* Y) B
0 R& `' A" Z6 S8 O3 fbegin P_pick3 arriving- |0 o3 |2 ?* w7 k5 K6 ~
set A_i to 21
$ }3 G% ?& }1 k4 t3 T i move into Q_induct3
% n2 ?9 P, y; H7 O' L3 { B move into pickaisle.induct3
/ O& k' O. E4 N- K# Y% f while A_i<=30 do begin" ?4 m( D6 w( i' W7 @, [
travel to pickaisle.con(A_i)4 i" X/ q* q7 u' S, p {1 U* V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& P+ _/ L$ g% s& n, e. A else wait for 10 sec
' T# h6 x, j' Q( q6 r' z if A_i=A_leave then send to die0 m8 z# }' ~$ V0 o9 ?
else inc A_i by 1
. n2 ~2 ^; {0 M, b% w end) F! O- W1 o" I @* q
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,其它按你的 ...
|