|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# `9 N) L4 ~2 U; B( t7 T, m0 B' S
' m: g; V% `6 V( `$ X0 r% Z我的问题是,在每个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中的数值,不知道会不会有什么不妥。# F: j M7 J/ M; {% H! x
4 V% H7 K& _$ J" c, N7 n# D" {/ Tbegin P_read arriving Q: v1 i. [0 p0 w
while 1=1 do begin" r6 [8 E5 c i3 \1 d- q
read A_tote from "data.txt" with delimiter "\n"
& a: O' Z1 p% I, b" F read A_time from "data.txt" with delimiter "\n"
% n' H. w! e2 M$ K* M read A_leave from "data.txt" with delimiter "\n"
4 C5 Q- [1 c8 i; N' {) b read A_picks from "data.txt" with delimiter "\n"
+ n8 |) }* R* Y set load type to A_tote
- ]6 j- F4 u2 V7 |: T* P+ d- x if A_tote="tote 1" then set A_induct to 1
; K( m2 U$ g q) V7 E else if A_tote="tote 2" then set A_induct to 2
) e/ v) u" u2 }! z# D6 S- L3 m) ? else set A_induct to 3 6 }6 v/ H: F9 I! i1 D
set A_i to 0' v6 a7 ~' O7 d+ n1 Q) c
clone 1 load to P_induction7 @2 y5 h) V2 ]# F2 v& q2 W* Y
wait for A_time sec
5 y' q1 o& r& \- k# } end
7 u. G! n2 X$ U& p Wend2 W% T6 X2 {1 r- W6 y
0 [7 i9 N+ _, k7 y; L* G. \4 z
begin P_induction arriving
3 n( f& K( s& A# b if A_induct=1 then clone 1 load to P_pick1
7 V5 j" }# ~! s/ @ else if A_induct=2 then clone 1 load to P_pick2" T2 w# N% x7 F& h6 _8 G2 I
else clone 1 load to P_pick3' _+ p2 O0 ~1 a: n
end
3 l9 a1 }0 X T% q0 ^# w# `4 X. j) E2 ]/ V9 r8 y
begin P_pick1 arriving
6 V. f: A1 N% ? set A_i to 1
& L, ~: G7 I, ^$ D& P move into Q_induct1
& `; d0 ^$ Q) E3 v0 R+ D move into pickaisle.induct1# { K0 c& m3 d3 v6 B% E* I5 a. W
while A_i<=30 do begin0 F5 c# B x( J+ d
travel to pickaisle.con(A_i)
! o8 N/ C# c! V# M4 w( k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec+ ?7 P1 D* H# M$ a. s; ]: ^! s+ K
else wait for 10 sec% |" V. x" j4 X5 e
if A_i=A_leave then send to die
7 I0 [0 i% ?9 j$ n3 | else inc A_i by 1
: n i8 C: x _ end, Z% q( ?/ F" {! r( x! G; K
end1 U# m* [; u5 I. o: S5 C3 W: P
2 w8 m8 f3 K6 ^/ {
begin P_pick2 arriving
: u: g% O6 }6 R7 g$ \. L set A_i to 11- a. R& r, t& t
move into Q_induct2
$ f' H+ J2 e: a* T move into pickaisle.induct2
$ e6 _; g8 j2 ? while A_i<=30 do begin S) H/ J+ b% M& T
travel to pickaisle.con(A_i)8 I* R( K. _3 Q8 Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, N4 k `' ]6 S1 }! H0 D2 |$ J
else wait for 10 sec& A3 z0 m1 \0 x! P
if A_i=A_leave then send to die
: `" m7 Y M3 l else inc A_i by 19 S9 i0 }$ ~' W+ X
end& C+ r. a+ M* ]& p( s/ W
end V" h! X' w+ I% ?* i
+ @+ S" k% K0 T) L# e
begin P_pick3 arriving
0 p( u! D% v: k8 v8 u set A_i to 21
# M O! F" W, B9 T, Q- N move into Q_induct3
4 M2 a6 r( p5 m move into pickaisle.induct3
* M7 T# t: G- f/ t8 E while A_i<=30 do begin
+ D* v- Q. u) P- y3 P% D0 j travel to pickaisle.con(A_i)2 U) K& }" c; d" K4 c1 f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 K/ J6 h3 v2 Q& z- T5 e else wait for 10 sec
8 {6 C. \$ Q4 G0 w if A_i=A_leave then send to die4 m+ p/ X0 Z( Y* G) K* n- ^( y/ s
else inc A_i by 1- J& _' e* M D: s' E
end5 e q5 b6 x1 N9 c. G2 T1 a9 X
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,其它按你的 ...
|