|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 `: F0 S# P0 ]. v
& g3 ]) h" |) m" Q- 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中的数值,不知道会不会有什么不妥。
# J; ?$ [8 X- K
J' _8 `4 i& W2 G; t' M, N0 vbegin P_read arriving" F9 `$ V4 S8 q7 f7 e* _8 h
while 1=1 do begin1 e, _' S8 H& X8 X
read A_tote from "data.txt" with delimiter "\n"
2 K) ?4 ~% _ w; M: p( }, ~+ u read A_time from "data.txt" with delimiter "\n") }9 L- `0 Y& n ~* W, N* }& _# c
read A_leave from "data.txt" with delimiter "\n"
! R2 ?$ E* f3 Z* K2 y( L read A_picks from "data.txt" with delimiter "\n" W4 _: k3 W; ]' P
set load type to A_tote
5 I$ q' I) m1 q2 e! t1 p. A if A_tote="tote 1" then set A_induct to 1
n5 Y- Z. |2 _0 C7 l- u else if A_tote="tote 2" then set A_induct to 2* l$ t$ Q1 @: Z3 E# N9 R
else set A_induct to 3
. Q; u1 Y! F3 B v. D5 b3 ~ set A_i to 0: ?" K0 G9 [4 Q& u
clone 1 load to P_induction9 i" E% m& ~" W D* H+ f5 j: v
wait for A_time sec
- p7 z# I C: g) D2 t$ j% B, a end& Q' H I+ P& H
end$ |$ _" T6 s% n2 |5 l3 Q- b8 B+ f: t
* |3 G5 F! f3 Q1 p* a/ n
begin P_induction arriving$ m4 k9 G3 R" R9 \
if A_induct=1 then clone 1 load to P_pick1
+ M: x! A3 |, v% ^ else if A_induct=2 then clone 1 load to P_pick2" a4 F4 ]1 U3 [5 F
else clone 1 load to P_pick3
$ K# _" V# V4 ]end1 D& S7 G; w4 W+ ?
1 K) X1 ~& e2 E% d. \! h8 s5 r! Hbegin P_pick1 arriving, W+ B+ a* N; h& ]6 P! x
set A_i to 1
+ U/ S5 q- r" [ move into Q_induct1% u6 |# I, h0 r) c+ k) G! P/ N' H
move into pickaisle.induct1
& v6 B+ B+ x' j5 ^* X5 g0 t& l: M6 V while A_i<=30 do begin& {' U0 s0 f/ x* o7 z
travel to pickaisle.con(A_i)
/ q, p% S+ L h. u( f; R- b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E" v; J% t- g+ U9 r& F
else wait for 10 sec
' |; Z( c" M$ }1 y if A_i=A_leave then send to die
7 m* M- S0 u* L else inc A_i by 14 |( i* C1 v: H0 }: B! q& ^
end
3 Z4 c& U& }& U2 K( U, rend
' Z5 d( _" J0 e+ n) W0 x
# S: q" T$ ~/ B! sbegin P_pick2 arriving, T4 B1 m$ d9 x# I* [6 F! r
set A_i to 11
6 _9 d5 j- X4 L+ ]* Y2 S- t7 z move into Q_induct25 l4 c9 J8 n, A6 _
move into pickaisle.induct2
+ Q0 D- k9 z8 j( i% L while A_i<=30 do begin
& k. {: O h0 P/ i% O% V travel to pickaisle.con(A_i)
/ ? r$ g2 S$ D5 U3 h if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 `9 j: a7 M5 T2 B. Z( Z
else wait for 10 sec; I f) ~) U. |- X4 p3 @- B- P; o
if A_i=A_leave then send to die3 v x4 q' U$ T
else inc A_i by 1
( l/ k' e% F+ ? end( \+ E) Q9 A% q3 R2 r7 t9 P7 I
end
5 k; b) i0 |+ s/ B! @9 a- f% f
4 A. j) Z! N, Dbegin P_pick3 arriving
. }* ?4 G; j' j S2 y/ K% p+ t set A_i to 21+ F/ N6 `/ Z8 [& w; G
move into Q_induct3
- I' \/ [ _ z: S5 r" _ move into pickaisle.induct3
6 }$ j( E" H2 L" ^ while A_i<=30 do begin. E7 m# V) _6 F( D- Y
travel to pickaisle.con(A_i)
0 K" \ C, g" \# U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 E j) Q. I) u% I else wait for 10 sec
3 ~3 _, D, O: T. a( t" e+ ^ if A_i=A_leave then send to die9 V- F, R6 O% X; \( ]
else inc A_i by 1) g3 H" g; Y5 m
end
0 O+ ]* [4 c( h" F1 uend |
最佳答案
查看完整内容
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,其它按你的 ...
|