|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Q4 ^7 \6 m$ i G" @, E% Y
- F. v" l0 Z9 M+ C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。7 P) \: a, y6 l% c- t/ ?0 H
! J6 W$ [+ Z! J! [6 [9 t; _/ c6 Ybegin P_read arriving
6 T6 @ H$ H! ]1 S$ ?- o while 1=1 do begin$ z: U( J1 N9 `: u
read A_tote from "data.txt" with delimiter "\n"
9 _: c) w7 R. N& d, G; O' w read A_time from "data.txt" with delimiter "\n"# Z v) U$ p- m4 B) u
read A_leave from "data.txt" with delimiter "\n"
/ S. [4 n6 g7 w4 b- @" y read A_picks from "data.txt" with delimiter "\n"$ I, N$ _* i5 I& m! I
set load type to A_tote. |" O/ M- H9 x. B$ W( C
if A_tote="tote 1" then set A_induct to 1- ]: _' ?- j Z& C# O
else if A_tote="tote 2" then set A_induct to 2
. M/ m! v* j; \6 r else set A_induct to 3
- x3 C0 J2 h- W+ @; Y/ f set A_i to 04 N! _2 B- Z" Y
clone 1 load to P_induction) V/ a n0 P2 p+ |; s8 J, U0 `4 u
wait for A_time sec% ?9 T+ {8 ]4 B8 ?- S
end
. w0 |! T- B9 v5 x) l6 G& t6 w% Tend: y8 x0 ]. s* q. F
7 W9 d5 i- j# l) }7 Z7 m. Gbegin P_induction arriving9 G& J5 E, O6 G0 l4 {
if A_induct=1 then clone 1 load to P_pick1
0 C! Y( t6 o' n2 `$ G+ O# B/ L* N else if A_induct=2 then clone 1 load to P_pick2; }& S, l. {% s/ j
else clone 1 load to P_pick3
# c& h0 d; z6 ~: n. [4 G1 ^end/ Y4 z, W0 n. f9 I
, M! p4 R8 k* T
begin P_pick1 arriving @) N6 ~4 f4 i* l4 @( n& h2 Z
set A_i to 18 [% [3 V0 c3 D. g7 I- o" V
move into Q_induct1 Z# z: m. Q+ |5 l: _8 @# i9 i
move into pickaisle.induct1
$ C- c7 w/ @! F9 `& _) T: S while A_i<=30 do begin2 s( @# ^. C3 [3 z h% {! V6 _" X
travel to pickaisle.con(A_i)
9 D7 }) [/ j# x, w0 Z1 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 X8 c9 L( | o0 j
else wait for 10 sec
7 [+ J- M5 Z) k% B1 } if A_i=A_leave then send to die
- j( i( ^, ?* R: `% a1 C else inc A_i by 1
% C# y5 L2 J, T; F1 a end
0 X" r( g3 I9 U5 Qend6 M7 f, v" `7 ^ U" Q2 r
; [" d: ?) T! b, ?! I: b7 R* _
begin P_pick2 arriving
& b# j/ K. y6 h+ o# j7 y& Z set A_i to 11, @& c: S, R" M8 n& r
move into Q_induct2$ @; F" D1 D$ \2 K3 g7 }
move into pickaisle.induct2
+ P `1 y9 H* X" [ while A_i<=30 do begin
8 N% V" M O+ Q- \8 J% C' }+ P* _ travel to pickaisle.con(A_i)* f; |5 I* F' e' a. b2 ^, f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 ~, F4 S1 A" Z" { q: O else wait for 10 sec4 u8 ?3 n' W/ f$ m
if A_i=A_leave then send to die
/ n5 h9 L- [& s& N3 {" H else inc A_i by 1
: i- _- P& t9 ^" ~1 H2 z end
+ Y9 \( ^. ]9 Y+ v5 kend; _. U+ h: C0 W% ^
1 z2 _; i/ P4 i# T0 D7 W4 Fbegin P_pick3 arriving; N. I- s( @/ l
set A_i to 21& q) n$ l) M# j( |
move into Q_induct3, v" d5 c2 Y; k, ~# f
move into pickaisle.induct3: {4 @ o, C2 p1 a
while A_i<=30 do begin
* Z0 F1 v- E7 S) r7 _) E travel to pickaisle.con(A_i)
4 w# E/ D. G9 d9 d: o1 n/ l$ p if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ b: h, u0 R4 u! X; X
else wait for 10 sec
$ O' Z1 U) c9 P3 d2 i4 E5 j if A_i=A_leave then send to die
M \% J/ p U( X else inc A_i by 1
2 \( S. `* T+ t, r& _$ i, S2 I end
: Q7 Z- O4 e: w* v }# 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,其它按你的 ...
|