|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢, Y5 P; t V7 K! F4 V4 U y
; n* K$ {+ g0 X' n0 L+ \
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 V) @; ^/ C9 y! w. q7 [, w
t& J, _0 n# O" D* Fbegin P_read arriving: w# f" q( y/ D% \
while 1=1 do begin6 U5 [4 m; P0 N; ^5 D3 F
read A_tote from "data.txt" with delimiter "\n"7 f' ^' G! @# e' e0 [) e+ m
read A_time from "data.txt" with delimiter "\n"
, j- g @) G* N6 [. s read A_leave from "data.txt" with delimiter "\n"
, S! y( \' d2 ` u7 n1 U+ j/ [# ?: k; v read A_picks from "data.txt" with delimiter "\n"( h, c* Q$ ]& z) ~
set load type to A_tote
/ k! L2 J. m. S4 |; S' N if A_tote="tote 1" then set A_induct to 1
: o) T% q; v; {% g s, Q else if A_tote="tote 2" then set A_induct to 2
5 h5 _7 v* N3 ~; C% x9 ~" ~ else set A_induct to 3
5 B% {& S% k# k1 ^ set A_i to 0' p# O9 p( J2 b4 s' H
clone 1 load to P_induction
( K: f9 M: p- D: ^9 ~$ v wait for A_time sec
, `4 v! H. C9 Z: e& @ s end; B0 ?: K6 {* v1 Y
end
9 j* y8 t5 Z/ D9 f% a, P7 T" G: z. a* {3 Z4 R" o
begin P_induction arriving+ m* }" |, q2 u/ M' m T
if A_induct=1 then clone 1 load to P_pick1( k& ]2 d( A9 P0 y. t; z/ |* {
else if A_induct=2 then clone 1 load to P_pick2: b' ~7 \: N% w9 Z( k
else clone 1 load to P_pick3+ T6 e" Y2 Z- W U# Z
end; m5 z) e4 c; t7 R7 k+ X
0 \# c+ S7 H/ W- V% @9 s! ^8 ebegin P_pick1 arriving
1 }# j# M6 H# `% @( {7 U set A_i to 1
- `6 s/ Q# u9 J$ V# B move into Q_induct1
& G7 ]5 L. X8 z move into pickaisle.induct1( {; u0 H9 `$ D9 n! G& s
while A_i<=30 do begin
9 U, F4 u% M( a( S# r* ^. p travel to pickaisle.con(A_i)
# L$ A4 q. X7 s0 S6 p. ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) p' y6 p. }2 C: ~6 _; f
else wait for 10 sec
! m/ h4 ~' \. c8 b' m0 {& C( L if A_i=A_leave then send to die% U0 I; Q5 k. V! \8 a" H3 d
else inc A_i by 1
: O( b/ s& G4 w5 j9 u( T end
" w; D, p0 t$ @end: _) r- W( q8 k5 A$ m
# x" H# u6 A6 s: t
begin P_pick2 arriving) s, `5 f! Y8 E& ?* D) ^& F
set A_i to 11
) K8 T! |7 V# s/ {: X move into Q_induct2
( N( w* a) b' C& K& Z1 D: ` move into pickaisle.induct2$ {4 a2 y) x( z: D. o
while A_i<=30 do begin
: f4 H! e4 T! m7 [7 c travel to pickaisle.con(A_i)) Y: a9 C/ Q- P/ \9 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' |, q) z8 p& {- ?) Y+ |- J6 c8 i else wait for 10 sec- t# g- D+ t- n+ G* S
if A_i=A_leave then send to die, k8 }: V" O0 v, S
else inc A_i by 14 G7 C+ l3 x5 }" `! U
end
8 Z) Y% v* c1 x6 N9 w- D# m9 xend
, g u j/ q- `
~+ }8 W# m6 m3 }: V2 abegin P_pick3 arriving- R; `" t5 O; t9 @8 F& @2 \
set A_i to 21
+ G# a0 n% R6 G. B move into Q_induct3
6 `* V5 x) M+ y/ B% K move into pickaisle.induct3, w8 t* j- z1 r
while A_i<=30 do begin+ _# C8 f3 h' |$ [/ g6 v
travel to pickaisle.con(A_i)
$ B4 s$ X; S. [3 P q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ _# m+ J+ Q2 d! q else wait for 10 sec1 l/ m# H, c; Y2 A M2 U
if A_i=A_leave then send to die
' J' E m4 x3 @# J8 H else inc A_i by 1! @ V( w4 K$ G& ~. e
end
8 A" `. i7 y3 v1 T _6 S1 Kend |
最佳答案
查看完整内容
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,其它按你的 ...
|