|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' h' n" A- G W9 h
& W5 p9 n0 O7 N( q我的问题是,在每个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中的数值,不知道会不会有什么不妥。5 s! H! p: R* G: B
7 |" l2 M; I: B0 @3 i* h5 R! A/ L, e
begin P_read arriving) D1 E* Z) p+ ]
while 1=1 do begin* I6 }0 `* P+ O5 X& a' p3 U" `
read A_tote from "data.txt" with delimiter "\n"0 D% c' _4 b: h* U( Z; U# b4 f
read A_time from "data.txt" with delimiter "\n") @: s$ j' v% v% x! D9 H9 k
read A_leave from "data.txt" with delimiter "\n"9 X Z3 u: T) P: a
read A_picks from "data.txt" with delimiter "\n") X, e. D8 N* o5 ~' I8 Y
set load type to A_tote# J/ n! j6 y) s1 D7 ~0 o: e9 u2 m1 C
if A_tote="tote 1" then set A_induct to 1
* ]) h/ |3 `2 I) u2 r8 \8 X8 _ else if A_tote="tote 2" then set A_induct to 2
' H) s& F {# a: o- b+ g; H1 R' E else set A_induct to 3
. z* R- ` h {5 R# a set A_i to 0
& \' i' J% V9 {! C2 R clone 1 load to P_induction
6 _" L) R4 E; Z6 I& C$ W wait for A_time sec, ]4 ]4 m( S% D8 H/ X) [
end
( ]* b& o: d2 O" I0 }4 V% H( c1 P3 iend6 z D, c4 G! d8 k
3 F7 D( j7 F$ a6 _( Lbegin P_induction arriving3 l3 `, A+ Z$ z, v0 m
if A_induct=1 then clone 1 load to P_pick1
# |8 l7 x6 i ~% j* m% q5 D else if A_induct=2 then clone 1 load to P_pick23 s6 y" y2 _8 N3 D0 i0 l3 n
else clone 1 load to P_pick36 x$ [4 T. v3 S3 f3 @. u
end9 h3 O4 P7 q( c; A" @
6 {: R+ K( {9 U: C, B- ?begin P_pick1 arriving8 H5 a* y* r: j" Y
set A_i to 1
# \4 B" l1 z. d' N7 }% N; B4 M8 E move into Q_induct1
" Q, S, V$ H, g( J& J* z+ C$ Y move into pickaisle.induct1
6 l' n* r1 b2 a" ?# d2 ? while A_i<=30 do begin1 j. ?/ { C, o' C% E0 I
travel to pickaisle.con(A_i)
9 f5 J# `2 k) j$ J Z' A7 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 d0 p, D$ q+ Q1 S; d
else wait for 10 sec( E& h* X0 p0 o8 E" Q
if A_i=A_leave then send to die
: q3 J# }0 u& r else inc A_i by 1! p# C' k I x: |% k k
end' c/ Q6 T+ R" c* _4 H1 C1 G
end/ E' k1 }- p$ D0 f2 ~
1 h4 b+ x' E6 Y
begin P_pick2 arriving$ D, l/ Z6 } x' m2 @
set A_i to 115 m& x: f0 q) X' h$ {9 Q* ?
move into Q_induct2
: l; ? N! B( w# k- ^% l move into pickaisle.induct2
# {7 z/ i/ p! g# v* i, U while A_i<=30 do begin
$ ~7 B. L! i0 r% v travel to pickaisle.con(A_i)
6 N# o9 K: i* E7 D0 A% z2 @% j if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 K) [8 q5 D' O {* x- W4 A
else wait for 10 sec, ~" ]" D6 P% t5 ]
if A_i=A_leave then send to die j: F& \% r3 Q7 F5 x% l: u
else inc A_i by 1
! A: m; {# t2 f, V end
- o9 U* t/ d5 K) _5 K2 M" ^end" E+ A( A- B- Y7 o* u
- q: J9 s0 w" X3 i! U
begin P_pick3 arriving
& \0 z$ h7 `: n1 g- n+ r set A_i to 21
! J! a6 S; K1 r7 ?% W' I8 K move into Q_induct3$ w8 ]! N7 {9 j) L
move into pickaisle.induct3
( o+ S1 D/ \+ _) A8 g; O% m while A_i<=30 do begin
7 _* C2 A4 T7 i2 i. K# B# M% G travel to pickaisle.con(A_i)
# V; ]% f+ i6 E) R0 u+ o5 Z7 v- ], d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
g. k0 c+ C: x) A6 s- K6 g2 Z1 I else wait for 10 sec
5 I9 s) S1 O8 H4 t if A_i=A_leave then send to die4 @- H% J& L5 x+ ~- u" v( ?0 h
else inc A_i by 1
' k3 X& f4 h; K+ f3 m end) |+ `8 E, y/ I- l8 l6 t8 o5 w
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,其它按你的 ...
|