|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 v% ]+ g: _5 {) l3 o
/ p+ C0 ^3 ]8 ]我的问题是,在每个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中的数值,不知道会不会有什么不妥。: u2 T1 a0 ` C
6 r A1 P: {; Obegin P_read arriving) f) w) Q# g5 V. [' E# N' X- W
while 1=1 do begin! j+ [! P1 J2 d
read A_tote from "data.txt" with delimiter "\n"5 |8 @9 f$ ]9 g$ T2 F4 T! t. B
read A_time from "data.txt" with delimiter "\n"/ E y o( G/ I& T
read A_leave from "data.txt" with delimiter "\n"
8 i' Q& R) M) }- d9 B read A_picks from "data.txt" with delimiter "\n"
5 y+ ?0 S* B9 w; S) u+ u0 |9 G set load type to A_tote% n( D" H3 a; C/ N/ y6 U# X+ Y
if A_tote="tote 1" then set A_induct to 1
8 A$ X2 n% ?1 `0 a [! S else if A_tote="tote 2" then set A_induct to 2' E; L# H2 F8 w. T+ e
else set A_induct to 3 + r& L1 i0 `8 O! n
set A_i to 0
( d% }( \5 O2 N* Z! I clone 1 load to P_induction
% p8 L8 v* m8 o+ K wait for A_time sec; i, V) F# E2 ]: C8 I
end
5 X a6 S8 u- W3 l9 {# q4 C$ Kend
+ T5 C1 R- w. v) i5 w' {: Z
7 @7 w# D; l( @begin P_induction arriving
5 ]: ?4 D( y/ w. J+ W& D4 r# x. f2 s if A_induct=1 then clone 1 load to P_pick17 o& {6 u' W X" ~
else if A_induct=2 then clone 1 load to P_pick2& `: P+ k, j5 Z/ x
else clone 1 load to P_pick3
2 P7 K8 ?9 \6 H* s# n9 Qend
; H$ Z( ~* B! v, P$ _. ~
3 s; _, o d8 p, {begin P_pick1 arriving* Z; r0 u$ O! f3 J
set A_i to 16 F- @ I) o; C- U' N1 ^
move into Q_induct1- `5 U1 K# v3 t1 ?0 T# G: y& O6 v3 ^
move into pickaisle.induct1. C6 ]8 t' n& ]% f: c9 Y9 |
while A_i<=30 do begin
/ O2 n" {/ m9 ^% U: E travel to pickaisle.con(A_i)
' y! `6 g( S1 |4 y D3 l: Y if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 `+ N4 S& ]4 a- a+ t5 M
else wait for 10 sec4 g& c9 n! R' X& |
if A_i=A_leave then send to die. [8 s9 S/ q2 t' i0 t1 W6 m y
else inc A_i by 1
* x) \1 v- ^* V9 [4 ] end }0 H; f4 [& C. V
end& }3 i# R; m) x4 x) d8 E, j
0 E# C: ]/ L1 I7 Y7 b$ O
begin P_pick2 arriving, x* _* c; i. h* \
set A_i to 11% ?& v, S( Z" u; U& Y
move into Q_induct2" O% s0 v! b6 ]
move into pickaisle.induct2
3 y7 G8 F4 z: ] while A_i<=30 do begin) B$ W/ K0 F6 C
travel to pickaisle.con(A_i)
H; n) C `7 y% j0 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% {+ k4 T/ E; t0 S
else wait for 10 sec3 q" W: {/ b: X& r; \
if A_i=A_leave then send to die
( p/ k" r0 R$ N else inc A_i by 1
2 l9 J: F& ^2 ^# e4 D6 u; G end
# o. ~# v o% wend8 V2 P' d* c4 l6 k0 u
8 u* s% m% O u4 \8 z' q5 m6 ~3 |begin P_pick3 arriving
9 l* H+ q. F; D" P1 A- k set A_i to 21
" @# D- C; {% q$ Q. l( f, R' K! P move into Q_induct3
( H& e. l! G1 j$ z( ] move into pickaisle.induct38 v% _7 ?! i. h0 v2 Y; z8 q
while A_i<=30 do begin# h. N: ?$ N7 z* i" P; Z2 g/ F5 i, @
travel to pickaisle.con(A_i), U+ s0 ], y8 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ l% A8 H$ Y; m' V) W( B( D, i else wait for 10 sec
2 R5 b4 x# B. s; l if A_i=A_leave then send to die4 C7 e+ v& w; ]3 d' x
else inc A_i by 1
7 X+ \# J" R. Y y end
/ S$ I4 D% v& u; x8 [1 Y* L# [% Pend |
最佳答案
查看完整内容
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,其它按你的 ...
|