|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
, K5 E0 d1 F' f" [! ]+ a. A% V) W2 M% _- y! r: }7 m6 Q$ w: M
我的问题是,在每个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中的数值,不知道会不会有什么不妥。' l1 D. E# p0 M; t4 h, Y
2 r9 @4 y& ]6 {: m1 ~1 {
begin P_read arriving3 O+ Q: \0 `: w+ U8 Q8 `# N
while 1=1 do begin* H, `* J2 s' b- C j& e
read A_tote from "data.txt" with delimiter "\n"
% l3 S3 b0 R) f9 |6 W read A_time from "data.txt" with delimiter "\n"
. j; S: x' J# j2 e4 w9 [7 e read A_leave from "data.txt" with delimiter "\n"& I: w6 b) B, I
read A_picks from "data.txt" with delimiter "\n"6 S' l, Y7 g) q7 I
set load type to A_tote8 u9 Y5 L& j5 N! V
if A_tote="tote 1" then set A_induct to 1+ q5 G# x8 T* O" G* e" n
else if A_tote="tote 2" then set A_induct to 27 j5 g' d% C# O& `; ?1 d
else set A_induct to 3
9 P/ Y8 U% Z7 V) V set A_i to 0
6 Z* R, @8 M+ X, [5 r$ b% S( { clone 1 load to P_induction2 t7 L5 \, O5 e" [3 Z
wait for A_time sec
/ h8 a0 ?$ _" r z3 a end
) a0 N: P/ J Y& f/ uend
# r1 H+ S& x G
/ j& N9 m( _3 @begin P_induction arriving6 r; z1 X6 J7 |+ t+ ?% s
if A_induct=1 then clone 1 load to P_pick1
5 x8 B0 q6 ^* {: |. d3 V( k else if A_induct=2 then clone 1 load to P_pick2
) b: m+ P7 a& H else clone 1 load to P_pick34 e4 m( ^. q) }; j
end0 K$ Q: } |! |" x$ D! X7 c- r
7 C( ?- r1 n" Y h, O
begin P_pick1 arriving
) n3 u% _# A$ Y; H6 w set A_i to 1! r$ c/ x$ u$ i( G+ v7 G
move into Q_induct10 g6 v2 c% _ u* J
move into pickaisle.induct1% W% y, m- E0 z5 U/ m% o
while A_i<=30 do begin
: \; T; g7 F* |# J! C travel to pickaisle.con(A_i)
( F- b' A- E! F9 b8 | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* h" t; q6 d* P, C. v: ^
else wait for 10 sec
6 y' `2 J- E/ P8 g" D& C" N if A_i=A_leave then send to die; [/ I( j0 N6 q
else inc A_i by 1; v9 H1 @/ t" w( H5 L3 R4 N8 {8 k" t
end
& b1 r' X( J" _, Q6 U- N- Rend9 }, X; E# ^( z* \) P
2 ]" z, S7 N5 h4 p! s( `begin P_pick2 arriving+ D/ ?) v: {9 K: ^ l* j3 o
set A_i to 11: r e( W( L: G" ~
move into Q_induct2
1 Z: d& }4 ]/ l# e; a move into pickaisle.induct2
% {6 Y3 Z r0 n6 U; J" Z while A_i<=30 do begin. L7 T0 }' T N
travel to pickaisle.con(A_i)
1 ~3 I* ]5 z0 v9 a if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! V2 f; s# g& t( C+ y. a" y. j
else wait for 10 sec# T$ \* |9 U+ [4 E4 P
if A_i=A_leave then send to die2 C+ Y: v" h2 k6 k7 q: t4 ]
else inc A_i by 1
* L* d" }) D8 C0 \+ Z end
) x" U7 I# B5 `, W6 Y) wend& W/ E* E- L5 p4 i& X
1 I7 j+ k0 r: r; \" n! x+ L# x5 fbegin P_pick3 arriving' N4 {$ b" C( `. @2 Q$ h
set A_i to 21# K- R5 ~8 K/ {6 t. e
move into Q_induct3( X3 ]7 ^* m8 S ]7 w& x; m6 C3 ~3 p
move into pickaisle.induct3( Z1 t4 w, Z4 W% [2 W/ O5 W5 a; [
while A_i<=30 do begin4 k- J3 {3 ?8 j7 T+ G
travel to pickaisle.con(A_i)3 h: H0 G& D( a9 q+ ]. s
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' c3 Z0 |+ F7 |4 B
else wait for 10 sec, U7 A: A% i1 f
if A_i=A_leave then send to die. T# `* x- D% _6 x- j
else inc A_i by 15 a6 I: |5 l3 J4 Z. o
end% Y) j1 ]% w- n8 Y& Y+ I5 {
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,其它按你的 ...
|