|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
& J/ W' [) d. K- r. |' V% T7 Y5 f E% a g" I- K' N8 X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。/ m6 g# x W0 S+ S0 z
) F0 b* t' ^. D( Z! ?begin P_read arriving1 u) H& }) @* x$ c
while 1=1 do begin; M; d% G+ s2 \2 n: n9 N
read A_tote from "data.txt" with delimiter "\n"& g7 i& L" d' l5 d5 f& ^0 H
read A_time from "data.txt" with delimiter "\n") F/ ^: E$ R7 ]
read A_leave from "data.txt" with delimiter "\n"
8 r+ H7 [' K# p3 Y read A_picks from "data.txt" with delimiter "\n"- h1 L& i8 C) o4 L' }4 `
set load type to A_tote% `5 w& \8 c. H) a+ N$ G+ h; D
if A_tote="tote 1" then set A_induct to 1
* y, r- |$ |7 B& h& D else if A_tote="tote 2" then set A_induct to 2+ u d3 F2 b( x9 S, F3 e
else set A_induct to 3 " r4 R1 B( g. Z( a
set A_i to 0" H8 l' X( f* t; j
clone 1 load to P_induction* e, i9 P* l+ i: a
wait for A_time sec" m# C# M$ W6 o `1 ?$ F* ~! I
end d; d9 w" `' L8 b% ~
end) Z% b) m8 E8 X% ~9 s6 d8 I3 e t, }
" V$ a" B9 f" u+ I# J2 Ibegin P_induction arriving, O" K" r2 P U" U* N
if A_induct=1 then clone 1 load to P_pick1
8 H2 {) H! E: y' V" G' K1 A, @ else if A_induct=2 then clone 1 load to P_pick20 J" ~- e1 N% r9 Z$ o& B8 Y
else clone 1 load to P_pick3
" q3 }0 d K+ L; Z1 Iend
8 r( k+ O: j! R; s+ B, ?( x# w# U5 e; l
begin P_pick1 arriving, T1 r8 J6 d$ _0 i
set A_i to 1
6 \% j" w! p' g# K move into Q_induct18 Z' r% W- o* b
move into pickaisle.induct1
/ E x+ q- f- R$ n while A_i<=30 do begin
. k! F2 g9 y3 w$ [4 X5 _ travel to pickaisle.con(A_i) j5 n0 s* S6 O( c) _8 Y3 a4 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 ]: v3 g0 k: P6 B- U else wait for 10 sec
. r* x' r; R+ N% P' f. I if A_i=A_leave then send to die2 g, y$ O/ ?5 v& |3 @
else inc A_i by 1 b* H+ I# {. x( n0 C- I9 O
end2 n/ _# J- B! q0 v+ S
end
' ^) ^$ |/ C# O# j7 C" ]
# ?0 c: c' N( g' c5 }begin P_pick2 arriving4 T3 R& U% M3 e8 y3 s
set A_i to 11) w- A; _8 N7 S- [1 @) ~
move into Q_induct2$ D/ \0 V: J. E$ w+ G
move into pickaisle.induct2
, z5 G9 s* d$ X, R while A_i<=30 do begin9 h' D: |9 w1 J; ?. ?4 W2 b
travel to pickaisle.con(A_i)0 \6 w$ w5 c9 {1 J0 j& r1 }5 p: O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 y5 H' B+ X( R2 ?) d else wait for 10 sec- m/ s( p; y! e, r
if A_i=A_leave then send to die
8 V1 d! B; l9 j0 i9 m0 J2 ^ else inc A_i by 15 k3 L( J( e7 B: n! l
end, D [* a+ ~) F- @! W
end, W- x# @2 v* m
6 c" P$ P q: g) ], d Cbegin P_pick3 arriving A1 {% x/ T: O: r1 C. v& z7 e1 N
set A_i to 21
" b0 ~5 [/ e& N3 x$ Q move into Q_induct3
R* v* x) B# G7 m+ `. X move into pickaisle.induct3
3 n2 R9 Z6 j9 |- _: W7 X while A_i<=30 do begin
6 ]# e& R) o- N: J! B/ Y travel to pickaisle.con(A_i)8 k9 H4 }# b7 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ Q4 Q0 `5 E5 c& z2 |: ~4 q else wait for 10 sec
% `+ y& n0 @+ b/ o/ d if A_i=A_leave then send to die
0 K9 q+ i6 G0 W y! Z8 e1 O. @3 d, N) M else inc A_i by 1
4 f* B B3 M4 j% N' M end) y. l4 y5 ]( E
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,其它按你的 ...
|