|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢) d6 b7 ~4 o4 [( c" }
. i- R+ Y( P% J# w0 l5 X9 L
我的问题是,在每个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中的数值,不知道会不会有什么不妥。, f. x' j# g) K# D
" y+ |2 l0 S% x# G2 `# _7 N+ Ubegin P_read arriving* ^/ A. X* l! t! J6 i9 |
while 1=1 do begin
4 w3 L& o4 r) G- S read A_tote from "data.txt" with delimiter "\n"
" W9 p, P! r$ b z read A_time from "data.txt" with delimiter "\n"
8 Y* o$ w6 }; b: O- a% f2 q( z: A# H read A_leave from "data.txt" with delimiter "\n"" y+ H$ R. d1 r3 y% D6 x
read A_picks from "data.txt" with delimiter "\n"8 G3 T( d8 u/ P% |5 S
set load type to A_tote n& U" u# P" @
if A_tote="tote 1" then set A_induct to 1
! O, V |& |2 F- l9 P4 x4 c4 B else if A_tote="tote 2" then set A_induct to 2
- G) h. I, c4 q: T p else set A_induct to 3
+ `% m* j" ], Q7 k& |- C! r# n7 Q set A_i to 0
7 W" J) I' h8 \# e7 d. j clone 1 load to P_induction
1 v$ B) e' t# S6 z7 H# n" \- m wait for A_time sec
8 F( Y% F* |! j end$ v7 p! K: S8 x0 g( F$ R
end3 y9 i; y# p. Y3 ]2 L! b; j a
! |, c: i4 j9 ]! i. h% }$ Nbegin P_induction arriving, ]: `( e5 E' w: C* M* B* ]$ p
if A_induct=1 then clone 1 load to P_pick14 B+ L8 _/ W, L: c$ Y( \
else if A_induct=2 then clone 1 load to P_pick2
( C5 j+ t7 b3 w8 _ else clone 1 load to P_pick30 `6 a: L5 S3 @! t! T4 a) ^
end
. r1 m+ W" p3 V: c. v( h
% r+ v% [+ B5 V2 Y- hbegin P_pick1 arriving) \; g5 [$ A$ S! ^+ ?
set A_i to 1, D& X% m c, f7 {
move into Q_induct10 x. v" Z' k: k) q' M: \: ]
move into pickaisle.induct1
" a) _0 J: U/ g' A while A_i<=30 do begin
. [+ U8 _. w+ w% ^) j! L9 r travel to pickaisle.con(A_i)+ J# q! @/ p9 X2 j. Y3 d9 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* P7 c4 V+ w+ `# u) @; J
else wait for 10 sec
! i+ e5 N& `" L8 P% F! @7 L/ ~ if A_i=A_leave then send to die
, v! c1 C8 t! z6 A+ {0 `' l else inc A_i by 1* {' ?. b) O7 F7 t7 T% x( w
end
5 v0 ^* b: S8 w- Z3 P* qend
3 c. g7 g! N# Y) j$ q6 I+ N4 K
" h6 s' E6 r4 R7 v$ [+ ^" pbegin P_pick2 arriving
# d+ F/ i# M( Z+ o0 x! ] set A_i to 11( N/ T9 E' B' W# M2 i( w. B2 w
move into Q_induct2
2 c# G4 G) K( N; t+ w6 e move into pickaisle.induct2, `, E% t# r3 L3 [1 R$ T2 u
while A_i<=30 do begin
4 g/ Q; R) }8 C7 D2 ` travel to pickaisle.con(A_i)
" C- s3 Q, T8 b2 M, [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 o3 \: N! u& y/ z* C& [7 j
else wait for 10 sec
1 u7 |, d) a5 H- [5 c! h) X0 ?, U if A_i=A_leave then send to die1 ?' o0 h5 ?/ Z+ M" [
else inc A_i by 15 X% h5 Q; ?% Q u( [- ?
end- e. M" N# Q; e- k
end
5 _6 L* ^- M: Y4 r( @, H' K6 A3 J5 Z k$ M" i, y& Z7 W
begin P_pick3 arriving
$ z. A/ P a% B$ U set A_i to 21
& T) }# W) S9 R8 {# i: h* L move into Q_induct3
" f) t6 G% F1 M. I1 N" q9 W9 i move into pickaisle.induct3$ P( O" Z: y' {, W' h) R& g
while A_i<=30 do begin
+ L% Z1 V7 l; E$ K travel to pickaisle.con(A_i)
' M0 w6 d3 ^/ ]! C' U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 a/ _/ u& r7 i U; N3 H d
else wait for 10 sec4 Y4 \4 _) m; c6 p2 ^2 V9 r! n6 {
if A_i=A_leave then send to die
4 q- n/ J3 E, R; Q* }1 I$ L else inc A_i by 1: J. d. ~. V- e- H4 B6 j+ Q
end
& O& Z, h; e1 g" g4 D; rend |
最佳答案
查看完整内容
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,其它按你的 ...
|