|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
' X) F9 d( g( {( u& j1 B- z, `* V e) G8 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! O: d' L8 h) |- S% C% a6 s
0 B' C/ F# o2 D6 ^begin P_read arriving
, T& b# z0 \; A Z( ], G7 j while 1=1 do begin
: P( ]- r- d% ^- K read A_tote from "data.txt" with delimiter "\n"
! q0 X) n* w$ q4 x( f# K/ D) a read A_time from "data.txt" with delimiter "\n"
6 F0 O* b1 y. H, E& R read A_leave from "data.txt" with delimiter "\n"1 h$ v+ p5 F, r: K3 \0 f
read A_picks from "data.txt" with delimiter "\n"
9 ~+ v. I+ t/ W& t4 h, J set load type to A_tote
$ b3 i6 j) u% s6 o. r2 l7 k if A_tote="tote 1" then set A_induct to 1
d: r# w9 R7 r* |, n& R" D else if A_tote="tote 2" then set A_induct to 2
" U; m0 C( f& d, S0 k else set A_induct to 3
1 ^( H. T. m: ^: O7 J set A_i to 00 p3 `. L8 @9 h2 v) n: Z
clone 1 load to P_induction8 r; f- J( ]" y9 u& q8 _" U: J
wait for A_time sec
$ q! d' a; A* q6 Z8 U end
4 y- y& a/ s2 K2 Jend
2 Z7 c) e J, g# ~/ |$ @* u- D0 D% |4 ?& M' F" } e! V& u( j
begin P_induction arriving! H0 C5 P' x0 m# t, R {
if A_induct=1 then clone 1 load to P_pick1
~+ u7 y6 _6 F/ [0 G else if A_induct=2 then clone 1 load to P_pick2) g5 i; q6 D% B' h$ s2 _$ C+ ~; v
else clone 1 load to P_pick3
* r" L, ^% N* h' x# }' iend% p1 j* X2 M9 l: {0 m% N5 \* B
- R: T+ \3 j" R4 Z5 Dbegin P_pick1 arriving- X. s3 R. T* T. d6 T# A/ Y' R
set A_i to 1
7 L/ B' C* L* n5 K: Y move into Q_induct1
9 I) X) r/ s# h! C move into pickaisle.induct1: p( I- v1 k0 D A5 ]
while A_i<=30 do begin6 s* t) J$ j9 j" g o
travel to pickaisle.con(A_i)& {( l! g$ T# o( C; \/ L' e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" B" i' R5 v1 _7 X; N, x) B else wait for 10 sec
- r: q% J2 K$ ^9 G$ p7 `6 |/ k if A_i=A_leave then send to die
) Q7 f/ C, h# N% N else inc A_i by 1& f# E& b! j9 z
end6 t4 b7 H1 g2 y! M4 c
end* |7 d0 F% R- e* S
/ o j) d% W' C' C
begin P_pick2 arriving. f7 }* @/ @6 v) c9 u- I3 `
set A_i to 113 D2 H4 K9 m: ]! S& l
move into Q_induct2$ p" g+ w; x i1 o+ j* Y
move into pickaisle.induct2
O; o: X- M, A! w& Y- E while A_i<=30 do begin
) S: {' t9 v6 d4 C% y1 ]6 C travel to pickaisle.con(A_i)
7 b2 [& a5 W: A0 ~# w2 \! p: `1 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 Q6 [' B. Q1 }7 w( F# {
else wait for 10 sec1 M7 ~$ S) {2 r3 O+ `5 E
if A_i=A_leave then send to die$ a3 W* Y% G' ?2 j
else inc A_i by 1$ W1 _7 f0 \2 f; |: ~5 H
end0 w6 E# J8 z6 P% R8 G
end9 t9 j. b8 j# ? D& u: [" C2 _) p* S
N+ _( [/ p! i2 T6 A1 E$ ^begin P_pick3 arriving, y; a; P3 w: ~8 Y0 a/ \
set A_i to 21% E! o" B, N1 k& K& Z2 I
move into Q_induct3 e5 A0 L/ }# i. e& c- S+ L
move into pickaisle.induct3
+ R8 d+ a/ c Z while A_i<=30 do begin" G0 y$ n( f* j. N* O% a6 ^, B
travel to pickaisle.con(A_i)2 {8 Q( L1 N2 ^; S4 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) W) h1 Z" F$ T% H7 ~2 c' X
else wait for 10 sec% t% z3 C) A! a# h
if A_i=A_leave then send to die
8 B6 C" [& k9 u1 ?) r else inc A_i by 1
# X6 R2 j4 P8 x0 n1 y9 B: Y: W, I end" d Z' l9 q) b. r- |- s
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,其它按你的 ...
|