|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. h$ w! E9 K; m l, E4 O0 e8 \
* L1 g) h9 O) l$ o6 D% 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中的数值,不知道会不会有什么不妥。
$ L/ G& j; C& T! L M; s% `* M9 {
1 S6 Y4 x, D, jbegin P_read arriving
6 }! y' z X0 C7 e. Z1 `6 v/ h while 1=1 do begin
0 V6 I, n L2 _5 `) ]# N0 K read A_tote from "data.txt" with delimiter "\n"
6 d7 r. }! j0 m( {& ?$ b6 A s. R read A_time from "data.txt" with delimiter "\n"
. g8 y6 h* }9 o/ ]) l! d7 a) f* X read A_leave from "data.txt" with delimiter "\n"
* b, c6 d3 F. c" n% C; T7 k read A_picks from "data.txt" with delimiter "\n"
8 z U: l3 o' E1 b$ y- ^9 M3 b set load type to A_tote, I) d5 d! j* x
if A_tote="tote 1" then set A_induct to 1( I* {* ]+ f* H$ t+ y7 s
else if A_tote="tote 2" then set A_induct to 2
1 G, P% z- w2 C/ h$ q, l! ] else set A_induct to 3 ) c8 K0 O+ C! @8 K; Z
set A_i to 02 U. |/ }. V5 {: b6 W; d
clone 1 load to P_induction
3 W# T4 N, c/ ~3 e( x. t5 ?6 p1 s wait for A_time sec! e' r% y' k- X7 u, [# O
end5 b3 T# W% _; Z
end: K, f' L" i' d% X
" N0 v9 k- x* A. |8 r {
begin P_induction arriving9 A: Q6 P" X4 X/ N! ~
if A_induct=1 then clone 1 load to P_pick1
6 V0 X5 e# y- T& c. k/ V else if A_induct=2 then clone 1 load to P_pick2" J2 {) C! s7 ]! X/ A: s$ }
else clone 1 load to P_pick3) \# C0 ^9 @9 |: _# p# c7 U
end
! F5 l% ~6 \. D" x3 r: L
4 Y P' i" S+ F6 c8 b$ l+ j2 xbegin P_pick1 arriving
7 p- v: U# @) h- D set A_i to 1$ j) z/ h8 v6 T# W) \& f
move into Q_induct1
, g" {+ Y1 O; G move into pickaisle.induct1
; ?( M% n& Y( f9 e3 X1 Q( M$ y$ A while A_i<=30 do begin7 G% G4 l9 r; M4 g+ ?
travel to pickaisle.con(A_i)
7 {8 m8 e7 v9 ?0 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 g' b q! M! J$ x" I
else wait for 10 sec
& P& O; ]+ g! K" Y if A_i=A_leave then send to die
$ G. Z( f0 b) A# W& U; B( Q9 ~ else inc A_i by 1
6 z: `' w3 a' }* j end9 g* D; f( k/ ^8 \
end# Y+ t1 o+ Q% `1 R
2 d/ u+ `/ O* `5 B' [. ?. D, Q
begin P_pick2 arriving
& O5 P7 \3 N- F. {( }0 W5 S set A_i to 111 K) d# X: }" ~2 O1 H
move into Q_induct2
. C$ H: L% ?& m move into pickaisle.induct2) m4 o% ]8 O9 u9 ~! c+ \+ I
while A_i<=30 do begin0 S% i" p5 N5 {
travel to pickaisle.con(A_i)3 F# d7 Z; o p C9 C1 Q1 G* _4 ]0 e- a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 v* e# P7 a0 D9 M' m
else wait for 10 sec
3 H- r- K6 x& M- C' f if A_i=A_leave then send to die
1 C5 s* Q( V# Z else inc A_i by 1
4 { b `; c5 j+ Z1 O3 R* Y6 g5 z# { end
. d2 a' A2 d" H; X1 ^" \end
" M8 K5 T P2 ?9 O- p2 y8 M" W/ h' p- t
begin P_pick3 arriving
2 T+ n7 ]8 r1 q" l6 m" U set A_i to 21: g" o O2 M6 i
move into Q_induct3
6 A0 l% {& ~! m, j, V4 C7 }/ i* ` move into pickaisle.induct37 r: s5 T7 J3 @0 W8 ^
while A_i<=30 do begin! F. N# w! v ?: N+ g: b! j
travel to pickaisle.con(A_i)+ H, f8 k6 ]" j9 Y E/ g, x2 h9 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& s% ^) ~. U& s& F/ j else wait for 10 sec: [! l6 ], k1 u
if A_i=A_leave then send to die
) v( l1 G+ U" ]9 [) ~3 u else inc A_i by 1
7 C: o0 [: S1 T# I7 v9 D; g end
7 I2 w! U4 @4 `7 i: g. c, D% q* Q+ `% }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,其它按你的 ...
|