|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. D( u3 i7 V% ~! q
4 c, g: E/ J$ \" v: v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) T$ ?% T. @+ t. b" j
3 \ ~8 @9 L+ w/ B) u3 k4 x Bbegin P_read arriving
% p, O: n% k, W) a1 x, M+ a+ K. C while 1=1 do begin/ A* u+ H( T9 [' E9 g
read A_tote from "data.txt" with delimiter "\n"& n0 ~/ j4 B: O3 b! W9 }' Y2 k: C2 R
read A_time from "data.txt" with delimiter "\n"
9 [" C7 ?: d+ f7 ~, P ~; e$ X read A_leave from "data.txt" with delimiter "\n"7 f X: V7 i* o* B7 Y6 V
read A_picks from "data.txt" with delimiter "\n"9 O Z7 K, f3 h8 U* \/ \
set load type to A_tote
2 { C5 O- d( s, J6 F if A_tote="tote 1" then set A_induct to 1
) k) H( c: l7 t else if A_tote="tote 2" then set A_induct to 2
% A+ g9 T w) u k7 \# v else set A_induct to 3
6 E0 `, e8 j/ v3 R set A_i to 0 g) Z! }) D4 y, G! X
clone 1 load to P_induction
* V; N. t- B$ [+ B2 }0 Y wait for A_time sec% }2 ?6 y) R) }& B6 C
end0 |- Z4 K$ A8 j; y8 u. G
end0 R/ \1 K2 L k& D9 q: ]% ?
c |3 a6 d5 z8 k
begin P_induction arriving
' K1 ^6 D" ^6 N' a if A_induct=1 then clone 1 load to P_pick1
% w* B) X5 ^& r3 Z& l' `3 e else if A_induct=2 then clone 1 load to P_pick2# [" U4 y3 J9 C5 W& B! v
else clone 1 load to P_pick3
5 N9 X' O! S8 y" ^* U" eend$ d# ], V) x! I3 f4 N
2 K( p; p; ?2 N3 X
begin P_pick1 arriving# {6 w2 z5 K' B# t X: q
set A_i to 1" K% R; b' I) K
move into Q_induct1, @) |5 q: e) @5 A2 t: E, A d
move into pickaisle.induct14 d' O1 h& ~/ Z; O0 L- b; J
while A_i<=30 do begin
: d3 _% \6 R' `8 M0 G4 ? r travel to pickaisle.con(A_i)9 |3 m) Z% C8 w- @. b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 M; S% Q- S/ ~ else wait for 10 sec3 _1 d* `7 G* V, Q% Y# r
if A_i=A_leave then send to die' w# r+ z# i! N
else inc A_i by 1
6 N: l6 K; d" M7 a7 o end' S6 f- A6 t) ^
end
5 h3 c9 F* B3 N! P
% \9 U# f3 ?$ k* q# s! Hbegin P_pick2 arriving9 ?+ I* ?8 }! d! N$ L
set A_i to 11
; e, Y- c+ H6 d+ f move into Q_induct2
E8 ]; P# V! E0 w move into pickaisle.induct2" J8 |* i$ C( [- B
while A_i<=30 do begin
7 L6 \: P y7 m& N5 o" Y travel to pickaisle.con(A_i)
4 p, H5 e9 N( o! E' P/ L* q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ ]$ z/ a( Z' J* X+ T else wait for 10 sec" g) U: B; m0 c% F
if A_i=A_leave then send to die
) k& A( A2 O6 g: N else inc A_i by 1
: }, m. L8 j6 M" L( r9 [0 { end3 y) b+ d# f: N* b3 j
end F, o+ K0 r K2 ^0 g, E0 d
/ ]8 ?8 ^) b5 O4 O3 q& W
begin P_pick3 arriving4 [* c& k5 v) Z# z4 [' J8 p
set A_i to 215 h7 y0 D& M+ E2 C
move into Q_induct3
- a" d3 d g& H move into pickaisle.induct3
, ?' |: M j9 i+ P9 z while A_i<=30 do begin, p2 N) X- q- T/ ]
travel to pickaisle.con(A_i)
# b: A) k! ?, d* Z% t0 Z if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 N, ~" e1 D3 I R else wait for 10 sec- S8 K5 A L$ ?3 p8 h# @
if A_i=A_leave then send to die
7 o/ H7 J1 l% g( Y' o7 S else inc A_i by 1
; \1 R5 R) B- u7 ~ end
" }$ I9 G: g% p% }: F, Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|