|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ ~8 Y( a6 @+ i+ x6 S
/ `% ]! O4 T( s3 Q" h我的问题是,在每个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' G6 }# H+ y" w7 F9 m$ M+ Y
0 H4 o, l. c6 p$ G- ?
begin P_read arriving3 L6 \% Z& b1 T2 L1 Z
while 1=1 do begin
% ~- `- {3 j q2 X0 S7 W+ _ read A_tote from "data.txt" with delimiter "\n"
0 n$ t/ Z1 [9 i6 p4 I read A_time from "data.txt" with delimiter "\n"
4 k6 p5 P5 b- _ read A_leave from "data.txt" with delimiter "\n"
& S/ R$ X# d+ P7 F% P1 ^3 P$ X read A_picks from "data.txt" with delimiter "\n"( A b! a* W' @. D
set load type to A_tote0 g$ n' S; X% D9 Q2 E
if A_tote="tote 1" then set A_induct to 1
- ]; U/ b$ i4 u# N$ [ else if A_tote="tote 2" then set A_induct to 2& p9 L+ v. b P) Y9 M/ {
else set A_induct to 3
6 U9 O4 v& f ~ set A_i to 08 n6 K$ _) A5 w* i) O& p) N
clone 1 load to P_induction- n8 \; M0 A4 p$ W
wait for A_time sec) V% y/ c, e5 t; r% z
end
/ d* c1 P! o! f* |% fend! s& \1 L. A% P% Z2 n
P8 e K* I- T0 a4 Jbegin P_induction arriving
& {7 W% K" y& z8 E3 x if A_induct=1 then clone 1 load to P_pick1
/ B# V! F& _2 {6 i* {4 n( N# m else if A_induct=2 then clone 1 load to P_pick2' G; u9 V8 P1 o7 _9 Q- s
else clone 1 load to P_pick35 a( ]- U h; L4 H
end
2 j2 b/ e0 J, |# y( {! y" X" y# N5 X/ ~% a* [/ P2 V5 R- z
begin P_pick1 arriving
4 C& A4 {4 q7 j/ d set A_i to 15 M1 K* ]' s' s' A7 [
move into Q_induct18 U. t8 x% r& u. Q/ K
move into pickaisle.induct1' K, D; l- `" u$ U) h
while A_i<=30 do begin7 _. X0 _2 w7 T. E4 J. X
travel to pickaisle.con(A_i), e3 F- V/ m1 D% C& L% V4 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ X6 b+ O0 j8 M5 d else wait for 10 sec
3 |- @. ?* h3 U! f6 p if A_i=A_leave then send to die
: l9 N; }+ v7 W. x else inc A_i by 1( T* x, L" O! k# }1 ]/ j! l' \
end; W: Z' {* A x- ~2 r9 b9 D" l& }
end
/ x) z1 F$ J+ O7 u# H! T v7 p3 J4 J( U- s
begin P_pick2 arriving
1 ]7 `, {. m9 Z( y! q set A_i to 11
$ }) ~0 f: s& i7 Q6 l- n1 { move into Q_induct2/ U1 U0 X, k' {* U1 i1 W: M5 n% z0 l
move into pickaisle.induct2
p% k- G0 D$ ]( ^ while A_i<=30 do begin
; ~0 i6 b; i9 E; ~6 A travel to pickaisle.con(A_i)' h Z" X: S5 |- V8 a/ Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 \2 k6 R& o) m! I5 l else wait for 10 sec% w) |% `3 A6 ]3 ?! V# T
if A_i=A_leave then send to die
" K. ~2 u1 \, W; }$ U2 `7 w else inc A_i by 1 u& p* t7 E. ^. s" N- d
end
0 k8 h& k$ f/ W( @9 s; R0 e& s: Xend! {5 S% a2 n! `1 A) ] O! {
; U) _3 g5 w* m Y2 ]begin P_pick3 arriving$ i7 m9 `! j: F
set A_i to 21
) N- k2 k$ y2 l move into Q_induct3
. ?- r( N, S+ b2 e, E move into pickaisle.induct3- v& D4 C7 b* Y0 R1 [! Q
while A_i<=30 do begin
. S1 z- l, B: t* o) h3 c travel to pickaisle.con(A_i)
9 `7 T2 g/ x( R* ]9 B if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ {6 y: D& K) r) y
else wait for 10 sec
) L5 e* |9 v* `* F2 ?4 D if A_i=A_leave then send to die; _% ~3 q+ X! i$ Q5 n
else inc A_i by 1
# G4 R. V/ ~/ p end
$ }# p1 B) _9 U% X& E3 w4 o) lend |
最佳答案
查看完整内容
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,其它按你的 ...
|