|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢' {5 c9 y& T' b
4 E* x( {) z7 U) j我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ q/ D0 J! m* }$ O/ U! p" w+ }
) K) T ^5 T) I; A1 X
begin P_read arriving0 Q1 O; N2 u; z2 z7 V
while 1=1 do begin
1 y: f* w7 F$ q6 k- @9 I5 Z read A_tote from "data.txt" with delimiter "\n"+ r3 K& u8 ]6 d: m
read A_time from "data.txt" with delimiter "\n"
/ H; K' `. g0 N" \5 J read A_leave from "data.txt" with delimiter "\n"
% @( \0 K1 O' a U! E read A_picks from "data.txt" with delimiter "\n"; U7 p% o+ S3 s E, s( S/ G
set load type to A_tote1 d( F1 ]4 V _+ y' \
if A_tote="tote 1" then set A_induct to 1
! Q- n. v6 @& a3 a) ^/ s# C: m6 Z: x else if A_tote="tote 2" then set A_induct to 2$ }5 q( h) V' ]3 E: D& i( e. n
else set A_induct to 3 7 b: F# x! d2 C8 E$ M
set A_i to 0+ Q6 u V& }# }5 _1 I: O W& n! S
clone 1 load to P_induction
1 k" g, X& z! B& _ p wait for A_time sec. X7 C- ]; O. L- l. L+ P
end$ G9 b& v9 N1 B# f. J
end' k+ _6 o8 P2 w
/ P$ G) I- y/ k- T4 K& y& Obegin P_induction arriving
/ S0 g, {* s- m# R, \% t$ z if A_induct=1 then clone 1 load to P_pick1
5 r7 C# z" M$ D1 g else if A_induct=2 then clone 1 load to P_pick2
+ B& Z# [' m/ M% r7 B& L, F( ]" E; y else clone 1 load to P_pick3
$ T6 Z. ]# C; F8 ^; f2 Y- a( ^- Tend k y: K; w3 a5 O. e
2 E! S) e! x% C( K# i7 rbegin P_pick1 arriving# i6 R1 Q2 o2 J+ z0 ~0 n, t
set A_i to 1. Z' B! i" x N2 `6 p9 T
move into Q_induct1
8 k3 C# i4 Q/ m* Y move into pickaisle.induct1
6 m/ j" @3 x3 @ v7 P while A_i<=30 do begin
9 `+ N" X2 d2 W travel to pickaisle.con(A_i)7 D; o+ }+ g+ t, N8 l8 h9 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 x* z' o% s$ v" [ else wait for 10 sec
' ` I9 Z9 `; }) s+ `2 {- f2 V4 d if A_i=A_leave then send to die
" S& ~: X0 F1 g8 O; @' H. U else inc A_i by 1' k. o7 u# n6 d) s# c* h
end, Y5 c& [/ r u8 B: ^, b, M
end
$ X! S$ j% R5 s! [' X8 ^5 N1 \2 |+ \; v& Q4 J, E
begin P_pick2 arriving1 u a1 S& \* y
set A_i to 11
* Y3 H# R$ |+ |% J+ m2 [ move into Q_induct2
8 H+ S" _1 z+ c$ D" L move into pickaisle.induct2
2 a; b% u- ~5 P* ?+ j while A_i<=30 do begin. h" q' g; V1 [0 |; |
travel to pickaisle.con(A_i); {8 E* o: e4 z. S3 [
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
9 v# m" \8 E& J/ i& ^3 V( P else wait for 10 sec4 Z+ H' ^; I: h1 r( K1 B6 G9 N" y
if A_i=A_leave then send to die
7 s* a: a. F3 d; U1 z: M+ }% Y) N else inc A_i by 1" ~* ^" K# `8 E7 W' y/ ]% X; y
end
- c' v+ A. G* b3 Zend
` X2 P$ O7 U4 e) Q: F2 O: K% A" |7 d+ h5 _0 o0 j& L
begin P_pick3 arriving
0 `4 d/ N% [; m& W) s/ L set A_i to 21
2 d3 }, L3 L8 h" @- d) V# ?8 m move into Q_induct3/ z" R6 T$ u0 r0 j8 c0 g. ~
move into pickaisle.induct36 Y9 o( s1 A4 ~$ a) T: A" ~
while A_i<=30 do begin
: o% Z7 A8 C! O travel to pickaisle.con(A_i)0 B9 B& S* t0 i3 f! d# s! F Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ Z' z4 a. d1 c# O- p) L
else wait for 10 sec
$ T. h+ o8 @. X* y if A_i=A_leave then send to die) _9 z7 D: f3 N2 P
else inc A_i by 1; j4 }: D" [+ S: C: P
end
2 z7 ~4 B/ D! h3 j0 ?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,其它按你的 ...
|