|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢% ?3 b# N+ N6 D& X" q$ {" R9 L
4 l& c$ Q7 ~! f2 P
我的问题是,在每个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中的数值,不知道会不会有什么不妥。1 s+ Y* ]) n |' U0 Y
; z, W$ A+ V9 M: @begin P_read arriving# O( \; y; i" y q( X
while 1=1 do begin% w5 w; D! K4 r- t! S5 q: k* _
read A_tote from "data.txt" with delimiter "\n"
+ z- z# R- w# Z read A_time from "data.txt" with delimiter "\n"
* D; y" N+ G+ H# C read A_leave from "data.txt" with delimiter "\n"
9 B* P6 k% ]: D: M( ?4 q y read A_picks from "data.txt" with delimiter "\n"5 \; d: i) u0 }7 F3 W
set load type to A_tote, w1 {, V5 G; o9 _/ g
if A_tote="tote 1" then set A_induct to 1: P5 r& ?; b; ^! c" \( Q2 n
else if A_tote="tote 2" then set A_induct to 2
T! W; Z: Y9 [! I r% X else set A_induct to 3
# ~* U& X P9 S5 v: I) ~5 @ set A_i to 0$ ^& Y& \0 `0 I6 f7 a
clone 1 load to P_induction
& i; ~" N3 y9 |2 b wait for A_time sec$ l6 k. U' Z4 @5 ^2 W
end" X, y; x9 P8 w
end
$ v# o9 ^6 Z$ O3 E$ e
) q& M3 c% k. P1 `! S# w$ jbegin P_induction arriving
6 Q2 V* a5 _5 i9 ]% o* l. c7 D if A_induct=1 then clone 1 load to P_pick1
2 W6 O: ~9 y/ I else if A_induct=2 then clone 1 load to P_pick2
1 T0 d$ f, f" @7 }. E else clone 1 load to P_pick3
$ d% `# n' k" q) J3 V" Lend
! Y$ p1 Z+ R; j! ?# K9 \, b9 X+ v
9 J% K4 a/ K3 e+ A1 I! e; |begin P_pick1 arriving
6 _9 c7 }4 Q& Y7 h# Z9 d# l& A set A_i to 1
- D5 H3 G' a1 f( E O9 u move into Q_induct1
& Z* `' k; G8 q5 I move into pickaisle.induct1 F* p0 J f5 Q0 L5 d1 L0 V
while A_i<=30 do begin
9 v/ h1 Y8 V/ m$ K6 j" ?/ V travel to pickaisle.con(A_i)
0 Z9 r! i, A, S! p$ ~- J6 V" o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ P* p4 J& P- R5 O: i& d, v
else wait for 10 sec( R+ S t2 Y/ x' G
if A_i=A_leave then send to die
" d1 j- P Q" n else inc A_i by 1
: c& ^5 S2 y% ? end
" C( `0 b! a; y* lend
; b) f, k8 V" v( h/ l7 y& z# l' P) e, h; l9 T2 I
begin P_pick2 arriving% a* s. p1 L& ?2 I8 ~6 Q
set A_i to 11
' e: d' \$ Z6 t. O; I5 C move into Q_induct2. C5 g* c$ U4 {8 _1 l) C! s
move into pickaisle.induct2( ]6 L0 R3 p K8 H+ D2 T1 X
while A_i<=30 do begin
% R5 l( E T. } travel to pickaisle.con(A_i)4 m3 M0 U) q+ X9 {7 X) t8 K$ v7 K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' X% o( D3 `0 }" `7 @ else wait for 10 sec
3 u( z* T' ~3 U4 a if A_i=A_leave then send to die6 z; ?- c% {6 p/ a7 J
else inc A_i by 1
; W2 l# [& |* c" d& L5 l2 Y; W end
* T# ^. V$ @' C+ U3 L2 u" @% }end+ G* ?( W3 O n2 |3 n) e
' X8 M3 F* f9 |; W; d+ E3 Z# _* D
begin P_pick3 arriving+ f3 E8 _4 `+ J9 v3 J( _
set A_i to 21
6 F0 m* N$ x A: ~# U7 Q% Y move into Q_induct38 l/ O( h; Q7 b7 Y ]7 i- m
move into pickaisle.induct3
3 s0 O3 Y6 A0 i4 ?. _% Y; Y# E% ] while A_i<=30 do begin8 z: S, c+ a4 J T) N+ T
travel to pickaisle.con(A_i): f& j/ A" [, e: { @/ v
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* e5 K- l0 X) W2 @+ V else wait for 10 sec2 ^( {% M, \% Z1 K( S( a: @
if A_i=A_leave then send to die
& ^! w6 L" d1 P6 ^3 M( R0 P0 x2 q else inc A_i by 1. m) |" U$ M% Q( v+ W b8 s0 J
end/ F7 {- L6 x3 m2 y6 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,其它按你的 ...
|