|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 |* m4 U* _- p/ n8 R1 ?8 u
' E k8 R8 l) @1 b
我的问题是,在每个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中的数值,不知道会不会有什么不妥。3 N& C6 f, S& z2 g& `
# k) m, T9 z- _. E l) d' h: H* `begin P_read arriving9 D; C' C% L i9 ?9 S6 G) f
while 1=1 do begin
' u+ [' D) l4 P read A_tote from "data.txt" with delimiter "\n"8 u+ C. S. J8 J: R- o n$ s6 E
read A_time from "data.txt" with delimiter "\n"
/ ` n; ^. `, h% `: } read A_leave from "data.txt" with delimiter "\n"
* w/ m" }5 g a) |1 C/ g, v read A_picks from "data.txt" with delimiter "\n", X% F8 `7 [* j0 N) K
set load type to A_tote% w" J- I# \1 J9 B
if A_tote="tote 1" then set A_induct to 17 ?" N7 z6 M% h; h5 P. b% S, v) b- k
else if A_tote="tote 2" then set A_induct to 2
/ F/ |* W* Q$ Q0 U" i5 d9 s8 I( t4 P else set A_induct to 3
7 }0 w! i/ u% x( S* o8 [) L set A_i to 06 E* B: u& O" a8 U* r# B/ S, }! t
clone 1 load to P_induction: E/ ?! Y& A( ?) y
wait for A_time sec
* j8 |, \' H7 t9 U& M, q end
- @7 h0 S, Y0 Q1 S2 `: j' U2 H- tend
7 o6 o, o# a; r; w3 D* ]2 I/ N( Z1 N3 o" d# d
begin P_induction arriving
7 e. d! F0 m/ s2 ~ if A_induct=1 then clone 1 load to P_pick14 p1 l0 l! o: e! q4 r+ R
else if A_induct=2 then clone 1 load to P_pick2
' B0 K$ t+ G+ n" F" B& I, ^ else clone 1 load to P_pick37 y' A" o8 F( f2 E. Q
end9 C, H7 D( d; B+ u
4 [6 E% m3 m7 t: A2 fbegin P_pick1 arriving/ o. o" `" f+ u- X
set A_i to 1. n; I* r8 m6 ]
move into Q_induct1
' P, B7 h; ?/ ~; B% q( F4 q$ ^; J move into pickaisle.induct19 Y- o( q8 r4 t6 \6 i: z P8 d
while A_i<=30 do begin
1 c6 P' H/ [" O+ s7 H( n travel to pickaisle.con(A_i)& q$ W7 f, H" u: t7 p: w
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ q1 m0 W! d% A9 W( C0 c' } else wait for 10 sec( p: P+ ~% M: c: q# l2 Y
if A_i=A_leave then send to die
% i: T( U$ w: b1 A$ Y4 O else inc A_i by 1
9 r. ^0 N/ c0 {* m& `/ j% P end
! Q( r5 V" x1 M. t, P$ S* Yend ^ t7 [$ [; K1 C# `' v
9 s4 w7 ]; Y8 v q7 v
begin P_pick2 arriving
6 w3 @+ B% Q' ^. J- ~3 {0 C set A_i to 11
) U( \2 \+ k9 e2 Z5 {2 T move into Q_induct2
" p+ a5 m' T8 N% s2 k* w) ] move into pickaisle.induct2
& [/ A! p! V+ S0 v. \ }* H2 v while A_i<=30 do begin, z, Y g1 F& f8 k$ r& ^% j( b- C
travel to pickaisle.con(A_i)1 L, S. F. M0 x% }
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: k. |1 s- X D9 o5 r% S else wait for 10 sec- C# V4 q4 u' }- `$ ?" `; ]
if A_i=A_leave then send to die
3 s! J6 C! I. z3 K8 D5 D4 w else inc A_i by 15 a" R# G6 q# s, g6 j& i! `+ Y
end# [8 Q/ M8 ^! B, {4 f" K1 B# I
end
2 x) k/ `% v7 H: v+ P& l- W; v
2 G# a9 P$ F5 C4 f: d% I% }. Y7 Lbegin P_pick3 arriving
5 v! X" O- N+ a9 t set A_i to 21
- I4 }$ f- Z, V* l) R0 P move into Q_induct3+ u; l. y% ?4 Z7 h
move into pickaisle.induct3
2 O! {" M: C. N+ C9 v while A_i<=30 do begin
+ ?4 z* F8 a7 d) | travel to pickaisle.con(A_i)
( i% I) K8 H% q; W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 t& L( F. ?# K4 v
else wait for 10 sec! ~ p% ^! F/ z6 n9 D' I
if A_i=A_leave then send to die
8 H# y' V- [, V/ B; W else inc A_i by 1: P; T; K7 g1 D |- y0 z
end- e9 a7 h$ v: p; Y1 e
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,其它按你的 ...
|