|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
5 X6 f) k- k% Q( A) ~7 S4 a& k" R% o0 n3 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。6 ]! M9 i. w# h. z3 r9 G2 y5 Z5 R6 B
0 h# L( X/ k! Q: h' `2 O+ e; g% {begin P_read arriving
5 H" e% O6 Y' S+ R: g while 1=1 do begin: m$ J5 w* }7 ]) R D) @0 E
read A_tote from "data.txt" with delimiter "\n"7 j* Q" e3 L1 L( w
read A_time from "data.txt" with delimiter "\n"
& [7 `8 b# C1 W& f4 T @6 ]; i read A_leave from "data.txt" with delimiter "\n"
+ S0 W4 ~6 U# S2 ^ read A_picks from "data.txt" with delimiter "\n"$ f! s: m) c0 O- j K3 k' Z3 R
set load type to A_tote* \/ L3 a4 F- T4 @. [8 c
if A_tote="tote 1" then set A_induct to 1
! L3 K6 @5 w6 O3 K4 p else if A_tote="tote 2" then set A_induct to 2. J( k+ k z1 Q' N. D
else set A_induct to 3 & {; i, C7 S1 f& o- K# Z/ H! v9 f
set A_i to 03 ]) W& F' G9 U9 ?9 Z6 v
clone 1 load to P_induction
) B% H& R7 E( n; J8 I! M3 v# l wait for A_time sec
- O) {9 \: _6 R6 H3 h3 c7 o7 l end' \; O4 r B5 d+ [$ U; C* ~! n( g
end* H' a, B4 d+ y5 o% c2 S- y2 d
' y2 g9 @( _+ x5 f6 t! Pbegin P_induction arriving
' P( Z" D3 a# {/ m6 {. b- w if A_induct=1 then clone 1 load to P_pick12 U# f* R* a7 ~* Z
else if A_induct=2 then clone 1 load to P_pick2
* Y2 ^, N( q- A1 t; l! W, g9 l. z else clone 1 load to P_pick3
, i7 c( u/ R, i& }end6 s1 a. W: Z; M- K: t
. D6 W- e% b' W# m9 i, pbegin P_pick1 arriving: H4 R9 S5 I, P
set A_i to 1
# V+ Q) k- W) ?0 u4 @* S; K+ w* M; [" ] move into Q_induct1
) p+ n" z: A3 y move into pickaisle.induct1
6 ^/ U9 w e- ^. X9 L while A_i<=30 do begin
. d+ s3 q' j5 I travel to pickaisle.con(A_i)
Z2 d# V. U v# b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ _- ], P+ t' E2 F1 j& R) E
else wait for 10 sec
- J$ I; B- _' b) H( D if A_i=A_leave then send to die
' f7 g8 U- H2 W1 M9 U else inc A_i by 1; t1 `+ x% ~8 Y2 q; J
end/ _! K6 r) q* D' d+ o
end
7 p0 w" K4 Z: T) R
' u$ W5 ]) f8 G% hbegin P_pick2 arriving
5 ?$ J9 N4 J. g) K. E+ o, i set A_i to 11, @# N& \0 z' [3 u
move into Q_induct2
0 h( h8 u9 @$ f1 K move into pickaisle.induct2 ]$ N C/ l2 L) F
while A_i<=30 do begin, S8 y9 o$ b5 c; e4 L. V: X8 R
travel to pickaisle.con(A_i)
; ^' `( k. v& [7 u if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ ^% _4 n, a7 D: Z% A else wait for 10 sec; S, o( ~1 ]: C/ [$ m
if A_i=A_leave then send to die- X! z+ z. p% i
else inc A_i by 1
+ I1 l: X K% b3 R: ^ end# B B7 r( b$ E, a
end
3 X& i2 U! r6 X2 o3 f
2 c; ^) y3 `2 F. `begin P_pick3 arriving
- f+ _ L: m# d+ O/ }* v# W set A_i to 21! z) m# L* ^' M
move into Q_induct3
* C1 j. Q+ e/ P+ d9 X, v- ` move into pickaisle.induct3
8 V, _& t1 W' a6 O. H) x while A_i<=30 do begin
: R3 `2 Q- F. X0 w travel to pickaisle.con(A_i)
2 Q5 g4 N D2 F& @) T if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; v% O) B0 F9 `1 e% x else wait for 10 sec/ _9 E# _* Z) I `# R
if A_i=A_leave then send to die
L1 Y% o# d! b4 E3 e% | else inc A_i by 11 v2 m* C. h" V- e0 D( C3 Y
end
4 ` I+ c3 X" k$ w3 U: @ {$ q% }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,其它按你的 ...
|