|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
" O' Q% ~& t8 F( g$ ^
2 X: }7 j ~; Y* G9 g6 _/ c我的问题是,在每个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中的数值,不知道会不会有什么不妥。, L( E) F% m1 r& T: K# y8 D& \
G' X7 `9 s2 W* r# R" D% ~begin P_read arriving* A2 G# k2 O# w. Q8 J" \( {1 C5 }
while 1=1 do begin
; I/ ], C) u) \' e2 U% p# H! k- [- a read A_tote from "data.txt" with delimiter "\n"9 |( r! X# E" @7 d4 p; H- I! h: Z& U
read A_time from "data.txt" with delimiter "\n"
2 o* ^: L- B5 R read A_leave from "data.txt" with delimiter "\n"
2 d% O& ~1 j8 Q3 k& L! S { read A_picks from "data.txt" with delimiter "\n"
- E! c% v& `9 x* _ set load type to A_tote
4 I- |1 W; ] R& v0 ^) | if A_tote="tote 1" then set A_induct to 1+ [9 {0 v; t* U( f
else if A_tote="tote 2" then set A_induct to 2$ ]+ x! a, e5 p4 a0 Y! U
else set A_induct to 3 9 _" C0 f0 H3 \% T6 Y) j" Y
set A_i to 0
0 H; ^; B% ?7 t l clone 1 load to P_induction$ J R; Q9 B* v# G
wait for A_time sec
$ o; [$ v& J: m7 B% O/ @& [ end
4 q, A8 R* \ U4 c# Cend
* i, v# R" R7 }! @4 V, d& W: \
begin P_induction arriving# m9 d `; S# |" p- J4 o1 R) z
if A_induct=1 then clone 1 load to P_pick1
/ r: }; J6 S3 }0 z else if A_induct=2 then clone 1 load to P_pick2
5 u! h- g- B1 v4 ^1 V! P else clone 1 load to P_pick3
" |- H+ j$ u+ iend
- u( I( L' K# ~0 \2 T2 h1 Z, N+ N1 A3 ^
begin P_pick1 arriving, z3 l- A2 N7 _, e# _# f8 x+ I
set A_i to 1
# ^" X" k$ f/ C/ W+ W: d move into Q_induct1
" U( |9 G$ y9 n' e$ q% W5 C move into pickaisle.induct1 h4 ]# t: P1 |( B4 P
while A_i<=30 do begin
; Z; x7 Q4 s: c' L ?& y! O travel to pickaisle.con(A_i). t9 k% A3 {6 ^# F+ |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# G+ G% l0 Q0 Y; \+ \) r else wait for 10 sec' D& y! t! v* Q/ `1 i! U% A, x
if A_i=A_leave then send to die
# |( W( J# K" B9 } s: c4 l5 i else inc A_i by 1
8 k Q; B. `2 A end
' c" w4 C0 _+ T6 Kend6 Z! j2 E, v! S6 r3 g! |
/ r; x. w: _5 m0 Sbegin P_pick2 arriving. O {6 P' X! W7 [, v0 H g
set A_i to 11% E R# A0 @5 j+ E
move into Q_induct2
2 W1 K/ G! p6 `/ l/ ~; [ move into pickaisle.induct2
1 }1 C- G. x' F3 x3 S$ [ while A_i<=30 do begin c# E# o" y4 q1 \
travel to pickaisle.con(A_i)
. {8 k( D6 i0 k0 C( o3 @, I6 e if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 @0 m/ C1 A) Q1 R else wait for 10 sec
: D- z( R8 {, ^! A1 x0 r if A_i=A_leave then send to die
, I, }2 @& \ w1 J0 N7 K1 v5 J else inc A_i by 12 K% @# y$ f0 f2 K6 F9 T+ s' }
end' \. S# \7 g0 U0 Y1 u
end- C2 O+ @, \$ D/ U: Z6 _
) e8 d+ Q& ]) s+ T! Z: |; fbegin P_pick3 arriving
7 f- i, h/ H% k3 Z$ s/ } set A_i to 21- b3 U" ~# }# _$ r' X3 O
move into Q_induct3
" o. q' f* l; Y: M move into pickaisle.induct32 N/ {7 r. Z; E
while A_i<=30 do begin
& h- ] g/ l4 K) C; Z3 {! R" F travel to pickaisle.con(A_i)
' B* k5 z ^2 Y6 m' Y3 h; g if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 J' |; A! B8 P3 I# z
else wait for 10 sec
& D$ A1 ? X9 D- [ if A_i=A_leave then send to die
6 `4 S' y+ R9 z0 m else inc A_i by 1; R. B' V" `, j: [9 t
end
9 Y! X! A- r4 v; Fend |
最佳答案
查看完整内容
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,其它按你的 ...
|