|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
4 }! F, e1 O! S8 K# H1 k5 o# T/ W% V/ E3 z- N. K, j& l! v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
$ M' C" g- B; e' A6 r- a' b8 n Q* `/ f1 T" u5 R) } l
begin P_read arriving. w& o( I3 N; C
while 1=1 do begin
, W0 f& W$ A; `9 r) H7 `+ }8 V read A_tote from "data.txt" with delimiter "\n"
* G. e) w+ W6 v( ~, @- Q read A_time from "data.txt" with delimiter "\n") c( \& G M8 m/ } ?7 ~9 x
read A_leave from "data.txt" with delimiter "\n"
' \ h. I6 L, R! w- K read A_picks from "data.txt" with delimiter "\n"2 R4 H5 A* h3 V* W$ I- h' V! n: J
set load type to A_tote
& a( n8 `. }- J7 R if A_tote="tote 1" then set A_induct to 17 t2 J e$ T2 d8 |6 X2 V
else if A_tote="tote 2" then set A_induct to 2
6 O: p) l/ A$ A: ~+ ~ else set A_induct to 3 2 T; f! m1 A5 S+ o& q1 x
set A_i to 0
8 c9 o2 B( c* u4 I/ F6 C. X clone 1 load to P_induction7 f$ a4 R7 Q' k, L
wait for A_time sec
" I3 W7 B3 u; Z. F- i end4 b7 E7 ]0 z" J4 {8 }" C
end: K- Q6 e( U' h+ I* V9 H, c
0 Q, ^* a# A7 _8 V2 a' `0 zbegin P_induction arriving
! [) C3 K, b4 O9 `/ [ if A_induct=1 then clone 1 load to P_pick1) B, c2 X5 k# x6 T! J# `5 _
else if A_induct=2 then clone 1 load to P_pick2& |& m& ]6 b: `6 `( p
else clone 1 load to P_pick3; a& |4 D, L; }1 r \" \3 v
end" g" g; J e+ m- M5 P; \* ?
M; \5 o6 Q. K" h- a% bbegin P_pick1 arriving J4 `# b4 p5 B% @, g5 o1 o
set A_i to 1
( G D& K' E) L8 R* R! p move into Q_induct1 F2 C1 n4 A; C3 n0 Q3 U) s
move into pickaisle.induct16 K, w0 c: |, ]
while A_i<=30 do begin! `7 i" ~: r- u' s4 E
travel to pickaisle.con(A_i). B& R9 ]$ s& i
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 m- I* ^6 o8 A) K# h, r
else wait for 10 sec% S; J4 C9 |# F$ x4 ]
if A_i=A_leave then send to die
. f7 ? Y# _2 k8 x$ X O6 U else inc A_i by 1
' Y* k& q; ~0 ~ J: x end
, _, C# u" z' @" z# i2 ` X. f. yend7 J5 M/ Q! L/ m. ^$ o
4 ^, f! g* D/ N% p0 j4 i9 Qbegin P_pick2 arriving
: H8 ~4 L$ N& T$ M set A_i to 11
; C+ H/ j5 Z# k: Y# i" E. N. \ move into Q_induct25 }; _7 H' y2 U9 s
move into pickaisle.induct2/ ~- \% n* H* k6 ]% P3 h* V* ^
while A_i<=30 do begin
* l, K+ Y2 a4 j9 W$ |$ I travel to pickaisle.con(A_i)
: a- d' v. ? e$ s6 X! @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
k$ B8 Z8 ?, u6 @" J& K else wait for 10 sec
5 g" a2 ?( W8 ^; k, ]: I9 e3 T" q if A_i=A_leave then send to die( [) B4 k/ \+ N7 d" |. @
else inc A_i by 1, I7 l3 l+ C, I; ]
end `5 n8 `) `: Z' O3 T' C; l
end" f5 ?1 L- A L5 ~3 D
; Z# t+ w4 b8 x; U: Z5 U9 t t. ^
begin P_pick3 arriving$ Z8 L2 N7 V* k, D+ B
set A_i to 211 G0 M, e- Y/ p& w8 T4 w
move into Q_induct37 H4 u! z* q! N6 l9 J9 I) ]. H, ?# K
move into pickaisle.induct3
5 B* i9 e) }# V* Q. j9 | while A_i<=30 do begin- H+ n2 S5 @! ?! B' _$ q ?3 t8 S/ G" i
travel to pickaisle.con(A_i)
8 x0 f) Q3 {6 I" U& w8 o4 n8 F if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& }9 W- v" o/ A* C. \ else wait for 10 sec/ s' B% x0 m% L, k ~. T$ T
if A_i=A_leave then send to die
6 V6 ?2 T6 t5 P% x- y+ b4 t& c else inc A_i by 1
0 G, t E. ?, U. F% r. L end
5 T, {% y+ P; C# {! [5 o+ Iend |
最佳答案
查看完整内容
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,其它按你的 ...
|