|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢 B! `& w( h% l
: o7 s/ A& r; U5 N8 l, Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ o/ d0 H* ]. {/ G- G. ], q1 s9 M4 y& m- Q3 o/ k' |
begin P_read arriving
) N. s' Q: B( O) ^2 J while 1=1 do begin
3 ?3 S% t2 ]* y- ]- b; i' w read A_tote from "data.txt" with delimiter "\n"
5 ^/ {9 F5 Q! ~# t& h" X read A_time from "data.txt" with delimiter "\n"
! k$ Z' ^3 ~" ~) z read A_leave from "data.txt" with delimiter "\n"5 q' A$ _0 o# d% L% r& v
read A_picks from "data.txt" with delimiter "\n"
- d( R2 }, V- J set load type to A_tote. b! @! g% V8 r9 `+ n, A
if A_tote="tote 1" then set A_induct to 1
$ D9 Y& u+ |" F% P+ A' P+ | else if A_tote="tote 2" then set A_induct to 21 p6 }5 r# } B7 G. J$ \3 n
else set A_induct to 3 & h/ A0 a% o$ _, ?$ ?
set A_i to 0) [% o& h- I$ h$ W$ E0 B
clone 1 load to P_induction
2 p- L5 Z4 h$ t* ?8 ^- f6 L: P; ` wait for A_time sec/ l M# B, s z6 [
end
" M* d V4 a/ j; h# |9 gend
' [/ i" ^% x2 N0 }0 T* v' I4 f+ }& Y5 G8 O5 N* f
begin P_induction arriving
" |* u: U- c/ r$ t if A_induct=1 then clone 1 load to P_pick13 a' u c' w; D" Z1 C, p
else if A_induct=2 then clone 1 load to P_pick2: E3 K v5 M* X0 N& W- p
else clone 1 load to P_pick3+ i; u9 y3 o- A6 w+ P) T: F/ K* `+ ^
end; \0 }( Z* B1 `6 ?
% F8 b* u, @. Rbegin P_pick1 arriving: {3 G7 u( D$ L; r. e6 @ o0 R
set A_i to 1. @5 d9 X! C1 r8 C) N/ ^% \5 u( e$ Z
move into Q_induct1. ]! v3 ~& S7 c& T: b; l' \& b
move into pickaisle.induct1
- A- A8 }, O1 t7 U- L while A_i<=30 do begin# _8 e- L! t7 t+ v* N) @
travel to pickaisle.con(A_i)6 h. k# P6 G2 ?+ [8 v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& }+ X/ u) E$ R6 q) ?3 ]
else wait for 10 sec+ V, b+ I/ s; i0 I8 ~) l. @
if A_i=A_leave then send to die5 Y. s, C' i) l P
else inc A_i by 1
1 p3 w/ L+ q: A end
2 v9 q5 \1 j9 l# ^% Wend5 ?% M( K: y$ Z
- ]& f3 q$ J) T$ Fbegin P_pick2 arriving
6 C/ E7 F# l9 H set A_i to 114 |/ d8 B* ?5 ]2 p* T3 |3 {( E
move into Q_induct2
5 a' K( M* C' N O" C. r. W move into pickaisle.induct2! _' u7 V' C4 D
while A_i<=30 do begin
& D! x& S/ U+ C, L travel to pickaisle.con(A_i)
, |* }9 v5 h4 Z/ C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) P x6 J0 p6 G9 D+ H d else wait for 10 sec
0 B. |: t2 b$ g" Y5 A5 h if A_i=A_leave then send to die; ]) D/ t! H2 A* a% k
else inc A_i by 1
/ d( C. m F% E) I! M end
& B9 Y: @3 q7 send7 }6 Z7 L9 x( d5 w) z
}2 P, d: t$ c5 M7 F* E, F2 h& ?begin P_pick3 arriving
, N, G0 i) ~! [/ J set A_i to 21
+ G, N2 p# |8 [2 f! N% `( R move into Q_induct3
# K7 v2 s. R4 F" K move into pickaisle.induct3 l, R6 w, `# D$ B5 C- |: I t
while A_i<=30 do begin0 M" {5 t1 o1 g) h! ^, A/ U; i
travel to pickaisle.con(A_i)
& q u1 U9 J, B" H% G/ j6 ^. o3 E- S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! J: @5 m' S- r* Y* b: P else wait for 10 sec
& s r3 c* u8 y if A_i=A_leave then send to die
( P; k; S2 `: r. Q) j8 R else inc A_i by 15 o! q. \' k% o7 h
end
% C' T9 L* C# p; V. k' fend |
最佳答案
查看完整内容
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,其它按你的 ...
|