|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* |, V i8 T }5 X, { S
+ M4 {4 M* Y! }' R! e% B8 i我的问题是,在每个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, t9 b( G0 d1 a9 s. k. P I2 u
$ y8 q; C, [' D+ s% Ibegin P_read arriving
- Q7 ~2 [/ T. g. z while 1=1 do begin
8 j; w5 ^: |. w w" m9 K read A_tote from "data.txt" with delimiter "\n"
6 X3 j" q; Y3 C read A_time from "data.txt" with delimiter "\n") ]( F8 g5 m9 x+ U
read A_leave from "data.txt" with delimiter "\n"
* J( ?7 h& v- Q% F. b$ P read A_picks from "data.txt" with delimiter "\n"
% [& u, y6 [( r; j# w set load type to A_tote
2 \2 ^- v& b" T- ~ if A_tote="tote 1" then set A_induct to 1
( y- K/ ]1 Q* Z5 a2 T else if A_tote="tote 2" then set A_induct to 24 z# ^4 W+ j& {9 i1 q% H2 k1 G
else set A_induct to 3 ( m$ k8 Q1 |8 t% s8 @; T/ |
set A_i to 0
8 g. N! h, T% @. K clone 1 load to P_induction
3 Y* L3 b( B, v2 `4 G1 h wait for A_time sec. V) b3 h1 n6 e s* R9 i2 c+ } b) l
end
$ H0 Z P) ?. P$ `end3 O ^% I* H5 C( T7 R9 @6 E
) I- R# K7 m3 ^; Zbegin P_induction arriving
% @9 s* r- X$ Z! | n- w% }( f if A_induct=1 then clone 1 load to P_pick11 g1 r8 R }% Q" ^9 R8 U
else if A_induct=2 then clone 1 load to P_pick2! @1 l! ~; h6 n0 o
else clone 1 load to P_pick3
% f- r, u/ T4 e" W+ Lend" T5 `2 q4 y, d4 x) Q b4 C+ f
; m: O, y. Y* M/ w
begin P_pick1 arriving
+ i4 Z& V1 i; R; L3 m set A_i to 1) t! f+ u4 o7 G% @
move into Q_induct1
; K, S* v. u v' }% ~ move into pickaisle.induct1/ d- Z# {4 w9 V" L5 F
while A_i<=30 do begin
7 Q* X- j# J* | travel to pickaisle.con(A_i), R- P' r$ @+ z7 s ?
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 W( V) ]$ ]9 { else wait for 10 sec
3 }- m V" t1 a) W! M; J; | if A_i=A_leave then send to die
) Z- s1 N E" `% V' q else inc A_i by 1
9 ^' S0 A" I, h4 y4 j end1 h0 g% o. L6 F0 \+ K! h
end' c9 U/ N( q! o; q4 P0 p; b
/ e! u7 F' v( Z u) }, |
begin P_pick2 arriving
1 }/ x5 S/ \ T( t set A_i to 113 T% c3 C" z% T& g( N
move into Q_induct2
: c2 G% y* b; D+ l H move into pickaisle.induct26 r8 {, q; j9 _. g# ]" N4 Q
while A_i<=30 do begin
- A! |, G9 `# W travel to pickaisle.con(A_i)) r6 y; C7 j8 \1 J9 `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec; v+ ?, D/ W" p' a
else wait for 10 sec) H% P2 S- I3 o# y# P
if A_i=A_leave then send to die
" X9 Z2 D6 G# v( T7 A- ` else inc A_i by 15 P C6 R6 G6 a8 R$ R
end
% \! X# }- u$ |7 \( I6 X. V8 ]end5 j4 V7 h$ c6 Q; Q* D5 a5 z* b. O
7 E* r ^/ V% ]& z' J: nbegin P_pick3 arriving
, `: J/ ^2 j7 @( g2 { set A_i to 21
9 e1 t- ?$ ]' d6 \1 ^ move into Q_induct3: J8 e! B) v! s
move into pickaisle.induct38 Z9 `2 o* S2 @- L. i0 w
while A_i<=30 do begin
" S- e$ {+ E& s+ L, B" l" {" k/ p: g travel to pickaisle.con(A_i)$ G3 ~$ L2 e* v% S3 B0 d# I" c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) X& E0 v& ~1 E else wait for 10 sec
1 @. o7 a M0 B+ Y" I s' e if A_i=A_leave then send to die
^. Q' m9 I8 B* m& S0 R8 t% P else inc A_i by 1. u/ d" ?: P( e) M7 a7 b
end
& V6 @5 Y- u) p3 bend |
最佳答案
查看完整内容
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,其它按你的 ...
|