|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢7 A7 p9 o+ e6 C
' Z8 ~6 d- b% N% s' X6 r) 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中的数值,不知道会不会有什么不妥。+ c0 |1 [& M# A; m, N
; T! D. C% k0 {- S2 K" C8 H& }# {begin P_read arriving
% }/ N& t N+ P+ | u while 1=1 do begin9 T5 Z; S' Z# d2 r' |1 [
read A_tote from "data.txt" with delimiter "\n"
1 ^4 C& R3 C$ M+ I v- t0 k$ _ read A_time from "data.txt" with delimiter "\n"
/ B+ \$ Q2 L. A# p+ w read A_leave from "data.txt" with delimiter "\n"$ Q. K3 e' y" `; \! Q0 |- f: L
read A_picks from "data.txt" with delimiter "\n"
4 X+ z+ g( Y3 y% U9 K, c9 g set load type to A_tote: G- J: j: k. V/ {6 g! ^
if A_tote="tote 1" then set A_induct to 1
, Y: n8 _# d9 v7 n- S" }- \ else if A_tote="tote 2" then set A_induct to 2
2 m. k' t7 k0 F2 C8 \ else set A_induct to 3
8 k, a: e9 f: G8 n" J' L set A_i to 04 U c! f0 f, X* U5 t
clone 1 load to P_induction( ?: v7 y: X S4 v5 N$ ^8 J
wait for A_time sec
# V5 X. k5 E0 \& F! `+ H6 D6 V3 n6 h end
# D$ ~) V3 r7 B3 r) x: Q% jend
5 d: j: `; q, P+ K6 ^/ a+ c3 c4 b
begin P_induction arriving
# s4 x- `5 Q; v! j! s) ?* |! A6 X if A_induct=1 then clone 1 load to P_pick1! k' b/ t2 ^$ \& t$ `2 M( T" r7 O
else if A_induct=2 then clone 1 load to P_pick2( q/ u% ^5 t i6 @; v! H
else clone 1 load to P_pick3
$ ^2 U* g s" d; Wend9 x, O2 n8 ?1 F$ Z
% r' \, Z0 Y0 G% r! sbegin P_pick1 arriving
' @- H1 k. ]: W* E; h5 u! b* s0 Q set A_i to 1
4 e5 A1 S5 V& D% N. i; u* p2 [ move into Q_induct16 n Y* |* V3 V: m" M+ \
move into pickaisle.induct1! P) U# u3 m# A6 l5 S8 D1 x0 X) |; x
while A_i<=30 do begin
; r# p/ y7 x% |6 J5 j) W travel to pickaisle.con(A_i)
6 w U6 W! ?; c/ ~: O. e- H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! ]$ P: j; g7 B; a else wait for 10 sec
( ?( x# w' M3 E5 M# t if A_i=A_leave then send to die& e7 A" I" |; Q- n% i% U! Y
else inc A_i by 1
1 @. w: u* `6 {1 e6 l4 }, V+ V end. U( y2 r! Q$ Q4 g5 [
end- _4 j7 q+ \% {9 B% R4 [+ L
5 p6 U1 P2 k) x9 }% c8 abegin P_pick2 arriving
+ Q- I* b. P0 T7 T4 P9 v _ set A_i to 112 E! x% q* F. L# |3 H' B
move into Q_induct2
' {) E; k( a" F" z b: e move into pickaisle.induct2, o" b$ |5 F) G# E! K
while A_i<=30 do begin1 t8 f. x9 ?0 h+ q; G
travel to pickaisle.con(A_i)
G" ]7 c ^/ u x& l5 e9 i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 y8 s9 X+ O$ k2 l1 A
else wait for 10 sec
6 ?2 ]) H) k5 F if A_i=A_leave then send to die
( n$ F1 e$ B' x" i; X; N else inc A_i by 1& @& u$ P5 { r; t8 |
end
7 Q7 L7 E. }8 ^" ?end
. Z, X/ N4 |" m( r& p
) U6 A7 K) \9 N1 Ubegin P_pick3 arriving- M& a: ^# c7 {, N8 ^& c0 J `7 t
set A_i to 219 Z. x& I4 u$ a5 ^. ?
move into Q_induct3* s* i b. L# m( z9 k
move into pickaisle.induct37 d% P4 i, A/ Y; {' W( p
while A_i<=30 do begin; R* w: g0 T( i, p: d4 U T# _
travel to pickaisle.con(A_i)5 R( w* D8 y9 J, k6 _0 F* }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, ^0 q" B6 e1 t
else wait for 10 sec7 J! S+ \' C h/ u. W# }2 N' X
if A_i=A_leave then send to die- O% @- S0 S- F% x7 E& ^0 q1 h
else inc A_i by 1
8 s6 k/ B" C1 L" o end
. X. C, G k4 L4 Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|