|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
. k! K$ c6 D9 W1 s: b; C+ d" j( u$ }' p" {. R! h" N
我的问题是,在每个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中的数值,不知道会不会有什么不妥。" O: K5 W3 _2 C& G$ C; J
5 a6 h0 w/ S, `; H4 fbegin P_read arriving* ^3 C" c) I. E/ i
while 1=1 do begin
! @: h" e \! C) }3 H( C+ P read A_tote from "data.txt" with delimiter "\n"
; j0 y W1 V$ M8 u+ F* ? read A_time from "data.txt" with delimiter "\n"& [% q6 u: U$ ^2 N
read A_leave from "data.txt" with delimiter "\n"4 _. v. L* z( s% C: B6 y
read A_picks from "data.txt" with delimiter "\n"
+ g' Q9 n+ B" L3 ]: C- W set load type to A_tote; }9 e* K) j( V" D1 z
if A_tote="tote 1" then set A_induct to 1) P+ A1 }& S9 s& O8 X
else if A_tote="tote 2" then set A_induct to 2: ?1 w* u! S7 D* h2 R! j2 e
else set A_induct to 3
1 S, M5 U& h6 z9 z% H set A_i to 0
0 A& u5 y$ M" i7 }8 W: Z clone 1 load to P_induction3 \. s" Q* Y( T+ m) R- g" E9 f6 V) g
wait for A_time sec
. a* \2 X: B6 ?( `! q: `% s end, U1 ^/ K' t7 S" T/ P
end
0 u. c& N# E8 R. D: ^2 P# R2 a" z$ L# k
begin P_induction arriving
4 T4 I" o* s# u7 e- d if A_induct=1 then clone 1 load to P_pick16 I0 }, ?! X# C4 N4 s/ n/ z+ P; R9 M
else if A_induct=2 then clone 1 load to P_pick2, D* z8 F7 b3 m
else clone 1 load to P_pick3" Y, [9 m& Y( V4 b" w) B6 g
end0 g1 s6 i6 Z1 r/ P
, d* e9 v8 J- O2 O8 tbegin P_pick1 arriving
, M* Q6 ^& [* s3 W set A_i to 1
! z+ [0 z* _; w move into Q_induct1- e9 C# Q8 z& _7 U5 r$ e
move into pickaisle.induct1+ O6 o& f% a0 |1 i% L
while A_i<=30 do begin
1 Z$ e. K! K" p$ ?' H V travel to pickaisle.con(A_i)
/ q0 K/ l: o" g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 M* B0 G8 T7 L* X: ]+ _
else wait for 10 sec: M! |1 m7 S- u: R+ e
if A_i=A_leave then send to die
3 ~0 T+ u! S" r. z* r8 d else inc A_i by 12 V6 _: Y* P5 O% J1 L4 e
end
6 z3 i9 t6 w5 V) ?8 ^- R" Fend5 q1 f1 R, u4 L) F: F! ~0 g# c6 A
0 z; `- F r6 _
begin P_pick2 arriving
& d0 s g! v4 ~1 S V) m" `3 q set A_i to 11" l: t3 Y, }. R2 a. {; q: B
move into Q_induct2
* N, H& m9 @5 t1 q4 z3 X move into pickaisle.induct2/ J! d% P6 \$ g4 P- ]4 Y
while A_i<=30 do begin" U4 f$ [, D* K8 W2 Q* i0 F
travel to pickaisle.con(A_i)' H) P& e- M- x5 \4 ~+ C$ x
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" h# X' [" E# n, Q* U else wait for 10 sec/ H! i2 _0 e" z
if A_i=A_leave then send to die
" n9 v, Z6 O% v# H2 C else inc A_i by 1
7 k! U$ c! a% |7 ^2 T end
' e1 v+ ]6 T) m$ dend
2 I5 v9 e( b& l% p6 {4 s# C/ M8 ]3 G
begin P_pick3 arriving' G5 c+ y9 \- R
set A_i to 21
, _5 P- U: I/ X! @5 Y! j7 \ move into Q_induct3
4 O, V6 u4 Y0 }+ n& y$ Q move into pickaisle.induct3
i; V( q. a4 e& W$ C5 i4 M; _ while A_i<=30 do begin
) H! ?) S r/ Y+ b2 r travel to pickaisle.con(A_i)
h: `; }% Z, D7 M; w& h& D$ C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) }" H6 V8 A: v4 p
else wait for 10 sec
2 a2 K. v. d, A7 j. }: { if A_i=A_leave then send to die
3 P: w. y' ^+ L% s else inc A_i by 1
0 {0 c; D9 O6 f5 i# ~, [ end
: r0 E4 H2 S& A9 v: K4 s. Aend |
最佳答案
查看完整内容
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,其它按你的 ...
|