|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 i1 c; p% A; s+ z+ q5 D( K; R' ?. o' V- {, e3 B
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- v, n" i( _. S0 _" |% g
6 C* @3 C$ D6 ]6 I4 J# Dbegin P_read arriving, N' d ]* x0 U* r, w9 s
while 1=1 do begin. `$ k$ K7 J" O" y- h* p" h, [
read A_tote from "data.txt" with delimiter "\n"
]6 x3 b7 w7 H6 P/ M) e9 f read A_time from "data.txt" with delimiter "\n". B2 a7 n) d5 C0 a7 d) G
read A_leave from "data.txt" with delimiter "\n"
2 M6 c# C) n, \/ H: T7 B read A_picks from "data.txt" with delimiter "\n"$ B8 O$ w. U: G( t0 D
set load type to A_tote/ `( }2 C5 q9 U( x* u
if A_tote="tote 1" then set A_induct to 1
; V3 w. H2 l( T9 n else if A_tote="tote 2" then set A_induct to 2
4 D+ g$ ?7 b5 N( Z5 R1 C else set A_induct to 3
! ~: a5 D, E$ M* _# ~' L set A_i to 0
! m! J6 s) g$ S, _6 d clone 1 load to P_induction
. R3 t/ C0 S2 g wait for A_time sec9 O6 o( V& Z! \: ]. `3 k
end9 v1 }! q; W& j2 A+ A
end$ G8 L7 T8 s( S+ X/ @
& D9 w2 }$ v* d6 \+ r
begin P_induction arriving0 f3 o, D3 y. H$ }# t
if A_induct=1 then clone 1 load to P_pick1
3 Y: N- ^% l0 a3 f( E. L else if A_induct=2 then clone 1 load to P_pick2' d, z' i& ]" h! X+ G$ g# I- J
else clone 1 load to P_pick3
& W0 G7 I7 w z6 n2 bend
' o+ L- d, c0 r7 {" W4 B* \" @- L& p* K0 K
begin P_pick1 arriving
$ g/ C8 d. [+ n* R4 l0 \3 ^ set A_i to 1+ Q, W* j: X1 I% U4 [
move into Q_induct1
. ^0 f" U7 U/ V: T move into pickaisle.induct16 e/ u3 v: r- a" x5 H3 v: X& W
while A_i<=30 do begin
% Q2 B+ j9 ]* }' H9 s travel to pickaisle.con(A_i)
) `0 G2 B' Q- T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) ~. m& X5 E# e7 V else wait for 10 sec4 H2 G( t' @, s: c! b" d
if A_i=A_leave then send to die
) K2 ~5 g3 y9 K else inc A_i by 1$ i( r7 ?% B7 R" L& f0 {
end
9 u O, S6 g. y% M& lend5 o6 l- T$ W& A3 W- a
1 Y$ _/ H, Z, |$ l8 V" a g) A
begin P_pick2 arriving
' i9 Y' L. N; S- M1 _7 V set A_i to 117 I5 E/ E6 Q# u5 Q3 a+ V
move into Q_induct2
" |* ?5 ?& I. \! Q0 W* b" F' C; @ move into pickaisle.induct2
! m. q4 k! s: D6 X& Y9 d while A_i<=30 do begin
5 k% v9 Z7 P- U; j1 @ travel to pickaisle.con(A_i)$ F% @- s! F& f6 j: i$ j9 }" T2 o; E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- t# i9 G2 E4 n+ ^4 o else wait for 10 sec; t D: _8 Q8 q% m5 a8 `
if A_i=A_leave then send to die* o1 t* F1 ^6 {" S2 k5 V& y: d6 [& p; b
else inc A_i by 1; A- x/ b; i @. b# I" e6 {$ U3 ?; V
end
% S0 n* b. ]! s! W7 V: yend
) R+ z9 g3 l* m" P. F4 r( x. _% |3 R7 \1 E! A# K' z
begin P_pick3 arriving3 {, o( K4 d2 T( I: G
set A_i to 21( o- D2 V7 ]2 j8 X& ?
move into Q_induct36 C7 {9 V, s) u1 l% f/ X
move into pickaisle.induct34 g# H p% e: _! ]( c
while A_i<=30 do begin/ {5 B5 l* S$ I" T" f4 y1 e: \) W
travel to pickaisle.con(A_i)
' R' b! y0 ^0 z; c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, ~3 l' c6 X8 g4 d" [% n, i else wait for 10 sec) t) ^$ K' B9 Z i6 c& `) J
if A_i=A_leave then send to die: B# J/ d8 f* r$ n. N
else inc A_i by 1: p7 a2 K* e! Z& ?: I ?3 Y
end
8 B9 ^) X5 G Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|