|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) N; E/ _1 b( Q! ^9 N, K
* C4 s$ l/ a) {8 {2 O% U# k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
9 I0 j5 s. ?) r; ]! Y; c, l* S" g& X ]( F
begin P_read arriving
' H0 h6 j1 c! o0 |/ w7 X while 1=1 do begin$ w# p% M, c# d; m' i
read A_tote from "data.txt" with delimiter "\n", ^) V4 r& ]: P ^+ t5 ?
read A_time from "data.txt" with delimiter "\n"- H2 D, w1 } {! K( f9 M; S
read A_leave from "data.txt" with delimiter "\n"
! X+ s* \/ m q: N' k7 U- ` read A_picks from "data.txt" with delimiter "\n"& Z6 b! a4 a+ ]- Y& h, V0 b) d
set load type to A_tote
& T9 m' r* I# I* @ if A_tote="tote 1" then set A_induct to 1$ U( Y7 l- [ u# P
else if A_tote="tote 2" then set A_induct to 2( j; n$ w" R C$ A2 N5 _
else set A_induct to 3 0 e/ @( K+ s5 A! r+ s: Q
set A_i to 0
) \) X. y8 x% B- Y1 L clone 1 load to P_induction
- m3 N, G% W8 A- T* e- { wait for A_time sec( X' H" R1 W' o& r3 w6 }
end7 _& }4 c, I/ C/ k% Y
end. u1 W+ u; P2 u# I$ m/ H
! E( ~7 @. ]6 m+ k9 K1 l6 Tbegin P_induction arriving
# Y4 _. ~* G8 T) q0 V( b if A_induct=1 then clone 1 load to P_pick19 g* Y) C; s% s& e7 `' q
else if A_induct=2 then clone 1 load to P_pick25 F+ \2 h _1 U* ]
else clone 1 load to P_pick3
6 |) K S/ _7 D5 ]end6 ?4 I& D) J# U! f* i- Q
" w' O* ^; `. H* U7 }- ^begin P_pick1 arriving% G! w" I ^8 X! `/ {
set A_i to 13 M) [+ Q6 b, X+ z
move into Q_induct1
3 ]& r! t8 l& n; T2 Z/ g) R move into pickaisle.induct10 f: o8 I3 [) Y% A- w8 I
while A_i<=30 do begin1 V3 [/ I; ^2 G
travel to pickaisle.con(A_i)
/ e3 ] }( P s/ M* J5 Z0 _- k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
~; D3 w+ L3 d& B else wait for 10 sec6 r7 ^3 G$ [8 f6 Y8 b# x; m
if A_i=A_leave then send to die
/ n- g6 ~7 h+ W( K; c1 y, \3 a else inc A_i by 1
3 S& [0 B: E6 ]% Y; H* }7 | end
: `" l7 A! {; a: ]7 a( rend
: ?& k: p+ ^9 y. P" E) N, ]" N1 z' j8 c& p9 V" f" | L7 s
begin P_pick2 arriving
3 B0 p( D) n( m/ n) M( ^6 j0 y set A_i to 11
1 h% r* X- l* E( y6 Y move into Q_induct2# G0 w2 Z# ]" X, c
move into pickaisle.induct2
4 a5 k: p v0 i* H4 Y/ W+ L) J4 H& ^ while A_i<=30 do begin' l4 x+ V' z# ]' t8 d
travel to pickaisle.con(A_i)
! R3 u& r, T4 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q9 l' {. L! T, _8 t( L else wait for 10 sec
1 F, F$ X9 J/ f5 a) D if A_i=A_leave then send to die+ _$ x6 A! C h7 Z* e( q, C
else inc A_i by 10 u3 M% {5 z/ A% l& s; U
end; }+ h' o. e. u6 ~3 e
end3 T( I- _" N2 }6 w
A& s& D: M% L. v
begin P_pick3 arriving
. f( X/ g. v- k set A_i to 21
5 ~/ Z9 S" S# t% C) r move into Q_induct39 j) D- `3 }6 j& ~
move into pickaisle.induct3
+ q: c2 }8 d0 Z& @+ d while A_i<=30 do begin
9 T% T: A+ J; N9 S8 B. W6 T travel to pickaisle.con(A_i)* t1 k) r: A7 x* x; C* D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' l: {$ i+ `; E1 R7 i/ T else wait for 10 sec
2 T( F/ ]& I p! U4 h ~ if A_i=A_leave then send to die
3 f8 [4 x6 z! ~3 y6 x# v- p: T else inc A_i by 1
% }! R) l; d* ?7 s5 D end M/ p( C- s; @ }5 X
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,其它按你的 ...
|