|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 k0 S2 O9 d4 e( w
; I2 \: H1 n5 Z5 _6 N' 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中的数值,不知道会不会有什么不妥。
) I; C$ K! t1 M. [ j8 X3 c# f. V3 A8 j6 t; R1 U1 @
begin P_read arriving4 j9 b! o4 w0 h4 x% N" m1 S' [% t
while 1=1 do begin
. q9 J7 ]$ J0 v3 k: A: B read A_tote from "data.txt" with delimiter "\n"7 O0 ]: N. b$ m9 I ?+ T2 V
read A_time from "data.txt" with delimiter "\n"5 h+ b' S$ w8 l2 b& G' r2 H
read A_leave from "data.txt" with delimiter "\n"3 K+ j& O5 n9 R9 y: `7 J
read A_picks from "data.txt" with delimiter "\n"9 N& d. @! e" d' E. {4 c* }
set load type to A_tote
, g0 Z# S0 a- @5 r8 _1 H+ P if A_tote="tote 1" then set A_induct to 1
* {9 Q8 a9 B6 O7 ~ else if A_tote="tote 2" then set A_induct to 2
. |6 T' t/ X2 d' F$ k else set A_induct to 3 8 b6 I" J! p9 e( F# n5 `
set A_i to 0
Q% `$ i' C; i. ~ clone 1 load to P_induction( p- U$ Q; s( t3 V- X @: e
wait for A_time sec
6 R. {. S% L9 q) h end
2 x9 o- Q l: A* _6 `0 H S" D6 Nend& O8 {: E; }/ e
7 d7 w' {8 Q5 }, S. _ P# r
begin P_induction arriving
3 x& [" Q8 B+ n: s% I' ? if A_induct=1 then clone 1 load to P_pick1( j3 M5 [/ t& \, U5 D" H" A3 T
else if A_induct=2 then clone 1 load to P_pick2
0 ?/ M6 ]. ] b4 y2 J else clone 1 load to P_pick3& j3 H1 k' f; G6 |- B* d
end
' e3 k3 T" Z/ D. j1 h4 f; d) T
* o( g4 F3 q6 S- gbegin P_pick1 arriving% o1 k* V4 u. W6 @8 Q6 ?
set A_i to 1( X' v% g' b" t6 r7 v* @, \
move into Q_induct1
' }# i" {* b2 f move into pickaisle.induct1
8 _; r8 N& j2 W4 Y9 C g+ Z6 B$ |% q; F while A_i<=30 do begin
1 \/ g( z( @9 D9 M travel to pickaisle.con(A_i)
) E' h; t; t* Z$ q; f, m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* D# h& W% x& J4 I+ H5 C* D! c
else wait for 10 sec
: j+ s7 M0 u- ?. F& G: l if A_i=A_leave then send to die6 h4 p; a( A& J& o
else inc A_i by 1
2 r# ?/ k- r, P" t end( Q3 m5 m7 w. {3 O I1 D, I
end, m X# E$ r. a+ J0 F' U
- s: [+ N4 }# x
begin P_pick2 arriving2 ~7 F. Q* Y5 p, i! G% Q( o* t( z
set A_i to 11
: v- n p" ^# B( x+ s0 A5 S move into Q_induct2& M# Y) a5 _% H* t4 ]
move into pickaisle.induct2
1 t2 a6 N0 {6 ^, ~ while A_i<=30 do begin& v; W7 P( {7 F9 m
travel to pickaisle.con(A_i)5 h4 p% q5 ~* E! i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 L/ B7 b& E% x1 m- O) | else wait for 10 sec
1 {5 `6 L& k1 C# a4 J& d) ? if A_i=A_leave then send to die
X# q# B0 P: c# [ else inc A_i by 12 u- A9 K# b; x ?8 B" [4 w- q
end' T! G3 Z G" ~/ `8 o
end
7 f; C' ~6 ]; _/ g
8 c, O" X, v! Vbegin P_pick3 arriving
4 R, o" V6 V3 y& O- l' D set A_i to 21
1 h' r* s9 {7 ^3 |# W move into Q_induct3
& \, X) K$ k' a move into pickaisle.induct3! `2 C( A. V7 }# ~' b. C' l
while A_i<=30 do begin6 A4 t; ^( t& P/ ?( r$ h$ `& W
travel to pickaisle.con(A_i)5 o! m+ i' X! X1 r4 i A: V0 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 A D/ _5 P1 T) P; [# p) I
else wait for 10 sec
. A# X3 b5 k. b! I: { if A_i=A_leave then send to die2 j" q0 `; ^' i: |* @# k
else inc A_i by 1
9 q/ [9 b% _4 k u& g end
! P* Y1 t1 z! ]& ?# H' ^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,其它按你的 ...
|