|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
* @- ~) M& p- U, Y5 B( K8 n' U6 q& N9 p/ j& D% w; X7 k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ ~; T) o; d. `( x# C" \& d
! o- f5 J; r, s% |begin P_read arriving0 ~0 J' t9 c" V' X+ I
while 1=1 do begin( w$ x: s+ T- n! i7 o( _
read A_tote from "data.txt" with delimiter "\n"# u9 }7 E) S2 D. K) N! d, H
read A_time from "data.txt" with delimiter "\n" M( E" E2 v( ^! y, z7 k* t2 B
read A_leave from "data.txt" with delimiter "\n"' Q* o% ~. `7 m: C5 p: Y6 U
read A_picks from "data.txt" with delimiter "\n"
4 x* o" |( A/ _+ O" W set load type to A_tote
! e, u* N! c1 n! { G( u7 m if A_tote="tote 1" then set A_induct to 1
; J! z) `9 V, I, ^+ s* Q else if A_tote="tote 2" then set A_induct to 2
- t+ P' S8 `% W; K' i2 k" f% |, y else set A_induct to 3
k9 A! ~8 Q. u1 U+ ] set A_i to 0
0 E% W# r2 `" D clone 1 load to P_induction1 C* ?& j# j9 W* ^
wait for A_time sec
. P, F- C' N# m- B* I end- g `# h: `7 o0 {2 h
end/ g; i6 o+ Q, x) c
- [5 J2 Y7 F" Z6 H8 K$ dbegin P_induction arriving
7 F, B/ [6 n H* w! h' d if A_induct=1 then clone 1 load to P_pick1
! \7 r( O" H7 u! M" B else if A_induct=2 then clone 1 load to P_pick22 p4 |: X$ y- V
else clone 1 load to P_pick3
( x/ T3 ?$ L" }; Y7 {end- S' u; p5 @; I1 N" D2 R* ?) O8 ~0 `
) d* B, |8 s2 m3 s. j% Hbegin P_pick1 arriving$ S9 W5 y+ B* _6 V
set A_i to 15 s* _, u3 J1 b0 Z+ x, ]6 L
move into Q_induct1
+ M, M: \/ W. p9 J! [ k4 u move into pickaisle.induct1* v, ~# c3 s# b0 Z! ?: h
while A_i<=30 do begin. I/ A% k+ B1 @* s' i
travel to pickaisle.con(A_i)
6 g3 L. `+ g; t8 N2 `5 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec a' }/ l+ |" s( T5 l4 ^' R4 j D
else wait for 10 sec
9 Z; o8 ] |$ Y2 q. U2 J if A_i=A_leave then send to die" z- }' {) g8 `! x! k3 v# a) H
else inc A_i by 1' ?6 i% U9 E2 i5 ^) n
end
1 s& B) p% ~4 m& f$ e) _6 wend
: i! Z- A. m$ }; P5 |* u/ T1 d$ Q9 i; x$ B* p9 l5 |* e- Q$ T
begin P_pick2 arriving8 J# _& e# H q
set A_i to 113 u3 @# }' X z% l
move into Q_induct2* X. |) e. l- ]5 q8 }2 ~& U4 x
move into pickaisle.induct2
- U1 B8 B1 d8 g- G0 g; Z" @0 H9 d while A_i<=30 do begin
$ H6 k7 k' P. ~) W \ travel to pickaisle.con(A_i)
! g4 F7 K0 z5 J+ X* V2 i# ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! E7 t+ v; K4 _+ l* X/ N
else wait for 10 sec! R+ V5 Y( z4 ~: k+ ]4 U5 C, R3 J
if A_i=A_leave then send to die- c& o* o7 O3 C9 v8 Z% f, A
else inc A_i by 1
, T+ ~4 t: O% A! x4 Q& y6 e end7 R9 Q V, j, J! \+ Z
end
/ x+ }; t; O- R4 t$ i# x+ S
8 R0 z; j7 i kbegin P_pick3 arriving
- l2 A% k* {5 O# t% p$ H; O set A_i to 21! B. {; q- j$ {9 d9 y
move into Q_induct3 J: K- r% V* f: A1 I
move into pickaisle.induct3
& H9 D9 J1 Y% r) A while A_i<=30 do begin" s# Z3 k6 u! R/ e+ m5 ^1 \1 ~% F
travel to pickaisle.con(A_i)
" H6 M3 g8 z. r. A6 g0 \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& x4 p: U3 x% T, S* W) H
else wait for 10 sec8 n# x7 d& o, p! t Z3 _ A
if A_i=A_leave then send to die. k7 }! S/ t2 i7 {2 P! f9 L
else inc A_i by 1
9 e& {9 C+ y* d; a$ l4 {/ e) l end0 R/ T+ m, l7 e$ ]$ V* u5 o
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,其它按你的 ...
|