|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 J7 o3 H% c1 d3 a2 a4 t8 N Z& s: o+ G1 J9 Z& Z; ~6 B' q! @
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 X- j' Q" g5 N* v7 U. ~7 A& g) n& y
begin P_read arriving. U$ c3 b: T8 b r$ f
while 1=1 do begin+ E6 j1 ?) o6 S4 S1 ]& c7 N7 f2 K( l
read A_tote from "data.txt" with delimiter "\n"7 L3 \; j* s- M8 ~# @
read A_time from "data.txt" with delimiter "\n"
( d1 Q- d2 Y+ x: } read A_leave from "data.txt" with delimiter "\n"; R+ {' \- I8 }
read A_picks from "data.txt" with delimiter "\n"
* p' A/ o: N2 B& }" r set load type to A_tote
& a4 n e2 n4 D3 a if A_tote="tote 1" then set A_induct to 11 j3 b" W% ?, L" {; v
else if A_tote="tote 2" then set A_induct to 2
6 [+ c9 k+ U7 V4 f; l/ l else set A_induct to 3
; v3 D" ^5 D. e. H. O# w' [9 {; I set A_i to 0; ]5 `2 i h8 G
clone 1 load to P_induction
4 F% j3 R, W1 H: C9 ] wait for A_time sec Z7 t4 q9 z4 Z# Y# ~' ~
end! L0 ?5 z+ e8 ~9 e2 A6 K' ~" E$ y6 l
end
3 s+ N3 J! L' x4 i h+ |0 I) d) [6 }+ t9 B
begin P_induction arriving
9 a9 S/ b4 q% E; h, X if A_induct=1 then clone 1 load to P_pick1
7 x: q( w5 `3 h: M- [8 X) C else if A_induct=2 then clone 1 load to P_pick26 e% T1 }, x7 x1 u
else clone 1 load to P_pick3( R8 l5 n& ]+ x; f* {7 ]& f
end/ G8 r" Q2 d8 N( e$ m3 B
4 d: C& X0 j' {! a9 \begin P_pick1 arriving) M+ a9 A7 x, Q# |4 j/ t
set A_i to 13 q! @5 P0 b) q7 Y
move into Q_induct18 V3 U. I) M% \! j+ U7 }5 b
move into pickaisle.induct1
% d; v# [3 K. B& d k" k" |9 ]* V while A_i<=30 do begin" w$ u1 c- W) w* Z$ Q5 C, V) `# q
travel to pickaisle.con(A_i). {; t0 z; Y* f' [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ \3 B& Q& q r Y* x' H- e
else wait for 10 sec
! R! C. |8 j& u( Z4 A, m( V if A_i=A_leave then send to die
- u' F" F( `# l: r( J else inc A_i by 1
. C& l j' c4 _$ ~3 ?! Y end' F. v- }5 k9 w6 A. r9 B9 `
end3 b$ t- q" t B5 ~* m9 i
( M1 o5 L; ]& C) o4 N/ }& ?! V! y
begin P_pick2 arriving
: S, H$ j# l: @( f: ~& A set A_i to 11
9 m6 w+ Z3 S1 Z+ M8 B move into Q_induct2
0 J: b9 S, l& L) `- y( b4 Z move into pickaisle.induct2
{; l* a. w1 `7 J/ V while A_i<=30 do begin# i* W& i: i* l% ]8 a1 k; {
travel to pickaisle.con(A_i) u: b, e# c6 [8 j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 O, ^3 c" ]+ h" C8 y else wait for 10 sec% f! M% b) S5 w: m& R) Z
if A_i=A_leave then send to die
# O8 P9 A: \7 c- I& b0 u* y else inc A_i by 1
' G( u: o9 t# X1 u6 s) H: q3 _ end: n+ n' y* l! X7 R
end
' i& l. m1 ^: s- `7 _5 U8 E" k) s1 q; b3 F: P9 e
begin P_pick3 arriving; L5 e7 {& `; u+ E4 V2 l
set A_i to 21
8 t( V, ~& h2 p move into Q_induct3' t }) ^0 c% F3 n ?4 h
move into pickaisle.induct3
; Y, u: M" b1 } while A_i<=30 do begin9 L4 t' p, H; s* O5 r+ b
travel to pickaisle.con(A_i)/ |& Z7 r7 V5 i2 d3 L. o% t" v% e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: s- ^1 h+ `4 i9 k" c- R. u3 L
else wait for 10 sec
+ @* `8 }% i1 M2 l5 |; y P! l- W if A_i=A_leave then send to die
$ J. U* a5 `2 Q& Y# I I* d, @ else inc A_i by 1
* B& G1 q8 o! Y q8 ]8 z- O end' ~- \- p& D X8 V+ _* N, u( b
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,其它按你的 ...
|