|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% u" {- l& d% S4 e" v9 T; a
& D6 a( v) W$ }& ^9 R* s5 e' F我的问题是,在每个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中的数值,不知道会不会有什么不妥。" T! ~( c5 B- {
# m4 U& h6 @* e; Ubegin P_read arriving1 P& q1 w) d4 N
while 1=1 do begin5 L! J9 E5 v0 v
read A_tote from "data.txt" with delimiter "\n"4 e2 D) Q9 n+ J, e6 _
read A_time from "data.txt" with delimiter "\n") t; Y: d5 y4 M7 s. f
read A_leave from "data.txt" with delimiter "\n"9 u+ S* E3 m& M' T
read A_picks from "data.txt" with delimiter "\n"
) v$ c5 w7 g7 I/ x set load type to A_tote8 i; y8 u5 D! b& f9 y
if A_tote="tote 1" then set A_induct to 1
2 a6 h% E, }' i1 o) c) E+ S else if A_tote="tote 2" then set A_induct to 2
7 ^- ]; D0 J0 M6 J3 F else set A_induct to 3
* ? x. n" l6 d& U$ t" | set A_i to 0
0 ^* g$ O8 k" e4 Y2 n7 d# _$ \ clone 1 load to P_induction
( M% M* c- |. A wait for A_time sec
, J/ ?% ?- d" j! g end0 ?: s/ p5 H9 ~% k6 `8 s* t+ |* b( c
end. e7 ^* A+ N% \4 \4 ^
0 Z7 f- g+ @' c
begin P_induction arriving
! t4 A5 L% `0 @3 A. ~ if A_induct=1 then clone 1 load to P_pick1
& Q1 B5 U& q, n- j else if A_induct=2 then clone 1 load to P_pick2, E) l5 x/ N- j: F! Y" \* J- n: Y
else clone 1 load to P_pick38 b& _6 I: t9 P
end/ b5 [9 m8 d* G2 \9 n* T: k
9 u1 E4 c0 l4 q j. x+ {begin P_pick1 arriving
( ^8 K+ ?1 q+ |$ W8 n set A_i to 1, j8 H L/ {/ g$ ~" c
move into Q_induct18 q; Q Z: t. V |# f
move into pickaisle.induct1
! ]. W" @: W2 Z while A_i<=30 do begin7 p: e/ |/ G) ]6 V
travel to pickaisle.con(A_i)
1 B5 t& d# s& {1 I# z: ` if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! u6 C& j; R9 D7 I/ u else wait for 10 sec
# x5 j* Q+ V% ?* x$ l0 }; @ if A_i=A_leave then send to die
' [% m4 ~, g! z J8 z. q& i else inc A_i by 11 [2 R/ U1 ?4 n0 _2 b% ?* y; V% x
end
8 B- o; e! D: z+ p1 Dend. W4 ^- c$ Q$ Q/ K. U3 D5 X! ?8 O
0 {) y8 K/ l# |1 f# Wbegin P_pick2 arriving
8 {; r2 Y* E7 ~; C: t0 b8 c. ` set A_i to 116 I$ Z/ }9 x! R/ T1 f" t8 z
move into Q_induct2
' G+ R7 F% ~* g+ T1 {& q move into pickaisle.induct2
3 v% [! v( `" ]' b while A_i<=30 do begin
, W# Z" J- }$ y% ?3 e travel to pickaisle.con(A_i)
- X' G/ \2 R o$ V) r if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, |5 Y5 v! o- `: P. b. { else wait for 10 sec/ e% k! \1 l! G/ I2 ]$ U
if A_i=A_leave then send to die
# S3 X" @/ D5 c; @. C; K else inc A_i by 1
% D' \. n$ n( h+ z8 u end, D% W7 b1 }2 ]% J& h
end# s, p, o- y& E' D) G( L
$ C3 {' N$ @. O9 `begin P_pick3 arriving; ~$ d- w9 I9 l6 q
set A_i to 213 t" F5 v1 @, w# r0 ^/ V! a R
move into Q_induct3
6 Y& }1 N- S! t- q% [" k3 U$ f7 O move into pickaisle.induct3
/ @5 m1 e8 t& j$ l; ?0 k+ g/ O while A_i<=30 do begin* N H" H; |) z
travel to pickaisle.con(A_i)6 b& i' l" r9 H( Q2 |% A+ i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec P, ?$ D' k& F& n( N8 Z( q e
else wait for 10 sec
& `* A/ O; _; l6 a- b e: J( F* [ if A_i=A_leave then send to die- B% V/ @/ N0 q( z* V
else inc A_i by 1/ j% r, o% ^1 ~1 E7 h2 F6 j4 D
end) G4 V# \. U5 ^& ^. S' D7 t
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,其它按你的 ...
|