|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 e5 g: y; H- Z4 I% X
+ O" i" |+ y2 q$ d; J: U7 E
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ x# I3 O0 d4 j: O1 ~+ Z! s5 }) R l) k2 t% j; p. a
begin P_read arriving
# |. B0 u6 o2 e- m/ l4 a. C- O( X( d while 1=1 do begin
R; V% ]5 O' w$ U read A_tote from "data.txt" with delimiter "\n"
8 F7 C: X& j. P read A_time from "data.txt" with delimiter "\n"
5 \2 S* a( g2 |( f2 _$ t read A_leave from "data.txt" with delimiter "\n"
$ Z: [3 t* X e2 C. K read A_picks from "data.txt" with delimiter "\n"1 r* ^5 |1 P( r, Y2 I- K
set load type to A_tote
9 t' F3 C4 S. w% Q: C8 _- u if A_tote="tote 1" then set A_induct to 1$ _: E: {$ R) Q
else if A_tote="tote 2" then set A_induct to 2
6 G# z. t. {' f7 i* m else set A_induct to 3 $ W- j6 ], o: y1 N4 l& j; Z1 y7 h
set A_i to 0
/ }8 s* E! x* e1 A5 v clone 1 load to P_induction; @6 c1 X, a2 H- s
wait for A_time sec6 F' y: C! _8 H) O$ C
end
' Q( _8 r! m+ S, Z) c4 o8 send
0 ~8 i/ L. l& R% G4 w) L. W3 Z0 O2 \' u8 R
begin P_induction arriving S6 m, l* o8 A
if A_induct=1 then clone 1 load to P_pick1: ^& _( [3 p3 a: R
else if A_induct=2 then clone 1 load to P_pick2) f: }1 s3 ^! @! L6 n1 x; k" g# Z6 ]0 Z
else clone 1 load to P_pick3
( `/ x/ R9 r% o" W0 m! yend
. s+ k; Z6 I* a, X+ V9 K8 ]9 [' y, n# G' \8 C/ p" R. [
begin P_pick1 arriving
% X0 `" x1 v$ u, Q$ _ set A_i to 1
# j r+ T3 f M# a move into Q_induct1. b6 W Z, J3 j$ Q1 ~2 O5 @% e
move into pickaisle.induct1- J/ ~1 Q- V1 b" y, M+ L
while A_i<=30 do begin
1 C# N4 ]( Z F2 I3 _1 O travel to pickaisle.con(A_i)
* I0 n9 N2 C7 E% a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# A1 v E8 [3 m- }; C" S else wait for 10 sec& x1 c4 e* ]5 a6 D
if A_i=A_leave then send to die0 Y8 A2 w; D A' Q# p K, c9 }
else inc A_i by 15 _( B, e L' S8 }3 s3 c( P3 [* f
end) W' \( y7 ^0 B. E$ I
end% O1 |, S! n4 t; W$ T) `
. J/ i1 C6 t+ o) ]* sbegin P_pick2 arriving) Q# H# U# M( _( A2 F
set A_i to 11
% P5 |; T" A) b' a: J% o! S move into Q_induct28 r. c' g4 x0 }" U7 u9 I6 [+ [
move into pickaisle.induct2
" ~+ N/ p5 X9 l) ]0 k5 b while A_i<=30 do begin
8 }% O. v/ M! e1 R5 w travel to pickaisle.con(A_i)
; J/ ]4 }$ m! f4 ^) R1 ^# S# d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: |) |' M0 d+ q, z else wait for 10 sec' O8 S' D6 W4 `" }# q3 S
if A_i=A_leave then send to die* v, ]1 X u' D8 k
else inc A_i by 1
0 M7 `! w3 L$ L6 l4 z1 V end0 g# @1 u/ P! T. R& c/ B) ?$ p
end8 J4 _. \3 G' `, e
1 ?- W5 n: J, l! [" Q9 K
begin P_pick3 arriving$ n' m# B s$ r! d6 @# [! `4 ]5 f' C
set A_i to 21) T6 {8 b6 I" `
move into Q_induct3
) E# ^( I# g* q2 Q/ W move into pickaisle.induct3! Q ?" V ~1 }. M% \* u
while A_i<=30 do begin$ B y* U& B& j
travel to pickaisle.con(A_i)
7 t+ C+ k2 B7 l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* k# b7 q2 h5 o- V: u else wait for 10 sec# b! \2 D6 B8 J# F1 y& H1 x
if A_i=A_leave then send to die
7 P/ \3 j! P+ J; F$ z/ Z else inc A_i by 1
6 {. W$ T3 F0 l: b( x( E* ` end
+ l+ J! ^4 F- B1 }8 s# H1 [* iend |
最佳答案
查看完整内容
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,其它按你的 ...
|