|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 I% `3 d3 r2 N5 B; W$ |4 z+ B8 T- j8 \( Y2 ?
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
# [/ T& X" |6 Z3 n
, p3 l2 u% A/ C N5 O/ Obegin P_read arriving- v8 O6 G# |/ `) G
while 1=1 do begin
. b1 v" k& l* I4 @+ j read A_tote from "data.txt" with delimiter "\n"
! R3 V* {' n0 z$ h, ] read A_time from "data.txt" with delimiter "\n"# u7 z9 Y f7 E& F# P ]6 r
read A_leave from "data.txt" with delimiter "\n"# l5 I U1 L1 ]3 Z
read A_picks from "data.txt" with delimiter "\n". P8 s" [6 g L4 B# X# @. ^
set load type to A_tote
) I; A% `# e9 Z. i if A_tote="tote 1" then set A_induct to 12 U) f# Z2 ^8 Z9 Y7 q k3 A$ X
else if A_tote="tote 2" then set A_induct to 28 d, V, }2 \; A) v
else set A_induct to 3
! `3 ^) |; d& e. L, d; u! E$ e7 S* Z; | set A_i to 0
# A6 W2 s: `3 m$ |! q% g clone 1 load to P_induction
% E1 {. B5 w( S: q0 M! N wait for A_time sec* \1 W% C' C9 t# | x: Z) l( V8 O
end( |; {$ l3 o- i8 Z
end C2 M: O6 A6 T/ N1 ^
' a$ y# ~4 _3 c: \# \' p' Q- B9 sbegin P_induction arriving
7 l" ?# J# h1 N if A_induct=1 then clone 1 load to P_pick1
# [8 X- m: d. Z9 l' j else if A_induct=2 then clone 1 load to P_pick2; d3 c+ E* H6 G" E
else clone 1 load to P_pick35 U* b# U F3 f# E7 O6 _+ {
end
5 ~7 \0 {$ _ s" Z$ w; l! N) }% y7 z9 g U! ?! q
begin P_pick1 arriving
]& F( m) ?. h0 M) O0 \6 y5 G set A_i to 1
- z) i3 |# U' \* E7 X. h8 b move into Q_induct1
. B6 i5 H( W/ \/ }8 ]$ E move into pickaisle.induct1! o5 l3 u' r$ I" h
while A_i<=30 do begin7 |1 @7 |: x: C. c2 ~; x( z$ t' \
travel to pickaisle.con(A_i)* q# v9 d2 h; p9 E* [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec: R/ h; l) `$ J0 C, P6 a
else wait for 10 sec
: I( ?/ O D6 Z3 d' F if A_i=A_leave then send to die
$ l: F; p/ r3 k$ ] else inc A_i by 17 z6 u) V. r; n& {' S
end
, @" v/ p; }/ D/ c9 y* kend
^+ H* ~* b+ E4 P W/ m
1 _: i# f: l/ @- @begin P_pick2 arriving$ z+ j1 Y1 b! v, ?2 t
set A_i to 11
: s* e' n2 b( b0 ~ move into Q_induct2% h8 k" C7 N$ Q7 G! z# a- D; i
move into pickaisle.induct2
! A3 A7 N$ M4 J0 _# ] while A_i<=30 do begin
- ~. J7 a! [- F) g travel to pickaisle.con(A_i)
! C$ j- W" k! G( V7 G/ H- S w X# Q if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' _, a& n5 K: m$ A' d
else wait for 10 sec
) j$ w2 ?+ a& y B( X# M if A_i=A_leave then send to die' D' I3 e( S# g) S+ @
else inc A_i by 1
# ?5 Z, _ T; t2 |7 Z1 H end+ w2 a. U# F: P# |& E
end
. S2 l' ^# d" F4 c
: ?: `! v9 P- q3 Nbegin P_pick3 arriving4 ^1 f8 h! y7 L1 \" m$ H
set A_i to 21% K t! l; c& p s1 v2 }' C
move into Q_induct3
3 n8 e( X/ v2 J! u1 s" k move into pickaisle.induct3
. J/ l4 K& }" f" \3 M" ]9 L while A_i<=30 do begin- F' m- u, O) ?2 c# }# I
travel to pickaisle.con(A_i)( @ w( c& t3 E
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( g b$ I4 m+ D. M: i8 T8 N, G
else wait for 10 sec
' ?$ z1 N8 D' W6 @ if A_i=A_leave then send to die, S5 ]2 v2 P8 H0 r
else inc A_i by 1
+ p' M" u1 H' e* C4 }* U! c. R! g6 [ end
$ F: P% J1 c' B- Z, @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,其它按你的 ...
|