|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢2 j. c; d+ D% \
/ f" r/ P8 x P/ L1 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中的数值,不知道会不会有什么不妥。
$ n% d2 Q+ T; U F( h+ ` Q* m: b" s$ F4 O6 r+ M
begin P_read arriving u5 u" }" H4 B2 B" q( d- Q
while 1=1 do begin
1 Z. X1 u( n9 k' p, d% } read A_tote from "data.txt" with delimiter "\n", [4 E7 u3 R! k/ C; A( @7 g
read A_time from "data.txt" with delimiter "\n"
3 q2 {. J" A6 H/ \# t; Z p read A_leave from "data.txt" with delimiter "\n"2 f" K5 K( T( d% R3 S
read A_picks from "data.txt" with delimiter "\n"
4 W1 D0 h1 \& f/ N6 o9 Z- y* ? set load type to A_tote
9 ~! V/ ~; `8 C( w if A_tote="tote 1" then set A_induct to 1
% P/ H1 ]) _- p! o+ h else if A_tote="tote 2" then set A_induct to 2
) r1 T) o7 [& B, e. M3 } else set A_induct to 3 . B5 O5 H$ g0 G+ m K: y
set A_i to 0 j9 t' C; Z. w' }8 p$ {
clone 1 load to P_induction
* t2 ?$ U4 I% _. d2 a* b R* Q wait for A_time sec
7 z9 p. {2 ]# z: J& J end- a/ H4 f6 G, U/ D5 g5 A
end
; T, p n% H! C3 q+ e, L
. G+ S' {5 `: N" H6 s9 Tbegin P_induction arriving
1 w5 m: [! f# K- w& j0 T2 S( v% H if A_induct=1 then clone 1 load to P_pick1- g7 \1 p) C9 W0 t
else if A_induct=2 then clone 1 load to P_pick2) K+ V+ O1 c# L
else clone 1 load to P_pick3+ F) w! D; J( h: X! I% b
end
+ R- \5 F' [9 u" M: @6 z4 g1 Z* m& L0 h
begin P_pick1 arriving
! D9 z4 F" B8 z; s6 Z set A_i to 17 ~, g1 w/ S6 a- \" d$ U: U
move into Q_induct1 q+ k+ l( ?- x( T7 K
move into pickaisle.induct1
# Y+ m! a0 [5 C/ h+ ]% b' a) l3 y& k K while A_i<=30 do begin
3 |5 H6 T A0 o) Q# e5 K9 l9 z travel to pickaisle.con(A_i)4 r0 h1 x& D* Z& {* c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, j: U: a5 V! N( q% @
else wait for 10 sec, g% B: h8 v1 K' R! q: ?
if A_i=A_leave then send to die
/ ?7 Y9 ]4 n! C7 ^2 N% U else inc A_i by 1
$ O" ^7 p; M% I% y3 z end+ ?$ b( i+ b" E, M. w
end9 F+ R7 Q5 Q; Z, O5 G
3 y7 D" m- ?: _6 D4 ^. a
begin P_pick2 arriving
9 @$ [7 n1 x4 @: T* F+ ] b) w set A_i to 11
R4 I+ r: W/ d" S) ` move into Q_induct2
9 _( R, s' [1 b0 J move into pickaisle.induct2
3 U$ F/ U! g4 k8 u while A_i<=30 do begin2 w( |+ s4 ?, t# H
travel to pickaisle.con(A_i)$ c: _" k7 m2 C7 {6 j7 x9 m2 | N
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec! J& @+ M M: O5 h
else wait for 10 sec
8 f0 f7 [1 T5 q6 F% _' v if A_i=A_leave then send to die7 ]2 ]4 d" h+ j" M8 G8 R
else inc A_i by 1
% L9 Q, h4 ]$ ^3 T end
3 [; t) W" ^; |0 i4 P+ k: tend* c L( C. J% ]' k3 R
, `! H2 M- o5 d4 fbegin P_pick3 arriving m( k' e) i4 Y, \5 B/ v4 H5 L2 J
set A_i to 21- O1 A D( a- ]; u/ W7 K
move into Q_induct3
+ _$ V9 w$ }2 s4 F move into pickaisle.induct3$ U) n3 `. C6 c* l3 S
while A_i<=30 do begin
4 ^% K7 q4 w; D/ w" S* P/ [* { travel to pickaisle.con(A_i)6 \7 c3 b+ F2 t/ ]) v2 \& d
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: R' h# T4 `6 `( N. S else wait for 10 sec
/ q6 d. T3 w9 H' t; m if A_i=A_leave then send to die( ~# O' D; E0 G8 k# u- z! L
else inc A_i by 1* P2 C, ~) f5 h) O1 _* e( P0 q/ k
end
% s. {+ Q; C( P3 y( j ^. Qend |
最佳答案
查看完整内容
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,其它按你的 ...
|