|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢3 D; d: a/ z3 a4 a
; E% ?5 o0 E/ m" j% j* `4 W8 M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 F) t+ j8 H; m3 `& i6 a1 e/ _
1 P' m u: b0 \
begin P_read arriving9 |/ Q0 e z, ]6 Q4 i
while 1=1 do begin$ ]) j. i# Q! b# N
read A_tote from "data.txt" with delimiter "\n"
$ X* d" Y) }4 v read A_time from "data.txt" with delimiter "\n") s) t' O7 \8 M/ _8 f
read A_leave from "data.txt" with delimiter "\n"
% h0 v7 z! X& h read A_picks from "data.txt" with delimiter "\n"1 R& y/ L9 B- `. P" J3 U7 K) d" r
set load type to A_tote
# V' {8 f5 B3 w0 ?0 V0 ] if A_tote="tote 1" then set A_induct to 13 p! V) ]; Q( v! l
else if A_tote="tote 2" then set A_induct to 2
( p3 x* \+ i4 W# T- [$ q8 K else set A_induct to 3 $ a6 H: u: Z$ q" r$ h5 \! ]$ T
set A_i to 0
5 r" q$ {: ~8 M2 Q1 f2 ~ clone 1 load to P_induction
# a5 ?2 X. M7 y$ x+ ^ wait for A_time sec( y% C) d& r& S
end! e: N1 S) y3 l; T! i k( J
end
. t1 T; k- `4 |8 }* [- Z: u# W) k# A/ K) a* \0 y
begin P_induction arriving) o4 |6 I4 `( @* s. ^
if A_induct=1 then clone 1 load to P_pick1
# e3 u2 I5 c1 Q# C- d% D% E/ Y/ m else if A_induct=2 then clone 1 load to P_pick2
@* D9 y) Y8 _( P8 `3 e else clone 1 load to P_pick3; S* B- s* Z4 b9 I; F( i6 x
end- p6 g8 f# R2 O4 u" }6 w) }* _/ ~
% v8 d) q! k4 L7 [3 j6 mbegin P_pick1 arriving/ X! I- j! B$ K5 W( x# P( I
set A_i to 1
% I9 W- H, P+ T move into Q_induct1$ m# @2 @" H T; x6 g
move into pickaisle.induct1, | A9 Y7 \8 ~9 B/ l) d/ O
while A_i<=30 do begin
% i) a! L8 M% l* \: o/ n+ v0 s travel to pickaisle.con(A_i)3 f( h2 ~) T$ V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( U. `2 z0 ]0 L. N! M
else wait for 10 sec5 I9 `# r! f6 h$ H5 s: m# X: ^! B
if A_i=A_leave then send to die
. r8 R0 p3 m5 q& w else inc A_i by 1
1 `" I7 `% N& D4 z0 w( [ end
# l- B: w( J [/ u: nend `. u& g! B/ ~ C! n8 x( ]: y6 C
5 o0 a, G3 K6 Zbegin P_pick2 arriving
4 g4 Q; |! F, K- M7 I- S( \ set A_i to 11
+ a. `) ^( f- c move into Q_induct2
, x$ {' n: n* x) m8 x" B/ n move into pickaisle.induct2( c9 h7 R' W% |3 c" X4 X! {
while A_i<=30 do begin; H& o- ]! `, ]/ w1 L
travel to pickaisle.con(A_i)
* Y% `$ L2 R% g, b, ~8 W# V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' k5 t$ h2 s8 R, o' ~
else wait for 10 sec
8 S& z2 ~; l. Z* W5 {' C if A_i=A_leave then send to die
9 Q1 q5 b' ?$ j else inc A_i by 1" E2 m2 M" z9 j* @' s
end
9 ]3 q& @. q8 U7 K' N/ \4 i" g% ~* Pend- |5 c2 x' T) ~* T" e& u) ]/ x
- |: p! ~! j. |+ H
begin P_pick3 arriving
& x% R- D, o- b- L" u set A_i to 21$ _4 }4 i+ ?) s1 Q+ e* h
move into Q_induct3
3 S! } A. P6 {, b8 C4 q" d7 ^ move into pickaisle.induct3" S0 g. k, [' a; U* i# j9 v1 [
while A_i<=30 do begin
; E: V5 [: }/ X5 ]4 ?, E% Q travel to pickaisle.con(A_i) h O. a& F4 q) v* W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 H, |- h0 N+ H5 F$ M else wait for 10 sec
( W; M0 M# R, m$ f! j if A_i=A_leave then send to die
' T' p! ?7 U4 ~! N else inc A_i by 1' ]/ {, v+ c( ]0 Q' \3 J
end
6 S7 u- v3 `4 u# M/ Oend |
最佳答案
查看完整内容
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,其它按你的 ...
|