|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 M4 W7 X0 s9 n3 l$ G1 c) P1 F
+ ]1 N! n: Y! n, D) W我的问题是,在每个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中的数值,不知道会不会有什么不妥。 |, g7 N' [% w; k( D3 m8 P% i+ o
j0 d% B V- ^: c. a6 p
begin P_read arriving9 ]0 y+ ]7 E' n4 F
while 1=1 do begin* S) r8 F: W/ {6 u
read A_tote from "data.txt" with delimiter "\n"
, Q: T7 L3 v- u' r read A_time from "data.txt" with delimiter "\n"0 n* o( G6 |$ L
read A_leave from "data.txt" with delimiter "\n"
9 ~0 I( t$ e8 h1 \' v6 K read A_picks from "data.txt" with delimiter "\n"
0 r. d$ t2 @2 `) V. c% J( I" g set load type to A_tote' ?$ K9 t: c* P+ k0 |
if A_tote="tote 1" then set A_induct to 1
( O K+ s' D1 d! {( u+ I) O4 N else if A_tote="tote 2" then set A_induct to 2
2 Z- E V6 N; L. z0 k else set A_induct to 3 " u8 J8 @/ b+ W1 [) j
set A_i to 0) Q8 K; N3 l4 I. J" ?$ E" ~
clone 1 load to P_induction
* P: H/ x% F" P9 F2 y wait for A_time sec
5 i7 v8 ~2 Q( w7 h2 h. ? end
2 r1 I* {4 @) _5 Jend. Q, x. {8 H# a
5 l% k/ ~1 B! H5 s. e6 c% I- d; {
begin P_induction arriving# X/ o/ @+ J/ F6 d. o0 }) m
if A_induct=1 then clone 1 load to P_pick1
4 _$ h+ |4 \' o+ p8 w3 b" g else if A_induct=2 then clone 1 load to P_pick2
7 n( p5 L E3 N6 w else clone 1 load to P_pick37 \9 _) v$ X! L2 o1 s$ l, U
end5 m: I! g6 f5 N# A
* Z: U5 q, l3 O$ ]begin P_pick1 arriving
* F. U9 n" c/ d7 x set A_i to 1
7 [/ _$ v5 j8 \3 ^ move into Q_induct1' G4 p# D0 S A, s
move into pickaisle.induct14 }+ E* p' B, X7 c; e$ f- _
while A_i<=30 do begin
) i) Q0 \4 }; L) Y+ B' r6 @. l3 z travel to pickaisle.con(A_i)* V6 @4 G+ E: [- l) j( G2 F4 K2 G
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# v2 V! \7 O3 a" a# ^9 S3 ^3 C# d else wait for 10 sec
, }4 T0 \# C. |% ]0 } if A_i=A_leave then send to die% t+ A m k& F1 ?/ S5 }6 r
else inc A_i by 1
7 d m" e- g2 X; s' B' B4 c end. T" T' c, W& t: C
end4 X; n1 @' _7 H4 s* q, M
- E' k7 @- d& Q X) Zbegin P_pick2 arriving
# Q7 ]- _8 B. B% a8 O9 e" V set A_i to 11
& h; ~( t. p6 _/ n6 { V move into Q_induct20 P$ u9 ~ |& ~# U& q) K# r
move into pickaisle.induct29 C' ]. m. A# @) i; r
while A_i<=30 do begin5 W* O3 W% \; p* q8 Y* d5 {
travel to pickaisle.con(A_i)
6 I& V2 ~6 U, z8 c if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' A# T/ L7 s9 S5 R9 g) G( a* Y else wait for 10 sec
+ H8 z! \/ Q! S7 \; G if A_i=A_leave then send to die
5 g$ s* D. @$ W4 W) h else inc A_i by 1, }. J4 c/ ]/ ?. I" ?
end/ p. l. j$ f# o1 G1 _8 i
end: @: q% C, d& Q) ]! o6 E
6 ^( ~! J5 ]# g( w& w- V
begin P_pick3 arriving1 T1 R) q' K8 x# N4 r
set A_i to 21
4 S! S6 c" b" Q% Q2 o move into Q_induct33 v" f7 W9 p3 P2 ?
move into pickaisle.induct3
4 R M6 _3 V# C* T$ r+ J! b- X0 l1 q& } while A_i<=30 do begin0 J. s- ^- W- _8 ]
travel to pickaisle.con(A_i)! I! K3 J: o. Q" [! G1 r; [; h. v3 J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 O6 [8 H$ D0 [6 A( ]( e H else wait for 10 sec
' V: Y$ H4 T$ ^- A if A_i=A_leave then send to die" H; H4 |" u7 u& R5 a. `& d
else inc A_i by 15 R6 _8 N& l* l0 w8 Y
end" F3 f5 \( [+ N2 O0 K
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,其它按你的 ...
|