|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢6 g) D$ O' O& D2 S! O
1 q7 z) {7 H, j: W
我的问题是,在每个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中的数值,不知道会不会有什么不妥。- B" _/ S5 V0 L
0 z3 {2 S# q" v5 V' ^
begin P_read arriving
$ G. s7 C5 g, ?. G+ G* W while 1=1 do begin7 h1 c4 v1 @% M3 U+ y: c' z
read A_tote from "data.txt" with delimiter "\n", V6 ]& \) x2 l$ [) n# R$ Q- w
read A_time from "data.txt" with delimiter "\n"/ F7 R5 y. l) c2 q* E! n) W E# {
read A_leave from "data.txt" with delimiter "\n"
0 i2 ]8 N3 {% ^) H- W* `( i read A_picks from "data.txt" with delimiter "\n"/ u9 v' \+ P5 L3 B* n4 F
set load type to A_tote
r7 _2 E! j9 j' O if A_tote="tote 1" then set A_induct to 15 m9 V( Z5 I, u7 C/ a
else if A_tote="tote 2" then set A_induct to 2) o+ Y- t7 H# ?. M
else set A_induct to 3
( }4 Q) @6 V- @& {( q, B set A_i to 0
; W* x; z+ P( [ clone 1 load to P_induction
# G; f7 e( E6 }5 h wait for A_time sec
& Z7 [% x$ Z, G8 ?' ~: D end
' ?% y* h B' m7 H- h% y rend
( N0 S+ A" X" O6 F, k
% X) @% n9 O, h/ \! G& f. S* M* Ibegin P_induction arriving, K- s6 N# @ x* b: g* u
if A_induct=1 then clone 1 load to P_pick1
: N4 u, W. ` `- b- x0 A else if A_induct=2 then clone 1 load to P_pick2
7 B1 B# m2 h! l/ ?. s; { else clone 1 load to P_pick3* N* N- V) O0 d! e
end3 S( p6 I" n, B: n+ N
6 l+ K7 x) ~$ i1 ~begin P_pick1 arriving
" ~: H, M5 Y+ ^ set A_i to 1
5 q s6 p$ b' } C- y move into Q_induct1
) o# O- m* ^. Y& w+ ^; ~, m move into pickaisle.induct10 r. R. V5 Q6 f6 D
while A_i<=30 do begin
- n) T0 i7 P( ` } travel to pickaisle.con(A_i)% o) x. Y4 a2 Y5 \6 v K' v% b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ s* D. ]+ a1 w; A B
else wait for 10 sec
, r. r$ Z$ H6 V if A_i=A_leave then send to die
3 `. F8 z: o3 s' Y else inc A_i by 1/ q' l3 P( E" t. J I {
end
2 N a- A) m8 X; k/ o; ], o+ Dend0 p, \ A q1 m
& D& t; C x$ p: ?; d2 x
begin P_pick2 arriving
$ ~; |" i6 r5 [% W" U# m* [ set A_i to 11
- Y( ~/ q5 G6 ]# W7 ~$ a move into Q_induct2
9 ~% n& y$ O6 v0 b; W4 A move into pickaisle.induct2
; o w5 q- E8 K# w4 X6 N; O while A_i<=30 do begin- ^% v4 V5 Q0 W+ o2 m% N% M
travel to pickaisle.con(A_i)
0 K. z, H; p# r/ u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 P. e! B) o( f+ X5 y else wait for 10 sec
2 z: j* F N; z: I if A_i=A_leave then send to die
4 _% c; N1 s' F Q else inc A_i by 1' N% n( j) v) A8 Z/ L2 m$ [
end1 K$ R: f7 J5 @9 Q* i
end; B2 V9 f2 N0 O
, c1 G* N- f: q6 _: k j; Jbegin P_pick3 arriving: \, i& r3 a, C, k7 s
set A_i to 21
3 f" J O+ Y" a2 e) D move into Q_induct3
. \+ z. ]. y' y+ d. S' a, c) w move into pickaisle.induct3
$ |! w1 S8 g2 x" T( T2 x while A_i<=30 do begin5 \3 }/ _" f7 d% P7 N) }" L
travel to pickaisle.con(A_i)
3 w8 r" h. y( ^; T$ C, k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. ~4 a( @3 _( Z& n3 H- Q4 F$ }" c else wait for 10 sec
0 S$ _, c- T J6 |1 s. n+ | if A_i=A_leave then send to die
j$ f( d2 ~# ^ else inc A_i by 10 ?# | n( _- s+ P0 n3 Y) @% c
end) e) ]. R# D C8 u* f8 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,其它按你的 ...
|