|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 s) c& n. T! ~/ _0 B8 L
5 V3 H: k/ Z7 C1 Q' w4 N我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 T; ]8 C3 q! A, D( q
5 t2 g- Y+ d- ~# f
begin P_read arriving& B. ]+ b1 w' S
while 1=1 do begin
0 K# Y% F" g- G% L read A_tote from "data.txt" with delimiter "\n"
* D- N& U% ]1 b9 E read A_time from "data.txt" with delimiter "\n"
- w0 x; Z8 x$ q V read A_leave from "data.txt" with delimiter "\n"
" N% a( ~/ e9 B" R$ o' e, F read A_picks from "data.txt" with delimiter "\n"
# `( u* V$ p# u2 } Z, ~ set load type to A_tote
5 d, V8 p1 k- _ if A_tote="tote 1" then set A_induct to 1. f& J5 o/ ?2 O `
else if A_tote="tote 2" then set A_induct to 2 Q3 I& k6 D& t
else set A_induct to 3 1 [1 F5 k% m8 a% C8 S* p' Z
set A_i to 0
6 s$ ^' U6 q4 T3 v clone 1 load to P_induction
/ e; v& t: J" m8 p) `. R6 V6 H9 b6 ` wait for A_time sec
) _& P1 \- b5 f: i$ h7 p end5 h% E5 M J) d& U9 L% ]0 Z
end
, l6 P, S# P3 }9 W- D
- n3 S( s: |" kbegin P_induction arriving
% n4 _' F8 @) I' F9 ? r5 I' A3 J if A_induct=1 then clone 1 load to P_pick1. ]& |; `( ]9 O( L5 b
else if A_induct=2 then clone 1 load to P_pick2; S+ Q- y# R4 e( U, ^# d. |
else clone 1 load to P_pick3
* q! H- c) b' L5 wend
0 R( l( n+ ~% g0 W: ]' q+ | j7 R6 V7 G
begin P_pick1 arriving
" I* X3 ~& |2 e, v2 |* B6 U# X' \ set A_i to 16 { t, p4 Q: e6 j2 r! m9 M
move into Q_induct12 a4 I) c# r/ a" Q8 j, b
move into pickaisle.induct1! s b# i- c( T7 b" X
while A_i<=30 do begin
0 h, |! ^* b5 S, d$ c# Y& y6 m travel to pickaisle.con(A_i)
) m9 E a" a7 P8 N$ D if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 A* f' G& z0 ~ else wait for 10 sec4 V7 P: @+ [7 _' a( R5 U
if A_i=A_leave then send to die
7 r" T* q* A% G _ else inc A_i by 14 e) q' {4 o, M0 z
end$ u e g: I& ~* j: `0 A
end
; l7 B5 ^2 C' ~% r! N9 M2 G
8 M1 D0 |9 p5 q& vbegin P_pick2 arriving
" k* H1 p; @" p3 a- D7 B set A_i to 11
1 w" c4 P/ O% b/ r5 ~9 t, I4 _) s move into Q_induct2
1 C5 H2 z0 @9 ^, ] move into pickaisle.induct2
9 X& e& z# {$ M$ G0 X( i/ o! m while A_i<=30 do begin5 d1 g+ a8 a+ \4 o- U
travel to pickaisle.con(A_i); G% R9 P, C- C$ E* W- I6 Q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! Y1 f5 c- X8 H else wait for 10 sec
5 }( ~. Y4 i3 w) U; C if A_i=A_leave then send to die2 B5 ^6 L( w% m! D
else inc A_i by 1 p# f* }/ _# J
end
& V" c* {& Q+ L; T$ l+ Z+ M# Cend
% T1 T& z0 I, R3 m1 [9 R5 ?9 D! C; _, D) B/ \, q$ I' u! U
begin P_pick3 arriving& f4 |/ c' O3 R; l
set A_i to 215 |. P' e, X" w! U
move into Q_induct39 B; V8 x4 l. r% @8 v2 a c+ Q7 R
move into pickaisle.induct3( K( q/ M2 x$ D' z
while A_i<=30 do begin
8 `$ F6 J$ u1 v3 _ travel to pickaisle.con(A_i)
# A, Z% |* [6 X4 U4 S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# ]( C) x; r, R4 @% `) n else wait for 10 sec
2 w9 u0 i. A1 E# q& M* l if A_i=A_leave then send to die5 s. u% c; \6 r6 N% _
else inc A_i by 1+ i, O, x) ~9 k# Q
end
- n- _* x/ F) Send |
最佳答案
查看完整内容
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,其它按你的 ...
|