|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" F% o0 L/ r/ F1 C9 b8 h0 v" b4 y0 X0 M6 n' z }3 A6 u5 \9 i
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& s. N7 N1 u2 W. D7 o
|, e6 b; i G. `begin P_read arriving: T- p+ h1 z' B- y1 P0 N
while 1=1 do begin: I' `2 r0 n, g) |0 k9 B
read A_tote from "data.txt" with delimiter "\n"' a$ E2 t- u |# Z+ D/ O
read A_time from "data.txt" with delimiter "\n"
# Z7 c0 i! V+ v2 j; `+ e" W$ y* @ read A_leave from "data.txt" with delimiter "\n". @: S& h: q: \7 M, U5 Z& s
read A_picks from "data.txt" with delimiter "\n"* Y h5 A, ^, c1 T3 i" M* L
set load type to A_tote, u- P1 J. b0 e* _
if A_tote="tote 1" then set A_induct to 13 o& Q) W) S: H' z; w
else if A_tote="tote 2" then set A_induct to 2
) R5 ^6 B& H) `4 c2 u else set A_induct to 3
7 ?6 m+ p! @4 B; V% [- @ set A_i to 0
5 K% _$ E( S2 c clone 1 load to P_induction
( D4 Z0 z1 N( z" z wait for A_time sec
% o' b, h% J8 ^) h: z end
/ R: d! \, R! d% K6 cend4 A* I8 p, W# q/ b8 y0 S
+ e k1 B& F' t- |* [% S4 W$ X z" h
begin P_induction arriving
' b- n4 U; v, x$ Y if A_induct=1 then clone 1 load to P_pick1+ N6 G" [% A; g2 u4 D5 \ G* W! g" d
else if A_induct=2 then clone 1 load to P_pick20 {( k, }$ g- b3 X1 k' {
else clone 1 load to P_pick3/ b0 k$ i( x' a3 H8 a4 x2 m0 L& x0 X
end
# t2 i+ L- u9 M/ s% [3 ^8 J8 q/ ?2 T9 x' k$ M2 P
begin P_pick1 arriving1 l! R0 {: U* _
set A_i to 1
( i0 v9 p4 ~3 D& \ move into Q_induct1$ y5 g1 Q9 E- j9 x
move into pickaisle.induct1
" i# G T. Y3 G* e9 u while A_i<=30 do begin, ?* ~/ w) d' \
travel to pickaisle.con(A_i)
, I0 ]! ?9 W7 J4 s- T& v if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& C- h7 o: u3 K$ \; H+ c: F else wait for 10 sec
7 b6 I/ Y$ w4 w8 y$ B/ r if A_i=A_leave then send to die
8 M+ |' y) A6 `5 ]9 F) { else inc A_i by 1
8 G) r( P- O+ s& J end
& W0 M# C5 b- n0 G/ R8 ?end
2 `% |8 G, g" K( x) d; x; g6 x o- A
begin P_pick2 arriving
+ d6 b9 Y* A% b! _) k. V set A_i to 117 e) |0 N+ V5 {8 H# v! n( R
move into Q_induct2
# N/ [6 @+ ^+ P" J' l+ a2 B move into pickaisle.induct2 L+ x3 N' n4 e, m+ T4 ?
while A_i<=30 do begin {5 I& Y# D) H d. H W/ J! z: f/ G
travel to pickaisle.con(A_i)! B; a W1 O/ b' k+ ~, B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec }* l9 c R ~" m
else wait for 10 sec, b, G3 K) I7 V3 W* Z
if A_i=A_leave then send to die
$ |4 ` U/ R6 s/ }, J else inc A_i by 1$ d! ?: N! t9 f) m& S2 @. ~1 S
end
. i) h; v5 @+ Kend
' u% @3 U% ~7 u" Z* C( r; ?* I+ D2 o' y/ w& Y6 i
begin P_pick3 arriving9 Z$ D7 u. l" |
set A_i to 21
7 d/ }+ ^8 f! Y* i move into Q_induct3
6 r V2 C5 Y) }* Q" L move into pickaisle.induct30 h$ p5 Y; ?# a) l" ^
while A_i<=30 do begin
/ u( q4 Y8 V/ U travel to pickaisle.con(A_i)
) u7 E( I; u& F! d0 {' n3 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. F% ~2 C/ \+ h: H0 B else wait for 10 sec1 c; b7 C8 Y* G* B$ M) Q$ t
if A_i=A_leave then send to die
% K' K+ L/ d, ]' i. u else inc A_i by 1
, y3 E# ~0 f3 Y end2 { v$ |' R$ @7 @+ U
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,其它按你的 ...
|