|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* C# `' U$ m. f, E0 E! U/ c2 I) Z M9 K1 E% w7 t/ N* D! |8 Q* D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
6 w6 D& \! T( m4 H: b4 Q3 m! w% w" G! B2 v
begin P_read arriving" I+ V7 e K/ Q% x; n# {: W
while 1=1 do begin6 G$ a* ~/ o- v0 A# x) \
read A_tote from "data.txt" with delimiter "\n"
2 t5 R( \3 K" `" W read A_time from "data.txt" with delimiter "\n"5 F: u3 b8 f% j) s& ]( d
read A_leave from "data.txt" with delimiter "\n"7 w( A. ^" D# l' a" M6 C) \8 p
read A_picks from "data.txt" with delimiter "\n"
6 R R, O/ C* t0 v% b9 o, }, F% Z/ u set load type to A_tote5 k7 B$ n" O/ D! t# g
if A_tote="tote 1" then set A_induct to 1
2 { C. F$ M0 P* b+ V0 ~ else if A_tote="tote 2" then set A_induct to 2
3 j% {- k' T; M' A: r5 ^% I else set A_induct to 3 . q) d V- Z [9 W' k, O7 r
set A_i to 0; Y" |0 u' t1 L0 U2 S# p: L
clone 1 load to P_induction( i9 ^/ c1 G# g3 Y
wait for A_time sec& u7 u r- E. x: ~% C4 f
end$ J) z" J7 G% x5 }: o; i3 c9 v
end
* o% U1 k4 l3 ]/ W9 E6 [, n8 a! {4 ~& U) `; t" q9 L0 u
begin P_induction arriving# y. Q+ X* c- G3 t
if A_induct=1 then clone 1 load to P_pick1- p' y( V9 u- g- G* K
else if A_induct=2 then clone 1 load to P_pick2, P# {" n8 I+ W
else clone 1 load to P_pick3% y) m/ ]4 l* u7 k1 [( V( a
end
& \/ [0 f2 u1 X3 M
. D$ H. `8 X, B. ?( I% Zbegin P_pick1 arriving; t3 w" P) }. z
set A_i to 1% s$ S3 d8 x9 U2 b$ n
move into Q_induct1
. h# g. B1 k" P$ l5 u1 ^" Z% _ move into pickaisle.induct1
" D* @! ^0 r" F- \1 b8 S while A_i<=30 do begin
# x- A7 E1 ~, u) V travel to pickaisle.con(A_i)8 R+ v1 o H4 t/ \3 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 X$ q3 U, e" l) k, P% y2 P+ S* |% K
else wait for 10 sec
' {' e" n9 x7 U9 F if A_i=A_leave then send to die
. J: x" z: p7 Y* r* l& y) D else inc A_i by 1
1 O: {3 b. L2 g, N! H0 m+ v3 U end
' o! w }- N9 j" l4 xend5 r0 `7 i5 ~. b2 j: l: V; F. A3 _
0 d4 c8 Q% m# B9 ?
begin P_pick2 arriving
& N8 W, g4 \" ~5 J5 t set A_i to 11& ~" X, y6 t/ J, ~
move into Q_induct2
; T' e) S0 \5 @9 C9 {% M; t move into pickaisle.induct2* i. E2 l7 j. A
while A_i<=30 do begin
) h9 F/ p% s: K4 F1 H travel to pickaisle.con(A_i)
( j3 i2 S2 E- t+ `% ~8 d1 L2 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ C1 u+ R; u. b: b7 x- e
else wait for 10 sec
: M4 H% l* ^/ R0 d% n- q. G' E if A_i=A_leave then send to die
- s, |" [3 ~4 P3 x; i else inc A_i by 1" _. [# F3 s, s, J) k. d
end; r$ L4 Y! t5 W: p/ }
end6 o, `$ c' q+ q9 r
* P! @1 ~3 U0 R) P
begin P_pick3 arriving0 t+ F# S5 O ~$ Y! \1 {
set A_i to 21% g, F7 I5 e2 ?* S* e
move into Q_induct3
2 {8 p [- g. D9 U+ p move into pickaisle.induct3
( S# e& L- t4 t" r! x& [ while A_i<=30 do begin
$ J& T* f8 k3 q, y& `& ~* ^ travel to pickaisle.con(A_i)
2 ]* s& M& b8 @" i- ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! t5 o, g% s6 L9 X- X& [
else wait for 10 sec C: @1 q3 B6 ?; D7 i1 o# s0 t
if A_i=A_leave then send to die% _$ \, p: \& d/ L+ o
else inc A_i by 1; L0 f- \: ]9 B( K% T3 i
end
9 m0 B/ h. K9 _7 U6 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,其它按你的 ...
|