|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢0 @ M) R. x+ E7 u* E
: t7 ^: d! M0 ~3 s
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" P( k# t( U" ~3 X. v7 c$ @$ _9 r
begin P_read arriving
% Z4 W8 B+ S7 S; [& f$ U while 1=1 do begin
5 P$ I( F% @/ ? read A_tote from "data.txt" with delimiter "\n"
9 J n9 G4 n1 m( X) B! k! r read A_time from "data.txt" with delimiter "\n"
' [' u/ `$ F' Y! ? read A_leave from "data.txt" with delimiter "\n"
5 a/ H7 O- V1 e( S2 E+ Z9 _- K read A_picks from "data.txt" with delimiter "\n"3 k; c5 t2 n1 C' p3 h
set load type to A_tote& G# c7 h" k) _9 a4 N* i
if A_tote="tote 1" then set A_induct to 1
2 U# m) ?* f! f4 R+ n8 h else if A_tote="tote 2" then set A_induct to 2) _3 \ r0 r/ w& K: [' P
else set A_induct to 3 : @; G! r% f; {# |5 |& T, }
set A_i to 0% R' }0 B% ~( k
clone 1 load to P_induction
7 z8 X2 }( y8 u: X wait for A_time sec. o; _6 u' @/ S$ A; k3 {# H0 K$ f
end+ V! N0 p) `5 Y0 s" t+ n( R
end
/ M2 v* p9 w/ `7 l! A6 u; [: I8 m% y" [9 h0 f2 `
begin P_induction arriving
7 V& L5 r) [/ U& v/ x if A_induct=1 then clone 1 load to P_pick1
/ h) z" x1 y; q7 N0 B6 z6 S4 ~2 C else if A_induct=2 then clone 1 load to P_pick2
6 F! ~2 i6 ^9 c9 V' p. g x else clone 1 load to P_pick3
5 o- _9 T* Z- e( B& ^. K' Yend
$ O1 i" ~2 j5 U8 s: L5 ~ T( j3 E; O" J2 w# n( H
begin P_pick1 arriving
5 e1 j, [: b @- ?. ~# _1 }- L set A_i to 1
+ Q8 a& o1 ]" i w move into Q_induct1- S) @: ~* Z" n" G8 \7 I; {& I& u
move into pickaisle.induct1
# u- g$ l: b# l4 Y! o0 g while A_i<=30 do begin" w1 y' S" \9 ?8 i4 h* w9 X/ [6 w
travel to pickaisle.con(A_i)
% R& e# t6 t8 a) t, G/ Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: r/ J& {0 N6 N1 S( h else wait for 10 sec
: D3 M" E% }7 p8 U4 e if A_i=A_leave then send to die
5 N! Q4 h' ]$ ` else inc A_i by 1
7 v+ N9 T* D7 F @$ J end& C1 ^9 T$ S; R& x; H- h1 V
end+ s* b7 u' `# N% E0 u2 c+ ?
2 y2 O2 r6 R% w) k' U
begin P_pick2 arriving
" E; o" P) {& h4 W set A_i to 11
; j# h/ e9 ?- M/ ]* r move into Q_induct2* N. H2 ]# w# w! N& C
move into pickaisle.induct2
& Q+ g. Z' }: a4 [8 q5 A( k6 d0 s while A_i<=30 do begin
' `+ o( ], ?( L! O; Y2 @( D7 R' ] travel to pickaisle.con(A_i), K* C) Y3 P: u1 V' n& W
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 J4 w% n% k4 M( `% {5 n( B
else wait for 10 sec0 ]4 v8 B5 \' @, Y. {: W$ ^5 u
if A_i=A_leave then send to die6 j6 d% ?4 T( m/ e0 l0 H
else inc A_i by 1
1 D# d3 ?7 V; n1 H( } end
8 N8 \9 |5 Z7 j% r) P8 u' l- rend
/ c; `9 L* |) l5 r9 O4 f# V) P# h
, p/ I! P Q( N& q" \& obegin P_pick3 arriving
$ {4 |, m/ G) q2 g. \/ \8 P* T- g+ l set A_i to 21
/ d) n' w& W5 \& F2 C- m3 n, R move into Q_induct3- C3 B$ `/ K$ L1 e
move into pickaisle.induct3, A1 l0 Q) ~5 X1 U5 a4 v% T7 E
while A_i<=30 do begin; X. A( R, D1 [0 i7 D
travel to pickaisle.con(A_i)8 X4 P* e4 H% U) ~# F) I
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* N* C: I6 f- [0 F7 s9 k else wait for 10 sec
/ T! q3 D' t7 g7 e& P' S- s if A_i=A_leave then send to die
' l3 m5 \, `9 W: t else inc A_i by 1
, e4 h2 f: A) R- z8 E) { end% _ S, g+ `4 l- k! [$ S
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,其它按你的 ...
|