|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# J3 s( O! ] g0 q, R# L/ O, G' m/ S% D- G/ Z
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' V% D) w' y1 b$ O
* m! ~8 u- o2 ^7 l$ abegin P_read arriving
5 U% X/ H8 }2 O5 m" v while 1=1 do begin" k' q) @* w& y8 O( q& b, ^: R; t* S; N
read A_tote from "data.txt" with delimiter "\n"
% R& e Z* x0 E7 n0 O- M( z read A_time from "data.txt" with delimiter "\n"
6 J" ]: w! d. U7 y2 Z read A_leave from "data.txt" with delimiter "\n") H8 J5 v1 E6 N
read A_picks from "data.txt" with delimiter "\n"8 A( i( M, @$ D# m2 Y, @
set load type to A_tote
6 M% U6 U, z: u+ Z ] if A_tote="tote 1" then set A_induct to 11 t" {! S9 J4 D$ d* L5 }
else if A_tote="tote 2" then set A_induct to 2* D* U( G) i4 u+ Q
else set A_induct to 3
) _! E1 W9 T/ t set A_i to 06 D9 I* J. a' [" ]" S
clone 1 load to P_induction
% [5 Y9 |9 d; ~7 @3 M( c wait for A_time sec
+ M' ?/ C- ^1 z( M6 Z7 G% D end
1 B6 `, F ]4 z, u" Y# `end& L# s: c+ P9 m
0 a. a4 O* ^& S ]1 u# o
begin P_induction arriving, H; ^9 ^, Y: o9 ^) ?
if A_induct=1 then clone 1 load to P_pick1
" F1 n# _8 `2 \ ?7 t+ r else if A_induct=2 then clone 1 load to P_pick2$ F" J. z$ K9 g, _2 e2 W
else clone 1 load to P_pick3
% ?8 e. Y" y# g8 h7 l4 |( N$ Iend. q& Q1 F% r/ c/ Q* c1 ~
1 _+ z9 [' B. c8 n, x5 i6 h
begin P_pick1 arriving6 K1 L* y1 \* U7 G9 {& R0 R
set A_i to 1" M ?( Z; t4 {
move into Q_induct1
0 P, P# i0 N X1 M& p$ y move into pickaisle.induct18 o; b/ y, U( v4 v( k! Q5 Q
while A_i<=30 do begin
- R0 T) l; r1 x7 u travel to pickaisle.con(A_i)7 {) s3 w" L8 U6 r9 J' p! L$ c4 X1 D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 ?( k3 X7 A2 i: O else wait for 10 sec
+ K1 k! ~* P+ M: S E if A_i=A_leave then send to die) N% s1 X( i% B3 r Y8 [
else inc A_i by 1. O& N8 [. y& ?; z
end
3 l _0 {% J) D- H) O) Fend/ @- _ N! T' l! R$ l" |
! ~: f K! x4 R$ o2 hbegin P_pick2 arriving# C/ U" H G3 F, |1 G0 t% u
set A_i to 11+ U f! s4 e8 E
move into Q_induct2* C3 t# V1 x, `( y% [5 U
move into pickaisle.induct2
3 |# l# Z/ X# e9 s+ u while A_i<=30 do begin
- h# S! u4 _' o1 D/ C1 J7 T travel to pickaisle.con(A_i)
% E9 Z) B/ B V7 G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 X- { q0 a. C$ e! z( i& c else wait for 10 sec+ c7 m, Z$ y$ g- U8 h
if A_i=A_leave then send to die
8 m+ T% Y1 @' Y0 H1 l7 w else inc A_i by 1
2 @$ j' g, f* v+ v6 m end
0 w$ ], M; N& }+ x% Gend) N& s* j( D9 W/ \ u* K) b& b
0 b& s2 J0 v0 q& Hbegin P_pick3 arriving( m& ?& V4 x' F+ t
set A_i to 21
`- F. a5 V) L move into Q_induct36 G2 r* k. x5 S& [+ j3 @
move into pickaisle.induct3
& z, [ v1 d; d5 s while A_i<=30 do begin2 n/ | Q* `" S' R
travel to pickaisle.con(A_i)4 v. U( q% D/ d% \0 M) V
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ T$ ? c! @# `( S* X& ^7 C3 Q else wait for 10 sec
0 o @6 V$ M) V! j3 o. `# F* [ if A_i=A_leave then send to die+ E: s) R1 K/ K5 I4 j0 @
else inc A_i by 13 e$ r( d) i3 m3 i- d1 P
end
; R7 i& |. G5 h, Z/ H8 v3 ?3 f0 hend |
最佳答案
查看完整内容
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,其它按你的 ...
|