|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ S9 b3 }; B$ ^! w* E( s& r( }
8 {9 u9 g+ Y8 v/ f$ p9 Y. Q! Q8 x我的问题是,在每个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中的数值,不知道会不会有什么不妥。
/ c0 r1 X; ?+ q# R0 u4 _
6 n, j/ |/ n$ o, F# Mbegin P_read arriving- H6 ?- D; B4 B- x. B+ F$ f
while 1=1 do begin
1 n9 ?- [& R. Y read A_tote from "data.txt" with delimiter "\n"
% r& J7 D: N" H& U" J1 K% U read A_time from "data.txt" with delimiter "\n") R" Z2 y6 P# [) H. N5 ]9 {# ?
read A_leave from "data.txt" with delimiter "\n"
/ J0 l- Y( ^2 P x$ z8 E) z read A_picks from "data.txt" with delimiter "\n"
3 ]* e! Z, P. g Y4 `3 B, t set load type to A_tote1 _, z3 B8 Z4 y
if A_tote="tote 1" then set A_induct to 1
! A# z! n) `2 |* { @! T0 o else if A_tote="tote 2" then set A_induct to 2# O& _9 L# O( S& K) H, D
else set A_induct to 3
, f/ l4 E" G* b set A_i to 0+ J/ O4 _1 C0 c7 ~- c/ Z
clone 1 load to P_induction
0 B5 P! G4 {: H: j& G( m wait for A_time sec. v0 H, w, D( S% a
end$ i3 b% \) e1 |0 H% D
end
" g" k# ^1 J @7 X1 j+ ^) V M, c& F( h
begin P_induction arriving
- a9 h' b* I, n- \( Z, b if A_induct=1 then clone 1 load to P_pick1$ a1 b7 X" F' S# k2 G% F
else if A_induct=2 then clone 1 load to P_pick25 Y; d9 q) l% F6 Y
else clone 1 load to P_pick3; \ P7 f0 w5 A" I) Q" Q& p
end
. \, T/ T4 {, d1 l/ `) V# u1 _& o, D$ D& F4 Q, \ P
begin P_pick1 arriving( O1 S# k2 C3 u6 ~" F3 V6 ^ R
set A_i to 1- ?; Z" H0 m7 P# t5 l8 h3 G6 L
move into Q_induct1
! I2 G9 a% q' y( A move into pickaisle.induct1
: z2 h0 P& ~3 _" O' I! X while A_i<=30 do begin0 U' }/ a }* J7 d `% K. j- G
travel to pickaisle.con(A_i)
6 t$ R8 C4 \" k) S% T! W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
j' k# W1 x* E5 T6 J( r3 a" ^ else wait for 10 sec
4 e0 P; E" k5 @8 b' q& N' D if A_i=A_leave then send to die2 U& k/ ]$ [4 q2 K
else inc A_i by 1
/ }- a4 V8 F3 T$ _+ S end9 j7 U1 L) y1 C
end5 n) h; V* Y& N
+ M5 l4 E* n q) z2 z2 @begin P_pick2 arriving
2 L# {0 ^0 D7 P2 ?3 i. d+ _ set A_i to 11
7 M$ R) l8 o% J7 ^ move into Q_induct2- X0 P5 K: ?" H( X, o. w
move into pickaisle.induct2
, S) ^" J6 V+ p2 v while A_i<=30 do begin* V, {" v8 R' e1 b
travel to pickaisle.con(A_i)3 R7 l2 D# j" p8 G) q0 W4 U! ~
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: h8 R5 h* J. }$ \; @ else wait for 10 sec- E0 k! p7 b) g) b1 t
if A_i=A_leave then send to die
6 |0 u; i* [/ I9 A& F" S7 Z( q4 Q else inc A_i by 1" T$ @# P/ s* `0 X
end( L3 m2 W! y+ S; M
end
4 T* h, m9 A* Y; A; H# u! R3 v# U2 L9 p$ u
begin P_pick3 arriving, G: A& J9 c6 j8 Y) X
set A_i to 21
' o7 {$ h) g, f move into Q_induct36 D! D( l: F$ m
move into pickaisle.induct3
1 l- L& h, R" s# |9 R while A_i<=30 do begin" ?0 M3 U, r# j H
travel to pickaisle.con(A_i)
& i2 ]( a! v5 |. U; d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
; j4 E% R+ H& o9 G7 G else wait for 10 sec
4 N6 d% k7 H" V, T if A_i=A_leave then send to die
" _9 i5 Y+ k# O+ b( f- O2 H0 W+ g else inc A_i by 12 L* O& f0 y$ L
end
* r1 C9 V" n' o" ]$ 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,其它按你的 ...
|