|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 T$ e1 N* @* y
, V1 S" G/ k0 Z1 Y/ p我的问题是,在每个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中的数值,不知道会不会有什么不妥。2 G: \ \, \/ `
1 ^8 h7 T# e; N: b& u! [9 ^
begin P_read arriving
8 W1 s# \! b( O$ o* R while 1=1 do begin
3 }/ J( q K: I4 l read A_tote from "data.txt" with delimiter "\n"
/ @) [5 q0 z# U. ? read A_time from "data.txt" with delimiter "\n". G& ~1 y1 J& c- d( k- B+ L" x
read A_leave from "data.txt" with delimiter "\n"
/ k7 a7 T" G! R* M read A_picks from "data.txt" with delimiter "\n"8 f5 ^. f& F6 u, p3 k
set load type to A_tote/ _' t) B5 ? Q! _ t( s2 W
if A_tote="tote 1" then set A_induct to 1: J' v% F4 Z) u) J8 O& S F* [/ X, Y
else if A_tote="tote 2" then set A_induct to 2
3 ?/ J) E! n1 @+ Z/ d else set A_induct to 3
+ S. ?2 L3 G4 T3 i8 Q& z set A_i to 00 K b% M9 d( o1 t' E5 d
clone 1 load to P_induction" N4 k! y, }& p1 M3 B* F
wait for A_time sec
+ n! I6 G: Z6 A: B* i$ p% W end3 L5 J+ J( d5 C2 n9 d: j
end
: c5 d9 M; w, S
7 b$ K, n) B6 D+ `5 v1 Mbegin P_induction arriving/ x0 Z6 m' E0 P, _
if A_induct=1 then clone 1 load to P_pick1/ ]1 }" L0 W$ ]! {9 c: [' r
else if A_induct=2 then clone 1 load to P_pick2: r% {; @3 B$ b7 O( u- P
else clone 1 load to P_pick3
; W) ^; N6 K) qend
2 ~6 L' E" t; d
( }/ [# S( C* \begin P_pick1 arriving
0 Z& B" Z0 l. f- d- v4 {% v" k set A_i to 1
' @8 ]: S0 W0 Z9 o move into Q_induct1! ^3 x3 b& r: |& D. C" `3 U; a( K
move into pickaisle.induct1+ l2 Q/ D$ Q' _6 x9 Z
while A_i<=30 do begin' U7 u2 g U& H) S8 D+ E8 t
travel to pickaisle.con(A_i)
) H, r, Y. ^. {; O' F/ A( o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: ?: j; `4 ^1 ?- O! J
else wait for 10 sec
1 o4 `; Y. M* A if A_i=A_leave then send to die
/ T3 w4 m( ]; ^6 n! M else inc A_i by 18 ]2 N% ?/ R5 u; B1 L% A' M9 y! _
end) ^2 x" s+ g( X& y+ ]! s
end
, S. A- E0 M: H. p
+ B* D8 f2 i2 x$ {# g, X+ Ebegin P_pick2 arriving
% {; H9 H2 I* h$ o& M) P4 i p set A_i to 11% `; D" V* O3 _" X
move into Q_induct2
2 |$ W& y* m% C- t7 K move into pickaisle.induct2* h. \) D9 U5 Q2 M
while A_i<=30 do begin
( w7 ], b: D3 i4 e travel to pickaisle.con(A_i)6 o: ]; n" O( L
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: Z9 v+ D' }% S0 Q6 p3 v
else wait for 10 sec
; @6 S" ^ J4 L: B if A_i=A_leave then send to die
8 J! z2 t$ q3 x1 W, N+ M else inc A_i by 1
' k L0 j% [6 Z5 Y# C end2 N6 i. Y# W3 p9 `: e
end! c+ W2 J E- Z' N
6 O# [) w+ m& c/ r9 w* O
begin P_pick3 arriving
. z6 v5 U* n5 Y! `- h+ q$ X& {$ X set A_i to 21' P& H# z! U* v: K# \& f
move into Q_induct3% T @+ X5 [% D) U% r( F! y
move into pickaisle.induct37 U. I* @. N/ z$ \; Y
while A_i<=30 do begin
/ b- v0 T0 c# _* `% p7 k( k travel to pickaisle.con(A_i)9 L% s2 |/ @- V/ s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec. A) Y, Y3 n) P# Y1 H W' U
else wait for 10 sec H4 n( X4 n8 _- _$ R
if A_i=A_leave then send to die2 d( p% Q$ m0 h5 L- a
else inc A_i by 1
' W5 C6 h( D: x/ B( C5 ^3 L0 W end& d, j9 m1 t: v
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,其它按你的 ...
|