|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# K" f$ h4 @/ O8 t5 F6 v# h+ L5 {# Y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
2 r" k1 l7 k) \( p- K2 N* _/ K/ u# V2 l
begin P_read arriving: V2 t# k8 L0 R$ I3 k/ o
while 1=1 do begin
& ~- _( K# M; \1 q' i, _+ a9 Z read A_tote from "data.txt" with delimiter "\n"' [: i3 }! p; x' `( f
read A_time from "data.txt" with delimiter "\n"
, \0 U+ h3 J8 @) T( x t. B5 A read A_leave from "data.txt" with delimiter "\n"
" B) N: C X6 N7 ?+ K. ~ read A_picks from "data.txt" with delimiter "\n"' @1 d, N" K" Z; i
set load type to A_tote
% E# F+ H" \# K5 }2 i* s if A_tote="tote 1" then set A_induct to 1& e8 v- L6 b+ M) J! _
else if A_tote="tote 2" then set A_induct to 2: ]4 o7 J3 Y; P3 \1 k2 X0 E
else set A_induct to 3 ' \& b2 }7 Q% L9 K$ z
set A_i to 0
6 u3 D: O0 e! ~, g! c, D clone 1 load to P_induction
3 g7 u( a- A6 i- w wait for A_time sec3 O' A* v& O: r! a; z' g y
end
2 E* Z# r+ j; X) zend
6 h# C7 Y) Z# ?! ~9 u1 ^' C; T7 ~" p/ V# H( j
begin P_induction arriving- D4 b4 w$ E( G6 a f7 a3 c
if A_induct=1 then clone 1 load to P_pick1
! b8 z" ~3 _' O( G& _! u# L else if A_induct=2 then clone 1 load to P_pick2
; j5 w) f9 k* A2 M else clone 1 load to P_pick3( Z( r0 n/ `6 K& g! L p% z
end
" }1 U, {2 `4 E, m* {
2 k4 E h& V0 b6 `( n, ]begin P_pick1 arriving8 z) n9 n4 Q3 l2 D% G6 Y
set A_i to 1
! I9 p9 D: @0 X+ g5 G8 r3 [7 A m D move into Q_induct1
( k: k, d3 T+ D, E. N' K move into pickaisle.induct1
$ v7 e3 I- o% S) T, g% b while A_i<=30 do begin# t7 u2 G+ v( n H8 N* `
travel to pickaisle.con(A_i) d# |: w1 V; h) i, |7 b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 V2 P8 ~4 s! t& X
else wait for 10 sec
6 z1 Q, ?3 l$ v4 q6 B6 i if A_i=A_leave then send to die
1 w; f+ A; x! ?* n! P2 u7 [ else inc A_i by 1+ N, _6 V. _+ H; k8 b
end: \4 v4 f5 B& k6 _: G2 c
end* W( [9 H& N2 _+ V s# H U
1 Q' x$ w( j0 C0 }6 B1 I3 O
begin P_pick2 arriving$ F, |) A, ^( r3 V2 l; ~$ u
set A_i to 11
+ L. c4 u% j( g5 x/ d move into Q_induct2
, j0 z+ f; O( o- [* ?, V4 L5 J; o move into pickaisle.induct2
8 z( {* j: w, C while A_i<=30 do begin! S. ~- \! F% N3 p3 E$ Q
travel to pickaisle.con(A_i): Y7 G$ b/ `7 h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; G* B. |( S! y E( {
else wait for 10 sec1 o1 t: L2 B4 C' O# p
if A_i=A_leave then send to die
5 R2 L1 R/ M }; r4 u/ w else inc A_i by 13 ]0 s9 z9 f* [! d: Z$ ^1 a$ F
end6 u; b7 ?1 N; l. E, a9 z
end
# x2 _0 O9 @/ N9 k/ O- ]' P# U( a7 W
begin P_pick3 arriving
- v, e4 O. ~6 A: x; J- B7 i set A_i to 21
2 x0 M$ X o/ f' Z, A7 `, V move into Q_induct3
) ?7 B3 \" w% S2 u) Z8 y2 J' | move into pickaisle.induct39 ]1 L- j6 @( Y1 y
while A_i<=30 do begin# q) q, _# Y7 M; i$ w& b& \9 N
travel to pickaisle.con(A_i)
e, x- y' W; t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' W' _* n, p+ A; w else wait for 10 sec
( j/ q3 y9 j/ j( A, c/ k: h R if A_i=A_leave then send to die
4 J% A% W/ y a, t2 a else inc A_i by 1
- w4 u/ @7 T+ Z. u2 R" \+ | end
$ I |; V3 p- \" Vend |
最佳答案
查看完整内容
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,其它按你的 ...
|