|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 r9 u& [0 \% a; ^. G+ ~% G! I1 V4 B' d- y; {& u f: 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中的数值,不知道会不会有什么不妥。
' K, Y* G3 }) o9 i8 `
% {9 f% z U* { Z, Ebegin P_read arriving5 t/ x, Q1 J" n% ?' F! C, A
while 1=1 do begin
$ ~: `) y# \$ B) d$ A, h read A_tote from "data.txt" with delimiter "\n"
- i0 L& K3 l" Q2 p read A_time from "data.txt" with delimiter "\n"
5 ?* o7 ~. h6 }3 I2 o* W read A_leave from "data.txt" with delimiter "\n"
4 g: n% b c; Q# c; i- _/ j5 T read A_picks from "data.txt" with delimiter "\n". a0 S$ z$ `2 W" g D1 S2 H4 ]
set load type to A_tote. |& O& d# N( D
if A_tote="tote 1" then set A_induct to 1( h' N- z. W4 f, ~2 y* O
else if A_tote="tote 2" then set A_induct to 2& j, l/ A+ r1 ?7 c: W4 b
else set A_induct to 3
1 q& M. f! Q% }% c5 ^ set A_i to 0
l: Z2 c1 a$ e. u# y5 F3 ` clone 1 load to P_induction u7 d5 T% o6 h1 _
wait for A_time sec, Y0 u9 e( Q9 J( ?
end/ P$ _8 a( \9 U8 B
end& c" R$ l, o& p: O2 q u
$ K! y; u2 E$ U, M
begin P_induction arriving
* W/ g9 t2 y ^9 B3 q) B( F d' p- t if A_induct=1 then clone 1 load to P_pick13 U2 A/ d& l1 x6 {5 B, T" s
else if A_induct=2 then clone 1 load to P_pick25 D* \) {7 W. e: X" R& i' z; @# W# ~
else clone 1 load to P_pick35 F$ p1 ?/ v1 A( K7 o' v. R# p
end9 I0 B9 G* n$ z
# |0 A' ~& Y4 M9 l2 I# g
begin P_pick1 arriving
1 A- y+ f! P3 d" \" e$ {, C1 z set A_i to 1
# v- _& }* c, R1 f7 Q+ r, B move into Q_induct1$ G" T9 b" P l- A+ y: P; c
move into pickaisle.induct1( N4 b! o; Z/ z. i+ L! y1 [
while A_i<=30 do begin$ K' O/ c' P7 g) f+ X- W
travel to pickaisle.con(A_i)0 s) D$ F' n% T: y! ]$ U* h* {) A# D
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Q* b% U7 G A- O W5 d$ j
else wait for 10 sec8 c6 t+ I7 V) }* H3 [- m0 N, X
if A_i=A_leave then send to die- h2 F- j# n% L; c7 p3 {
else inc A_i by 1' D7 C' r9 G; @( g3 i$ U: Y
end
8 I0 H9 ^4 x+ k$ Jend
$ l: N8 f( u- @* V! a! |
6 a% p0 ?. G9 ]) h7 @; qbegin P_pick2 arriving
% s c, c8 L, |, k set A_i to 11' ?- i! j+ ~ p; A
move into Q_induct2& y2 Y1 `/ a, q5 ~
move into pickaisle.induct2' T ?8 C( E; ^: @8 D
while A_i<=30 do begin
$ x1 g6 n! j- _ travel to pickaisle.con(A_i)$ C# a/ ?* {+ z: Y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 a1 J/ C9 ], s0 J
else wait for 10 sec6 @" n$ ^5 @6 ^9 u+ g
if A_i=A_leave then send to die
* Z; U: ^( Y ] else inc A_i by 1
; x5 U3 C; |& {- p1 y/ y/ r" T end
. m ]& p8 b* W: v* A( T: Jend$ l9 J4 U6 J( d" i. |" ]& F( N
, C( R7 G$ B6 hbegin P_pick3 arriving1 l1 b# c* t6 m/ {: q/ z
set A_i to 214 B( H6 h2 B) s8 K
move into Q_induct3- z. g0 B* U7 O, ~5 i
move into pickaisle.induct34 `0 L, z2 f5 o
while A_i<=30 do begin
% \" l" `3 j/ P \ travel to pickaisle.con(A_i)
) ]+ {5 t( f( K& X9 M$ i& c* H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. G/ R$ M3 ]5 P/ ]3 x else wait for 10 sec
% m* S+ E) J6 L# c9 V3 b/ ~ if A_i=A_leave then send to die
& O# K3 R- P6 n0 \ else inc A_i by 1
, |8 N$ P$ i) ^; v. N6 n end
. U- I% K3 O" `' S F) b- Zend |
最佳答案
查看完整内容
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,其它按你的 ...
|