|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
q: t0 V0 T1 x, \& J% T U
# ?4 i$ w. p2 Z4 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中的数值,不知道会不会有什么不妥。
6 q9 u. Q4 V2 l2 \8 q* E1 R( c
0 x& J; O+ k6 a: H5 V/ r( K1 N, Zbegin P_read arriving
* `5 `/ l' q2 z* z7 F while 1=1 do begin' N9 ]& M% c- c' G/ ^
read A_tote from "data.txt" with delimiter "\n"
$ X2 O; c# Q+ @3 S& C3 U( b read A_time from "data.txt" with delimiter "\n"- h6 E* q+ W; u& F- w1 [: B
read A_leave from "data.txt" with delimiter "\n"
+ B0 B. o4 ~, K6 | read A_picks from "data.txt" with delimiter "\n"
% b9 g. D- H$ m7 l8 ? set load type to A_tote$ T. \6 @$ ^( J6 n P1 M* _ s
if A_tote="tote 1" then set A_induct to 1! f# \& _5 K1 F0 X7 C, w# O& m" p
else if A_tote="tote 2" then set A_induct to 26 ]# a8 X2 ~0 }* ]0 p
else set A_induct to 3
3 O& U! `0 R) k: h( B" a set A_i to 0
1 L) J7 Z: z3 A# X# w clone 1 load to P_induction
5 l1 O: ], d- |, B wait for A_time sec+ f. j, `2 |- _# s. ?) H, w( ?
end
, }6 p' z* L$ l1 ]" zend( K _; X C# l: L2 v$ O: i
- k) C& N) ^6 P3 A9 Lbegin P_induction arriving
6 ~4 F6 s) j$ x) `- w( D+ u; w# S if A_induct=1 then clone 1 load to P_pick1$ @0 L3 F# t: g8 b
else if A_induct=2 then clone 1 load to P_pick2
9 d7 [1 s4 P) ]+ ?) Q else clone 1 load to P_pick3- n6 p# ~5 b( i0 ?" h2 T
end
$ f5 Q* S7 f4 {1 q" [* K3 x# n. `9 H) w
begin P_pick1 arriving% l9 ?8 T$ x7 M, n; S0 K7 ]3 n
set A_i to 1
, K# p6 Y/ s; \0 c! d# w: V move into Q_induct1
2 {1 E1 L0 B0 K2 j6 t move into pickaisle.induct1
( f- h5 M t. q while A_i<=30 do begin
9 m3 _ W1 K1 i; w travel to pickaisle.con(A_i). @6 u2 c0 K* s3 K/ k+ c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec5 Z+ u% G; D' o; D7 o/ o# A
else wait for 10 sec: S4 Z A4 W( T4 x& `
if A_i=A_leave then send to die- p9 c; x- n2 m z: h
else inc A_i by 1
0 l; p9 v. u1 o y$ J# o& I end
6 m: A% y' C( [& Y9 \7 C; _% `end! p) R7 [& j8 \1 N7 O+ d7 s
4 Q" D# D! Y# |begin P_pick2 arriving
# s" P9 k) T) _( c# n set A_i to 11
) Z( r% w, o3 ?9 X, _6 X4 o move into Q_induct26 C: a' t3 c6 O! @ o% c
move into pickaisle.induct2
: i& u7 @) S/ a while A_i<=30 do begin
( C* K) W1 ?# _4 W1 \3 P travel to pickaisle.con(A_i)
5 G9 p, n" B6 }3 J* i, K1 D6 _1 R: f, F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# A. K$ J9 D6 p( i' L8 t
else wait for 10 sec
, W s- R3 |" E if A_i=A_leave then send to die
% U# p- ~4 Z' ^( [& a, k0 R* e else inc A_i by 1
% K+ r- v8 `8 b3 l. h9 o, W$ C end
, D. O! K4 u0 M; n1 u2 Pend
+ l! u3 ~# U5 k6 ~
$ {% k$ L% E8 g" Lbegin P_pick3 arriving0 o4 z9 I4 z& V6 ^" x8 y
set A_i to 21
/ `6 R/ o6 ~: `9 g9 @1 ] move into Q_induct3
, E2 l2 [: J9 N: T3 c move into pickaisle.induct3
! s( F! i @% p8 R7 n+ Q, a) n p while A_i<=30 do begin
* ~5 r' r" j) x! g# x! Y m% T travel to pickaisle.con(A_i)+ z* u E: z/ y; S) g: @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 `9 E; R/ ~, j$ K; v
else wait for 10 sec- h) Y: e1 z: t( a; u/ D
if A_i=A_leave then send to die
6 L0 }/ R5 G6 Y else inc A_i by 1
0 L' a4 Z" X3 O2 j4 s- }. {8 L% m end- a$ G0 x: Z* X. g. Y
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,其它按你的 ...
|