|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
7 }- ?: r* T. s0 b. I! a) F; j' e/ V+ u4 f+ u( p- d [5 S
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
3 ^$ }3 W$ L# p2 S( A$ K- [& h8 q1 t+ g' L) U; e) R/ j; y
begin P_read arriving: n. j; `6 @7 v* M
while 1=1 do begin
6 u' @7 u' \+ ]' ]& l% r, P( {! A read A_tote from "data.txt" with delimiter "\n"
4 {4 V0 ~6 L3 y! ~# k6 _$ N read A_time from "data.txt" with delimiter "\n"
# \3 j& J& }$ E2 i read A_leave from "data.txt" with delimiter "\n"
. [$ E, c9 d7 c+ { read A_picks from "data.txt" with delimiter "\n"& K! x$ b2 P, O
set load type to A_tote
5 b6 J; P# k9 V1 S if A_tote="tote 1" then set A_induct to 1
: ]+ H5 j+ ]. w2 m' u( R# G else if A_tote="tote 2" then set A_induct to 2 P m: k( _, V) y2 b+ n4 |
else set A_induct to 3
2 A M7 i* B7 B7 |- P set A_i to 0
6 |; c6 _& E( Q, Q9 L clone 1 load to P_induction
! c6 H3 ~( H5 A3 f. @ wait for A_time sec) U. e8 c9 H& z
end
" a' M7 p4 r, oend
+ f: \: k6 d$ T( O; v3 W; G. _- _) Q& m
begin P_induction arriving' s. Q& z8 X/ _9 S3 R
if A_induct=1 then clone 1 load to P_pick1
% W; o: ~! e- J& r/ }; \ else if A_induct=2 then clone 1 load to P_pick2
7 p. ]2 G, M. T else clone 1 load to P_pick33 D7 Z+ P" R4 t: z0 [
end
! V; ]* j4 w& ]# Y5 Y3 W8 X
2 g5 T. {$ C! Y1 }: Cbegin P_pick1 arriving5 T: a- ?* x! i ?# u! o
set A_i to 1
' N; e8 g5 _8 M) h9 {& q move into Q_induct14 W y6 s9 e+ l" g+ t6 F X9 E b
move into pickaisle.induct11 c% i$ G+ L) I
while A_i<=30 do begin" v. q0 K- X4 f7 c8 {! k3 l( P6 N
travel to pickaisle.con(A_i)& c) L; k" \2 y) i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! k6 Q: b/ t% _1 E5 {
else wait for 10 sec
6 F; }, ]9 ^5 W% y4 h3 _ if A_i=A_leave then send to die1 h- X0 o" G6 g0 M3 c9 u
else inc A_i by 1+ T p9 B/ Q7 o3 ?" F
end( @7 ^- X$ f3 M, j4 Z% s0 B/ v
end+ j/ r$ a8 ~; P9 @
% ^' [/ l$ L, A. h! S hbegin P_pick2 arriving W, ?) g3 M. ^- |. W1 H
set A_i to 111 f! M+ ~. X2 ?# K6 R
move into Q_induct25 H" ?/ J4 ]) @( [, T( g
move into pickaisle.induct2' u4 f5 G c3 ~4 G: l
while A_i<=30 do begin
]6 C# S7 u0 \ w travel to pickaisle.con(A_i)
/ b: Q7 T' w% g' `0 P. x2 G6 m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; ~" ^1 ~4 O9 E: u9 Q
else wait for 10 sec# G2 ?3 o' N& ?/ X7 z. d3 V
if A_i=A_leave then send to die
n4 S$ ?3 E' M3 x \8 T else inc A_i by 1: I% L# l+ ^$ [) x% h. K
end
9 K2 P1 T( ?; d* Dend
' b, L% m9 E$ U+ Q8 v; ~- \: H- v/ e8 I5 K' p& p3 s+ B7 A3 N' [9 W
begin P_pick3 arriving& ~ F d* q5 [0 ]
set A_i to 216 u/ I% c+ o/ J- F' P
move into Q_induct3' W* |. U0 C# L, u" k
move into pickaisle.induct3( v! E/ e" ?- u9 @8 I$ V& e
while A_i<=30 do begin
$ T" z/ n; _' } travel to pickaisle.con(A_i)$ ~: }6 Q( E$ i: o$ ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; `; K! P1 p* k: X" }" }- i else wait for 10 sec! @1 W& L \4 S3 c* t4 R. \0 t" u
if A_i=A_leave then send to die
. g i; K6 G# k, U4 }! B else inc A_i by 1! t5 p4 w* O5 G J, R
end- g! N0 ]! l$ Y
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,其它按你的 ...
|