|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( t" N7 U7 E( B, o- e" W' V: y" k) t+ [
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
w) Z) T3 T' Q9 x9 m; U: u5 D+ P0 i( I# @
begin P_read arriving! }6 V7 s- B) ?8 Y* ~% a- p( ^
while 1=1 do begin
3 r8 ~: w* d+ S- I4 C read A_tote from "data.txt" with delimiter "\n"" w2 S& X @, A& D' m! D( R
read A_time from "data.txt" with delimiter "\n"& W! H. D" Z8 v$ w& o% C
read A_leave from "data.txt" with delimiter "\n"
4 M* @1 ?- Y' A# F3 J4 D read A_picks from "data.txt" with delimiter "\n"; \& d& _( |0 J! _
set load type to A_tote5 _0 [7 I9 _5 `0 J( ~) C, [
if A_tote="tote 1" then set A_induct to 15 w& w; y; r/ U/ h$ v
else if A_tote="tote 2" then set A_induct to 2
: q7 {7 M; B/ }# `: H" Q$ I3 E6 x else set A_induct to 3
3 ]( i+ L$ A0 _3 u3 N$ v set A_i to 0" z2 z! z: @4 z" Q/ f( v
clone 1 load to P_induction
6 M5 T& u9 ^0 |" n2 W/ l wait for A_time sec9 y, s. L) n5 l- m
end
- O1 x6 [% _. }9 v/ [end" l* C. h/ p5 A7 {, f
. y- r$ S, _' d: e( y9 i w7 _
begin P_induction arriving
$ N. K8 o- ~" t6 |. u. ~. j if A_induct=1 then clone 1 load to P_pick1
8 |6 Z, f) Z$ h1 v6 ~4 ] else if A_induct=2 then clone 1 load to P_pick2) O2 I0 G7 I# ?
else clone 1 load to P_pick3
) q' c5 ~+ d* ^) _: ~' `end* ]# `/ J: F1 S7 D: U7 Q+ }
+ g. t- L4 y& s0 f7 S+ zbegin P_pick1 arriving# Z ^# {( B& u' s0 k
set A_i to 1
( N5 f& K" r% l% ^. K: ^ move into Q_induct10 n* |5 |& S8 q/ G2 d; Q
move into pickaisle.induct1) ] a2 }' k! }' o4 Z! |% p+ `+ B
while A_i<=30 do begin2 H; A2 g) ?7 U; x/ P" h
travel to pickaisle.con(A_i)$ |# V" v0 _( Q/ _9 ], f
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 o+ K, M+ r# Z9 G+ K4 [ else wait for 10 sec$ U' a. b; Y: s7 o! b+ F) B
if A_i=A_leave then send to die! r7 f* F- R1 x
else inc A_i by 1
: f& V5 E( s& n+ |7 Y4 H& | end5 ~9 l. ~/ o, o
end
( k. X0 y+ i# ^9 m0 y
. V& j6 c$ g" p/ xbegin P_pick2 arriving( N0 i9 k. u( y( b* b
set A_i to 11+ |! P. Z6 B; }
move into Q_induct2' |9 O5 d' ]5 ^
move into pickaisle.induct2
$ L6 b& ^9 R4 m1 L1 z0 Q; _) t4 @ while A_i<=30 do begin! Y. _; G, j0 d; r% x
travel to pickaisle.con(A_i)
. c; b Q o3 H1 |7 [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec# i' h3 e8 F1 S5 ?3 c
else wait for 10 sec5 V6 R# `0 o3 d3 F& O
if A_i=A_leave then send to die
; L+ m: q9 a7 f# { l else inc A_i by 1: J, E' Y# N4 V D) T. R, j
end
' @4 n4 y9 ~: ]* F" tend* @9 u) r! p, i P
; h' C' Z- \; s# O9 {. X+ w9 u3 }begin P_pick3 arriving
# F; M. Q9 ?& } set A_i to 21
# F: M( ]; w' R1 o# s* ^1 I2 u( L" l move into Q_induct3
. Q) S1 y' G5 e o) v! f% I move into pickaisle.induct3; a8 j# |: b' e; [- h0 e
while A_i<=30 do begin
7 N/ }! i. {# m travel to pickaisle.con(A_i)
* F5 n9 t' l: j/ U( ~1 h J5 A if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 k% y$ w) x! y. }% p
else wait for 10 sec
' V' p$ W) u; l) O. J! X$ k) V0 K if A_i=A_leave then send to die
2 V7 G7 @" q. J4 d" E else inc A_i by 1
; o3 {% A7 @3 T3 h/ v6 c, U end" o9 C0 Z, }5 c5 J+ m6 J4 p$ A
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,其它按你的 ...
|