|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 E4 M! e" ~( \# u" n: U3 N0 `: ]( z: N% J7 f" a* l* u8 y
我的问题是,在每个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中的数值,不知道会不会有什么不妥。( d% x3 c- x& f
+ m4 C* k0 x, g4 K g
begin P_read arriving/ ]; [% Z* ?8 K
while 1=1 do begin6 d' B! m% ?( s
read A_tote from "data.txt" with delimiter "\n"4 `( d* V% y7 `% o4 H6 m
read A_time from "data.txt" with delimiter "\n"/ S& R1 W: B! s1 C5 [0 H1 U$ ~
read A_leave from "data.txt" with delimiter "\n"
, p! h1 {( Z \9 c" s read A_picks from "data.txt" with delimiter "\n"8 S- d1 `6 z+ h+ n( y1 S
set load type to A_tote! q: l% W( \/ t8 T
if A_tote="tote 1" then set A_induct to 1
+ G: p9 @& u# |# |5 t% b J else if A_tote="tote 2" then set A_induct to 2
3 H% n0 J& A l3 g a- R else set A_induct to 3 ; U& u! T* ?7 e
set A_i to 0+ v8 }' h J1 f- {3 h
clone 1 load to P_induction" p' ~ P$ O6 Q
wait for A_time sec# I4 O- x$ p. s% A
end! F7 D+ S8 Z3 L
end' l! b4 v3 a0 q+ V; I* E- [
% m; H$ a1 L$ Q( ^1 X9 `begin P_induction arriving
+ r8 I" I2 Q( _3 s if A_induct=1 then clone 1 load to P_pick1+ R5 q+ v8 c0 j# p6 s; x9 V
else if A_induct=2 then clone 1 load to P_pick2
+ t6 h. s! Q& Q* }8 z4 e) c else clone 1 load to P_pick3* P5 ?( m) Y* @- M+ T0 `1 f
end
1 o$ S0 k4 x& p' z9 X% p, e. l. T4 t3 a4 {* j6 Y( e4 Q( u
begin P_pick1 arriving
# |5 x3 {. ~# ]0 a/ [ set A_i to 1
$ @) k9 l$ v* }! r+ K move into Q_induct18 H7 a& u: E0 f5 D
move into pickaisle.induct1' o1 z9 R* ?1 T3 l' [9 W2 I
while A_i<=30 do begin
0 r7 _! J- X7 n travel to pickaisle.con(A_i)
% C% L3 m; _, v( I7 I* \0 q0 T& k if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( i- p ^1 K$ c( { f! Q, ] else wait for 10 sec# |9 h& ?* n( ]% U1 _
if A_i=A_leave then send to die
$ y& \/ ^) D4 |& _. J8 I7 J& T$ f) y else inc A_i by 1# B7 Y$ K* U6 y; u" O/ L
end
8 ]8 A; N$ _7 ^ P' A9 {: @end
5 G& @& k2 m, Q
2 X$ `+ l% n( E3 s6 `begin P_pick2 arriving. k! Y/ {6 x( `+ H% l
set A_i to 11
6 W. Y' i, F# f( w# d Y! M move into Q_induct2
2 G9 a6 H$ L D8 H9 h move into pickaisle.induct2* h% h5 o* w( ~6 D/ W: s
while A_i<=30 do begin
$ A0 R w7 |( _$ r1 T7 r1 @ travel to pickaisle.con(A_i); l+ z4 [2 F8 x) j- f9 |7 a
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec N$ Y5 h! M, i! b% g. q
else wait for 10 sec8 `9 X9 w3 n; ^# x" E
if A_i=A_leave then send to die! o8 c9 s1 ^+ t
else inc A_i by 1, v- e( `8 `; a* k
end
* i( [% Z, l% U0 A9 w; |end. ~, d. R3 c' ^7 H: D' y6 z
6 [: a0 Z! E' y2 T0 o2 Xbegin P_pick3 arriving
2 c7 z2 I& {1 y/ y8 T5 y i0 |2 ` set A_i to 21! ]4 }4 a/ r8 F; p5 ]* d
move into Q_induct34 u! z T- o q T2 _1 {& f) J! t
move into pickaisle.induct39 I- O2 \: t" Q5 |4 o
while A_i<=30 do begin
: R6 S; V& V( h4 N travel to pickaisle.con(A_i)- ~" Y8 P2 p2 B( i3 p2 p& y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 m* f( d( }; k9 _$ | else wait for 10 sec
/ B1 S$ a* ]2 @ T9 Q if A_i=A_leave then send to die4 ?* p4 H* ] Q! m/ t" s
else inc A_i by 1
+ r1 W- n2 ]( a0 a5 @1 u9 X end; _+ {: s- F) Z4 o$ S: W
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,其它按你的 ...
|