|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ V# w( h5 h7 C9 V; S9 m
2 G9 M. A( P+ g8 _, L我的问题是,在每个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中的数值,不知道会不会有什么不妥。
0 H2 f# J! }4 m$ D+ S$ r$ C7 ?8 a2 c: t4 n# [( Y+ h* N( q
begin P_read arriving. O8 c+ L! F9 d q# C$ z
while 1=1 do begin# G8 n+ g3 Y4 q
read A_tote from "data.txt" with delimiter "\n"3 J/ _1 R; _) j* s" b
read A_time from "data.txt" with delimiter "\n"& L4 u9 j8 }7 H
read A_leave from "data.txt" with delimiter "\n"3 c( @, E3 w7 y' x
read A_picks from "data.txt" with delimiter "\n"' X' c( r: V# @# ?' Y
set load type to A_tote% }) N7 u" Q0 P" U; A" `
if A_tote="tote 1" then set A_induct to 1
) ?' M9 o2 l9 p6 A F1 } else if A_tote="tote 2" then set A_induct to 2
9 G6 B# f! \' V7 z else set A_induct to 3 ; j$ `; X+ R }
set A_i to 00 |2 g, P4 w; \4 H
clone 1 load to P_induction
9 p$ g& G" a( R6 ]; Z wait for A_time sec8 s' y0 v3 i7 k% T, `$ w
end8 Q" a8 D( d0 J; |. J' M! S
end% T) W1 a6 e9 D' g( m& H
5 _( s" T9 |3 L: _
begin P_induction arriving
/ c6 T) e, _2 y! ~0 Z if A_induct=1 then clone 1 load to P_pick1
1 R1 X' b' N. l1 m7 } u else if A_induct=2 then clone 1 load to P_pick2' L, h- z# s% K4 {9 _
else clone 1 load to P_pick3
: Y7 q' J9 W/ Q0 \7 x3 }end
$ P- R* Z( D7 v5 H4 E! b" ]" x- @7 d% J- c
' {5 ^- R" i T% J0 l( dbegin P_pick1 arriving
8 u P8 f! U8 J. l/ J2 s set A_i to 18 T( f; b0 u! t2 P9 G2 u; ]6 S
move into Q_induct1
9 X/ b. ^) H" R+ _0 \' B' I' O" } move into pickaisle.induct1' Z" ?5 \; S1 u3 x& a* f+ S
while A_i<=30 do begin
4 O5 f, v6 R1 n- q5 L# Q7 B travel to pickaisle.con(A_i)
+ |8 t9 H1 J1 w X2 n4 e2 _1 a1 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 f& X4 E! r. w- y3 E! \ else wait for 10 sec4 \" x% k* f1 \$ W1 K/ i
if A_i=A_leave then send to die* T* A- } Y' K( S. b L
else inc A_i by 1
_4 @- ~+ ^2 a7 @9 g, Y( d end
# W2 T0 X* z' h. Uend
6 ^, X) F5 R- M( J) P* o6 N; f: k' z. X( d7 |8 A8 Q; T
begin P_pick2 arriving
* j: n8 G$ q1 P# M- t* S. y; @ set A_i to 11
! z$ K+ E! C5 b/ v- z( D move into Q_induct2
& _$ C9 I% {( Q2 `( x$ U$ X move into pickaisle.induct2) b+ [6 C. U( m- ~) |
while A_i<=30 do begin- I/ Y+ y1 m& P, z3 y& u1 |
travel to pickaisle.con(A_i)
! i1 n; F# M, d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; b6 k$ V( X1 [0 Y
else wait for 10 sec
' q9 ]3 |! v# \: m7 D if A_i=A_leave then send to die& A# a4 a) G% @& z0 l: ?
else inc A_i by 1# u2 ]% T7 X! d8 H1 e3 \, G3 w
end+ Y2 |# j7 F' M1 ~
end
4 Y$ W3 V" b/ d. `
# ^/ h d ~" f1 obegin P_pick3 arriving
- y ]. Q5 g" p/ |$ N$ C set A_i to 21# @ Z8 O5 }0 M/ @ n; {
move into Q_induct3; ]' i8 n* P! l4 j
move into pickaisle.induct3
1 x" e7 y& ?% A5 J# R) Q. O while A_i<=30 do begin1 X+ r' Z7 b% t( M
travel to pickaisle.con(A_i)6 ?2 w7 `3 ^0 N/ E# ^! x/ ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ Y8 `' m# ] X' }, M
else wait for 10 sec
* X1 E1 Z b, S& }; \- l if A_i=A_leave then send to die1 n: G' @; v2 D9 c2 Q1 A2 N, |
else inc A_i by 1
( [* h" N, v0 S, s) T: l2 Y end
' N! W9 a3 B, y6 p& 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,其它按你的 ...
|