|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ Q% v" Q" X9 { ^' Q4 c1 }
+ ^$ i$ n! @* I; o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
7 j# Q; C' D( t* t3 T0 W# k) E2 Y2 q) | ]
begin P_read arriving" Y& K" G0 L" _1 h; Y
while 1=1 do begin1 O! u9 |6 [# k5 b! ^3 K
read A_tote from "data.txt" with delimiter "\n": _2 i& i- ?$ {6 T$ {* a- X, i
read A_time from "data.txt" with delimiter "\n"
( x i) z' ], W' ^ read A_leave from "data.txt" with delimiter "\n"
, S4 X/ ~3 p4 v5 b( r read A_picks from "data.txt" with delimiter "\n"/ x, u: ^6 P$ o7 X
set load type to A_tote7 m+ G3 d/ Y% {
if A_tote="tote 1" then set A_induct to 1* h, U; m3 R8 r
else if A_tote="tote 2" then set A_induct to 2
6 ^9 j* V0 B9 H3 m4 w else set A_induct to 3 & D7 r/ x9 \$ ?: y9 {# G9 l
set A_i to 0
+ A( g+ `( p; t9 z; v clone 1 load to P_induction9 ?$ q2 h% T* T6 c0 A# ~0 [
wait for A_time sec+ G, f' W) Y4 m) K* U. x1 s1 G
end* q4 Y3 q$ M" i6 V; ?
end
. n# ^$ y' |. T# o) {+ u1 K6 W! ?. ]
begin P_induction arriving
V2 F) ~0 l. K" Q8 d if A_induct=1 then clone 1 load to P_pick1
5 N& O" H" N0 M T else if A_induct=2 then clone 1 load to P_pick2! \( T2 N% N; |: Q! j& G+ H4 t
else clone 1 load to P_pick39 ^; p3 {0 ^5 X: M% {2 d4 E
end
) j# b: ]4 d5 t5 H; w C- a
2 T1 L& i7 a) C& O" W! }begin P_pick1 arriving
( V: ~8 i' n0 g9 Z' Q set A_i to 1
- E! u, R0 f4 `/ l( J. X3 e move into Q_induct1" m) i2 z3 J$ i% F" M" @
move into pickaisle.induct1& y6 q4 @9 ^/ j+ s1 d t
while A_i<=30 do begin
) U. O7 b- |! k* k6 M' T0 U travel to pickaisle.con(A_i)- M7 R& c9 S" ^$ d, Z5 y
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec) F8 b e. C+ I3 e+ e& ~ C
else wait for 10 sec
. a4 X. f3 _. l# Q' B5 M if A_i=A_leave then send to die
* N D- b2 ]( ?3 Q1 x: j+ ~$ e else inc A_i by 1
4 e3 X4 w4 w6 @ end9 R; z8 ?; c; s3 F
end p' k" F% C! [7 Q% I: k+ r
7 D& Z6 r4 N" {begin P_pick2 arriving% N1 {. p) H) i" ~) b# \
set A_i to 11% |4 U3 t8 w i" @+ k. p
move into Q_induct2$ q. `0 H5 m& V4 Q$ r' u. g
move into pickaisle.induct2$ ?; v; M% \) a: D) X' t( b
while A_i<=30 do begin
4 J3 {6 J3 i3 Z* O" V travel to pickaisle.con(A_i)) a+ X- v% N6 d& N' J
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 J H4 g6 [0 ? else wait for 10 sec
M' G# _4 A2 D2 S7 a2 d- ] if A_i=A_leave then send to die% {$ k* G. _' n( w( \* X
else inc A_i by 1
0 k6 w, k1 H7 K, E% H1 e- h8 l end/ \( }1 [& r7 w
end2 l& |* L- l& ]
t' M* c9 F! m: N1 I( F+ ybegin P_pick3 arriving: t' C# S. j2 s* n& ^% t
set A_i to 21
; X' D3 Q1 W9 }; Y6 N move into Q_induct3& M, d J: D9 M, @( \; ^! r6 r
move into pickaisle.induct3/ \ ` V& H5 O
while A_i<=30 do begin
/ B& P. E/ l, |3 C2 V travel to pickaisle.con(A_i)
( C% h ^1 w! b* \" C if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ |% g7 J \3 Q" `# @' s else wait for 10 sec) v0 L5 I- z+ p* E
if A_i=A_leave then send to die
8 U! }$ t1 N0 m' G% ^# G9 P else inc A_i by 1
/ Q& d9 p5 B; s @; x end/ Q$ z- z" X4 C
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,其它按你的 ...
|