|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢" u% j1 l* D4 w! B
, X$ v4 R; m. [2 a% _& b5 Y8 H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ X: Y2 K% k5 ?2 e6 ^/ n2 z3 Y% P$ M9 X$ ]6 V r8 {; `
begin P_read arriving
3 X3 b3 f0 b. o2 P! b7 o2 P4 K while 1=1 do begin6 r' s" ?; H, q) `3 _; P* q' [
read A_tote from "data.txt" with delimiter "\n"$ [" A0 h" h) m) _
read A_time from "data.txt" with delimiter "\n"
0 S6 l# Y) h6 K5 K @5 K& l read A_leave from "data.txt" with delimiter "\n"
" V- h3 G$ n4 U" A" R read A_picks from "data.txt" with delimiter "\n"
/ e7 n# B, H& Q/ e set load type to A_tote& f* E% [" m$ N- _
if A_tote="tote 1" then set A_induct to 1
( U$ S9 m6 K+ P W else if A_tote="tote 2" then set A_induct to 2" c! k1 O2 z. X/ B" q
else set A_induct to 3
/ o& q7 d' E: I* K: v set A_i to 0
2 m7 Y8 V, I: T' X0 O. q2 v clone 1 load to P_induction C9 u1 S* @: [" j( L
wait for A_time sec
" A* }/ {6 u( } ~4 ^* x$ I end
, q2 t/ ~& u2 p$ E2 mend
) a/ ~0 O$ M* Y) Y. _
) V1 v4 a* i6 Nbegin P_induction arriving! Y3 |+ w, D# {
if A_induct=1 then clone 1 load to P_pick1. w9 f, y0 G9 j L0 V
else if A_induct=2 then clone 1 load to P_pick2
8 H/ h7 r) I) @- z( N, f4 ]- T else clone 1 load to P_pick3
8 E$ }) r# b2 s6 a* Eend( l6 M$ @4 g2 x1 p
( l4 j/ d# |9 k6 {8 O: [
begin P_pick1 arriving
1 P0 t9 n5 a1 C, M( a2 N, A" U set A_i to 1, n- a4 Q0 b/ ]
move into Q_induct15 B( C% y$ W- |+ S% z9 Y1 Y- }
move into pickaisle.induct1
7 x r# K$ X0 A/ o while A_i<=30 do begin
' K7 E- r6 C; g2 Q8 |# P travel to pickaisle.con(A_i)
$ @, w1 u. M4 m5 I9 D* } if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, F) n; n+ R5 J3 o3 ^$ ~ else wait for 10 sec) Y* n" Z& }2 F' B, R
if A_i=A_leave then send to die8 B* T7 w/ t+ V2 Y9 A: I# Z
else inc A_i by 1) @" ]( o. @, z+ a; }4 [( b1 j
end
) Z9 S3 y1 i" w' d8 j2 tend
U! s, \, }! s1 w
% t# a: n. P7 p; Bbegin P_pick2 arriving3 j g0 W( U. X2 y" X. B
set A_i to 11
" z5 D" r9 m" i! @ move into Q_induct25 U+ {2 I8 l2 c+ q8 t$ C8 w% \
move into pickaisle.induct2. F1 E" o! A/ H
while A_i<=30 do begin4 W" ~) y0 g- V* l
travel to pickaisle.con(A_i)
* L% c$ ?: A7 w" N if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 }% Q+ U( n* R* x8 t) a
else wait for 10 sec
9 D) o1 ^5 s# x, V U if A_i=A_leave then send to die
4 G# ~ X) y3 v7 X. x9 k* }- x else inc A_i by 1
% M5 ]* h: z; l9 ]# l6 I end4 q1 i, ?' V9 @( O
end w, y* M9 f: ]9 V0 S5 D& O& F
9 Q6 c; t3 A1 z. y: s |( F1 ubegin P_pick3 arriving
* u4 W6 h7 j3 \- \$ } set A_i to 21
1 q, T+ ?1 ~/ i+ k move into Q_induct3# J, m; y- f7 R( w, c
move into pickaisle.induct3* z8 b* I0 j. T6 V( p
while A_i<=30 do begin( G6 _7 D0 [/ A1 J1 D
travel to pickaisle.con(A_i)
4 N4 k: ^0 ]! ^6 k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# `7 C! P' L; ~
else wait for 10 sec$ `) }' J" A* {4 ?# w6 N$ j5 ~5 d) ?
if A_i=A_leave then send to die
% ]* f ~" w2 _+ G0 w else inc A_i by 1
. R; H/ p5 f( {5 Z end) U7 _% G* T' \1 c
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,其它按你的 ...
|