|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ C* m# B; Z! t7 u0 x
0 }4 S( A' c) o+ Y8 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中的数值,不知道会不会有什么不妥。
2 b& p& K4 f7 b! ?$ r
* t) |7 W! B f, _begin P_read arriving5 J* u# o# J; P. R+ S
while 1=1 do begin
7 }" q* [9 @1 Y" m read A_tote from "data.txt" with delimiter "\n"7 c8 M6 m# `) R$ C0 }0 o" E
read A_time from "data.txt" with delimiter "\n"
6 G0 D; k) `) X/ H' c! o6 P2 x- W read A_leave from "data.txt" with delimiter "\n"
* J6 j/ ~3 S) D/ S" A. q read A_picks from "data.txt" with delimiter "\n"$ k4 A5 g v) b( g/ }$ ^6 n) ~# Q% U( J
set load type to A_tote
/ m8 v. M8 c5 X; L7 Z6 v z if A_tote="tote 1" then set A_induct to 1
4 x' z2 {6 a' \+ S& c else if A_tote="tote 2" then set A_induct to 2; X5 ~" R! } Y( `8 N0 T" F
else set A_induct to 3
G* M3 Q( x% W set A_i to 0
, S2 ]5 m% q9 d# R$ W7 ?2 l, R clone 1 load to P_induction: c3 ^2 ^- a9 M
wait for A_time sec1 @( Q2 n) J1 _% d
end6 f+ P y' C( s4 j* ?4 S& A
end
' n: v$ p& X+ d6 _% e" u9 }2 m6 I, V5 S; ?
begin P_induction arriving
, `7 J! k& T/ h9 Q/ ? if A_induct=1 then clone 1 load to P_pick1
7 s4 L/ u7 J( r1 r. U8 T$ r else if A_induct=2 then clone 1 load to P_pick2* B& P- D4 k$ L& f# ^
else clone 1 load to P_pick3
0 x3 F3 T k/ ~4 ?2 H6 b q5 Y: Eend
9 D% o7 M) C( [, `5 Z. H1 k6 f4 F
% ~( v3 {+ p1 H( w% T4 ^) c6 ibegin P_pick1 arriving
z. Z7 i& }6 ~8 w9 x# f2 O& L set A_i to 1
0 |2 B) [7 {. _/ h! R. U+ h2 v move into Q_induct11 e1 J' A) m3 P/ G5 a
move into pickaisle.induct1( ]! z3 u, P g8 L3 B% G& Q
while A_i<=30 do begin
/ S4 F* |4 B6 E! C; l; i3 c* i travel to pickaisle.con(A_i)
0 L7 L e6 A; S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec* j9 K: P. c$ f
else wait for 10 sec% d, o* c, C4 v9 v2 u
if A_i=A_leave then send to die0 p/ ^6 i" Z0 g8 c4 z
else inc A_i by 1% Q! \6 b* V& e, P
end
" y$ }! \, i. I1 ^( T- Nend2 H. s+ L" l( Y9 R
8 O% P# K4 f5 n: R$ r [begin P_pick2 arriving3 A+ i. t* r; y4 z: _9 ]
set A_i to 11
: e5 \1 X* ^7 `; } move into Q_induct2
2 ?2 F1 t3 V; c$ l" T" ]/ j move into pickaisle.induct2
3 W( T% c( j9 j# j9 l e1 ` while A_i<=30 do begin
) ~3 S7 @6 G" ?( F s M2 x. y travel to pickaisle.con(A_i)
) o" D z$ a! c$ \* Q: i/ m if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 y$ z$ }* J% ]; {" C' |' I7 a
else wait for 10 sec
' u) {; T+ ?3 G& Z! w% U$ b if A_i=A_leave then send to die
) ^: B: I0 J% x' K+ u else inc A_i by 1/ ?; m# q- W4 p, Z4 i
end2 b; ^6 b0 ? Q6 t c2 u
end+ C, c2 b' A" W* D5 I* j
; T4 ]# H5 a& q" jbegin P_pick3 arriving
4 q5 j% ~+ v! F( }$ d1 b8 N( \ set A_i to 21
5 H, D& S5 [3 D' N, N- w move into Q_induct3
5 N+ b# Q! s+ r) h- ]+ ^) }# G5 j move into pickaisle.induct3
{3 \: ^- X6 E$ \# Q while A_i<=30 do begin
1 Z* d K |8 m) P travel to pickaisle.con(A_i)1 e( _' u! j, ~/ B5 s; h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec- Z% \( J* c; R+ m
else wait for 10 sec' B4 Y4 M+ M7 a9 {
if A_i=A_leave then send to die8 r6 Q0 W" A: ^3 a. F
else inc A_i by 1# ~- I. H( U, s; L" ]
end9 f' w# o/ C/ C; ~4 ~% M
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,其它按你的 ...
|