|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢. ]/ W) z3 u5 q% S% h% l6 I
! u6 _9 R# d/ s K$ ^$ N3 C
我的问题是,在每个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中的数值,不知道会不会有什么不妥。+ o3 G6 A; g7 R N8 ^
5 O& P; W4 b2 A+ T+ N9 }
begin P_read arriving% }3 q Q4 {7 G0 v( J4 d
while 1=1 do begin
[8 Q$ F5 m* i0 S read A_tote from "data.txt" with delimiter "\n"
5 D2 P! G5 T) [( Y read A_time from "data.txt" with delimiter "\n". A. g% m0 q" M5 ^# _. u
read A_leave from "data.txt" with delimiter "\n"
$ E, U b. |: J. A @9 y read A_picks from "data.txt" with delimiter "\n"0 y; ^8 X/ T8 F/ l$ S
set load type to A_tote
1 f r/ n3 O# c# v if A_tote="tote 1" then set A_induct to 1+ \2 v# ]0 B5 b" ]+ }; z
else if A_tote="tote 2" then set A_induct to 2
5 [" N0 ]* ~7 V8 S else set A_induct to 3
+ d- j, f! }& P, J9 z set A_i to 0: }! y1 M5 b3 N0 Z. Z0 h! @
clone 1 load to P_induction8 g4 N4 x9 P# {
wait for A_time sec
0 g6 @& p& F3 P: S# c i" k end. C( v( H# u/ l5 M
end
' _' `% i5 i/ i5 o$ ^( z4 g. `$ k' a4 d: Z* h$ j
begin P_induction arriving5 E3 V7 W) H0 q z$ G
if A_induct=1 then clone 1 load to P_pick14 M4 I* g4 s Z
else if A_induct=2 then clone 1 load to P_pick2
! e0 C8 c6 ~5 s$ m7 H E else clone 1 load to P_pick33 q" l7 I9 j& l* l" ~7 f0 ]% ^
end/ h3 b7 I" ~# {8 v
4 i/ m% r# X6 `begin P_pick1 arriving
. |, S6 M! h$ T1 E3 [' ~, G% ? set A_i to 1( J% E) S( @: R" V3 B+ }
move into Q_induct1
$ E" P) I; {, k7 v+ f- R: c move into pickaisle.induct16 G( ]$ u7 c w3 G; X0 x. ?* a" E! p
while A_i<=30 do begin
9 ^6 t( Z& K+ G6 g: ] travel to pickaisle.con(A_i)! g3 r% j0 m6 ]6 H! T) m1 z d0 z7 \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ [( N+ u8 U# ^0 ]) d0 W else wait for 10 sec
7 U! @$ f' Q( Z. E4 l" Y if A_i=A_leave then send to die
7 }2 q6 p2 Y/ N else inc A_i by 1, o2 Y9 ]3 f) r0 i; ?7 u( n
end
& G1 n7 ~% s, G2 h& l1 Tend9 x" H# d0 U# ?2 a; p2 N
( J3 Y- H$ ?0 w; H
begin P_pick2 arriving
5 z% ~. d" s+ h set A_i to 11' c1 p4 [$ J0 w- v! W8 V3 b
move into Q_induct2
5 G1 i7 d! c, h4 N3 q9 m9 ?, G+ ] move into pickaisle.induct2" u1 a! M0 K5 p
while A_i<=30 do begin
# G' n; c; `; a Q& r' D travel to pickaisle.con(A_i)
: t1 h# a+ R7 t' W. o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 z! H/ {7 P8 ]* V7 m+ A* v' r3 F; N else wait for 10 sec
' a5 R5 \3 D8 @7 S3 o) k+ P if A_i=A_leave then send to die# W6 {* k) @( s& I1 I" g8 Z
else inc A_i by 1# a3 Q4 E( n4 M; r
end
2 x3 Q, X3 J! ]* j( bend1 B* n l: G& Y
+ M: ]" `1 E* p& g6 ^0 W9 e6 ^* l4 J4 [
begin P_pick3 arriving
: P* Z* h O/ p a set A_i to 21, O1 ~# f+ d' i7 C* W( ^: o
move into Q_induct3
2 s1 f8 B9 C% b% u" L Y5 Y move into pickaisle.induct3
$ ^% Q! x: l8 Q3 U9 k while A_i<=30 do begin
8 h2 J; C' d m& a. U- y) }! T; R travel to pickaisle.con(A_i)
: ~( N- a9 |% ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 k0 T) S8 v4 L& e( L( S n else wait for 10 sec
: p; `) F0 ^9 |' d& v if A_i=A_leave then send to die
, ?, m1 G" X' ~) P else inc A_i by 11 o4 a7 A+ y( f9 O: U% e$ Z/ M1 G4 H
end
: @2 I& \- b. L2 \& j0 G* ^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,其它按你的 ...
|