|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* u3 Z4 E. Q0 `) k& ?8 V* `
! F# `9 e( O2 d( c5 U
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# o6 A k r% K( J8 a2 x( c5 O
! Y; E( l% w6 r4 m- C0 J. L5 Gbegin P_read arriving
1 e( X1 Z* e- h! l% o: Q while 1=1 do begin: e; t: ?) x- Z2 @# h7 ~; z, M
read A_tote from "data.txt" with delimiter "\n"4 A" y- D- C8 C8 w! l! C& i
read A_time from "data.txt" with delimiter "\n"
/ l% A8 b2 |- B4 f; C# c# T read A_leave from "data.txt" with delimiter "\n"
7 C8 b" z/ }3 H) d) _ read A_picks from "data.txt" with delimiter "\n"/ g e: ?3 ~# j( x' z
set load type to A_tote/ X- T* {% s, Y: M& \
if A_tote="tote 1" then set A_induct to 11 @5 {1 J( e0 x+ C+ d
else if A_tote="tote 2" then set A_induct to 2
. z) A! j1 T) _) \5 ]' B9 s2 r else set A_induct to 3 0 g5 A. }1 D0 C0 F$ w: [! y# u8 u
set A_i to 0
/ R& `% n* \; d2 |% f clone 1 load to P_induction# W% B- L$ Q1 ?/ `5 k9 i+ |
wait for A_time sec
7 J0 C3 U/ c5 O: c# N3 ^3 g end Q2 G( f- F y( Z2 o& r
end
8 v6 J1 Y8 g! l- d$ C l( ~. u, M* k& P$ Y
begin P_induction arriving
( j! K& h. V& Q% P( w. { if A_induct=1 then clone 1 load to P_pick1
; G. q! ]% e( R( O0 F% |, ` else if A_induct=2 then clone 1 load to P_pick2) n& y; _/ |/ d: Y6 [' Q
else clone 1 load to P_pick3
& Z. {* l5 z7 p( D5 s/ S7 V+ p$ cend6 o. [9 @5 ~6 P; I" ~
- A1 o, Z: Q: x/ R! C4 M2 ebegin P_pick1 arriving
! k" R: `; ]" |( c0 V2 t set A_i to 12 ?/ ~9 l x K! m A
move into Q_induct1
* s Y8 X2 c3 j move into pickaisle.induct1- ]1 b5 y' A9 h/ O2 L+ Y+ L7 H! y* a, k
while A_i<=30 do begin
+ _. ]0 m/ x5 \% y& l! Z. [6 F travel to pickaisle.con(A_i)+ d6 Y: f# l9 \% [) P& ]# Z' Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 F1 O0 V/ T# _# M& M
else wait for 10 sec
& w- L! |+ J. \2 z* q o if A_i=A_leave then send to die
7 \) y7 }9 d% E' C5 m else inc A_i by 1
, X6 R1 t U- i4 S* h8 | end7 ]# w, o! J, d! j% S
end
7 }) m, w6 M8 \2 Y+ m# a! Y' i+ K( y. y5 ]8 I9 v
begin P_pick2 arriving
% h$ r1 \, d" u4 |0 N7 x' u! P set A_i to 11/ `# r5 x* e) f
move into Q_induct2
; k2 ]) B9 _, ^/ [ move into pickaisle.induct2: P1 e( F9 y0 K9 n X | C
while A_i<=30 do begin
3 T) v- ^ q1 k1 l- i# | travel to pickaisle.con(A_i)
1 b: N3 Q4 u- t+ j! ^% m& Y7 V if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, G0 v. K# f2 X, R3 T' e else wait for 10 sec
z/ {; F9 f( \+ W( F% ?2 N% m if A_i=A_leave then send to die0 h4 R( I$ k0 w% h" H3 u7 m7 S
else inc A_i by 1
7 R" Q, \. h) ~4 g end
0 m, S& v+ P$ s: G1 M$ h) jend
5 i* U5 |) A! ]- u
4 @7 k9 @5 d0 u' ]% ] Sbegin P_pick3 arriving0 c( \0 ?: |" H# L
set A_i to 218 D% B5 d5 D" d/ q. ?. ~
move into Q_induct39 o0 s6 D; L) t: m
move into pickaisle.induct3
Y. Q$ g* b& X/ ?+ X$ G- i while A_i<=30 do begin
- j$ s1 F' V& k/ r travel to pickaisle.con(A_i)( a- \9 @$ e4 f& F
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ?$ G* C! @$ a" M; Y
else wait for 10 sec% [' V) G1 X/ D" h% Y9 V2 t
if A_i=A_leave then send to die
& g6 E% b3 U7 q+ c: S+ p else inc A_i by 1
. X* Z( F0 t0 U2 Y# y4 g end
: J8 f8 S) @ u3 F" k, D+ xend |
最佳答案
查看完整内容
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,其它按你的 ...
|