|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ |4 Z' L' ]0 k. R0 J* O& c4 d- g: D; ^
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( M; Y% s! r4 L, q9 i
. Y) a; H+ y% h( }2 }$ T
begin P_read arriving
8 D+ d" s' j; B! ~& g2 ? while 1=1 do begin0 r. i5 G/ [! n6 X
read A_tote from "data.txt" with delimiter "\n"& W" }8 L& v1 ]! b9 D( w
read A_time from "data.txt" with delimiter "\n"
8 D- K5 f6 P; o5 Y" ] read A_leave from "data.txt" with delimiter "\n"
* d$ U% j7 ?3 I5 ` read A_picks from "data.txt" with delimiter "\n"( M# {7 M3 w( K; j8 i+ A+ }
set load type to A_tote
0 j4 _+ R; S1 F( m0 e if A_tote="tote 1" then set A_induct to 14 l8 x' c+ C6 s& l" ?7 X8 ?
else if A_tote="tote 2" then set A_induct to 2& T" I9 X: U3 \* m/ _7 d& P
else set A_induct to 3
! }& x$ J# Q. R5 i$ w set A_i to 0
# O q# D3 w5 l, W0 e clone 1 load to P_induction
/ j4 Z0 s. b, `& ], J/ o8 D" W wait for A_time sec. s& w0 k! d8 W& i$ |8 s. a
end
& g0 u. @8 _: ^# xend, W2 ?" O1 \& y+ v
5 i$ c9 n' C: t- I7 w7 H' `begin P_induction arriving
2 q7 _& V2 L/ A* m! q( Q if A_induct=1 then clone 1 load to P_pick1; P/ o6 `& T* d! g- [$ c
else if A_induct=2 then clone 1 load to P_pick2& I0 }3 _ \- r4 D
else clone 1 load to P_pick3
; I7 \6 b$ Y: x: Q6 V2 y4 hend
1 d" ?* R& L e; Q, m# |- m
4 l; `" K# n8 Mbegin P_pick1 arriving3 Y B1 j e E0 z3 {
set A_i to 1
& k( p* k& }! _, s8 k1 Y2 t move into Q_induct1
2 e p2 V6 [* ?3 W0 @+ I. I0 }0 D move into pickaisle.induct1
& { {% \: d5 o7 C( N* U4 T) K while A_i<=30 do begin5 n4 n6 E; _4 z% [ ]! W1 C) Q
travel to pickaisle.con(A_i)
1 x, T5 ~3 `; [1 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. d5 M! Y, H/ i$ }: Y' R else wait for 10 sec+ @: r7 @( _% A) O
if A_i=A_leave then send to die
+ y% F" t0 ?% j else inc A_i by 1) I9 }. ]: _& O* |
end
# S \, s( J; X/ eend/ k& B# M' p+ z8 n3 j; s
) i% C. D/ l7 @9 J5 tbegin P_pick2 arriving
0 }* U4 k) ?! B, I set A_i to 11! u3 z& s* X: K5 I4 q. M7 r& ?" j2 ]% ?
move into Q_induct2% x1 j- J% C+ {( I5 u
move into pickaisle.induct21 [1 S* w2 x* N, e
while A_i<=30 do begin
& N# o2 E/ W ?2 g travel to pickaisle.con(A_i)
+ ]" C% W5 Q; }9 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- L2 D! ?- o8 f1 Z
else wait for 10 sec4 ]# N1 `/ E; a4 E, G7 E
if A_i=A_leave then send to die m, q7 N8 F0 O' P* ~4 R1 u: }
else inc A_i by 1, G* Q# O$ z1 z ^+ y
end6 J6 ]1 B" \8 o8 b9 T
end. [7 p2 K$ [) P+ C8 B# D
3 \8 Q* u. k1 N1 z+ o0 {9 G- ]0 x
begin P_pick3 arriving5 D5 _& Z) _8 v j% M$ l! J7 c
set A_i to 21
) t) O& }, r( A$ }& g move into Q_induct3
" ^* `/ J* s6 k& Q move into pickaisle.induct3& K% X' N h1 [8 |3 k+ w
while A_i<=30 do begin2 N1 l# C! t R4 T1 ?: Y, M
travel to pickaisle.con(A_i)" F+ B1 C6 S' ]3 ^5 U
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 w3 j: M, [. c1 N( b7 B else wait for 10 sec) E! h$ G- h' Z
if A_i=A_leave then send to die
# ?8 @& X; A3 _( p# t. j: | u else inc A_i by 1. S8 @* i8 ~9 q0 {! ^0 H
end, V3 U3 r8 s6 G+ f' a6 g' X6 ?
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,其它按你的 ...
|