|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: B, \4 @+ n1 `; y1 C
) h1 X3 }, G/ W3 B- 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中的数值,不知道会不会有什么不妥。6 c2 z/ u( z! s& }- [) n- V
' h% y' n, a H( S5 n }! o
begin P_read arriving/ z; [ ^" d8 E% X) H
while 1=1 do begin" V+ M3 M6 M, C0 a9 b: Y% J
read A_tote from "data.txt" with delimiter "\n"
1 M0 W" ^. A6 D! A read A_time from "data.txt" with delimiter "\n"
( H: W$ N+ M/ ?) i( X6 \+ Q* G) Y read A_leave from "data.txt" with delimiter "\n"
; s' @3 o. [9 ?; z( B+ F5 N read A_picks from "data.txt" with delimiter "\n"
9 d+ w/ A- P2 y8 n) e& }6 A set load type to A_tote
m6 a$ _0 p4 k: Z& S4 b2 X% B. J if A_tote="tote 1" then set A_induct to 1- ]& x8 T1 i( y# l$ v: A
else if A_tote="tote 2" then set A_induct to 2
2 a6 ]) ^/ S0 h7 h, M3 J' x; @ else set A_induct to 3 9 C, N* K+ A! k( E$ D( u4 S
set A_i to 0) t1 Z$ Q( h4 [; X9 z V4 A
clone 1 load to P_induction% s" e# T/ \# Y0 T2 w
wait for A_time sec
8 b7 e% C4 D" @) ]- I" N" D end" X5 t! i3 f: ]6 { m3 f
end- h8 h0 {( Q8 R- J$ I0 `( F
2 c, t0 Z& [+ @3 J' D) d. X2 S
begin P_induction arriving! E, l# {! D; ~. B3 v
if A_induct=1 then clone 1 load to P_pick18 x. y' D6 @1 h+ l
else if A_induct=2 then clone 1 load to P_pick2
) h3 T- f2 m6 a/ @1 Z! G7 k$ O8 b else clone 1 load to P_pick3
% F; o+ o: H% U Q4 m& N Wend6 V. ?2 p6 m( N# j7 u2 I8 K: P
( y0 F7 J: X5 Jbegin P_pick1 arriving( j0 \/ ~1 K: T* X: X
set A_i to 1
- j8 S2 g* U/ R* p: V" m( r move into Q_induct1: M% D9 Z* K0 I* R$ m& n
move into pickaisle.induct1
: L" S- U6 l- G while A_i<=30 do begin4 Y1 J9 @9 Q6 b ?
travel to pickaisle.con(A_i)) U3 V7 a2 e9 Q5 H
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 s4 z5 [+ P* m6 O# X/ @1 M else wait for 10 sec
6 s: {' n3 F+ r if A_i=A_leave then send to die
/ X( g: F% m3 [ U1 g else inc A_i by 1
( I2 N: B. l7 ?5 c' M; U; x5 x end
$ B4 q; O; w% S6 M0 qend" V1 X ^9 C; a0 H/ a2 `
- G; V0 H I; b# N, l% Y; r3 {
begin P_pick2 arriving$ L4 t# C/ m& o% [7 Y# _) c1 V$ H, H
set A_i to 11
- x4 C3 Q6 j) ^# v) t0 k1 O move into Q_induct2
; L6 b% O/ R# ] move into pickaisle.induct2& S3 |4 y# ]/ U2 C; t* l
while A_i<=30 do begin
0 E9 a3 U9 `9 E; u h6 `" f travel to pickaisle.con(A_i)
) @* G6 W% I( F- ^. L2 t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 C3 N; d5 E% q" D- v
else wait for 10 sec0 Q, H; d: ?* O$ T/ x, _9 l+ @# k
if A_i=A_leave then send to die* I" D: W" E0 T: K6 z1 [! B
else inc A_i by 1 L0 j. ? q% R+ V) _! {4 G6 P! `; Q) N
end
+ [6 }; H' k2 z( @+ A- Fend
8 l, a. l3 H }2 G
6 F0 A8 ]5 {, |( T8 ^begin P_pick3 arriving
! H9 F. L3 l; Y# J j) h set A_i to 21
; G8 p6 b/ h; w; A6 H move into Q_induct3
& {" O5 @) Y/ ^$ B" v( f( K move into pickaisle.induct3$ l: C! i3 e+ R' j5 w H$ |) l
while A_i<=30 do begin
8 p- Z% F5 W% H) q travel to pickaisle.con(A_i)
9 g7 V# J& O! v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 L' \; L# I$ ]$ u" g$ A else wait for 10 sec
% R! Q G- N( S, h* O) [3 X if A_i=A_leave then send to die
2 \. k. H* q6 L else inc A_i by 1& u% n4 ?5 ~1 Q/ A% |5 f( h
end& y3 C+ l: {- T* `' f# J7 G
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,其它按你的 ...
|