|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 k, G8 ?, `/ ]( y1 d' v8 v0 u# n' M0 M+ u
我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 W2 F4 O4 @# `& N+ y+ ~
. ] e( J+ m& T* h
begin P_read arriving7 Z7 D; ] _8 y' [% ] f
while 1=1 do begin$ N6 q! N* \ v7 K8 ]
read A_tote from "data.txt" with delimiter "\n"0 v( Z; f& x, S0 j& k- @& o
read A_time from "data.txt" with delimiter "\n"$ ^- s3 \4 v4 d. H5 l# j% C( Q
read A_leave from "data.txt" with delimiter "\n"3 }$ Z6 U9 ~6 p \7 _! R
read A_picks from "data.txt" with delimiter "\n"0 {* H" O" U3 s/ p: z
set load type to A_tote
; b5 ?9 S* F0 B$ k1 w! |6 R( d0 h if A_tote="tote 1" then set A_induct to 1
$ S* f4 o) H+ x* Y/ T# T else if A_tote="tote 2" then set A_induct to 29 A' ?6 E! ~1 _5 |( X y( Z5 n5 O
else set A_induct to 3
0 ?3 ^( o4 P6 T' G& N set A_i to 0
* G4 l) u" V! L clone 1 load to P_induction
" L# Z& |5 q6 c, b0 Y) N+ a5 F wait for A_time sec6 G, o5 \* Z+ N% p! A" H Z8 F
end
- T7 f+ k6 r. G) N ?; h5 {end2 p7 \+ x' R+ m% H7 p# _; Y8 ]
( H+ a/ `1 b: `/ l3 E- y" j+ k
begin P_induction arriving
( S7 J3 E! ]: ?1 { G" W if A_induct=1 then clone 1 load to P_pick1
' N( m9 i" \' y6 J- h' X else if A_induct=2 then clone 1 load to P_pick2* |; s$ `2 G: k6 U1 J
else clone 1 load to P_pick3! p! H G- @5 t' G0 Q! F& t1 R
end
; a' s2 T8 A( U7 A q: D! z9 l+ f) W% v+ y7 N- Q
begin P_pick1 arriving
+ D" S. |' J5 f* m( b4 C1 _! _1 D/ o' T set A_i to 1
6 V3 K1 y/ Y5 a4 d4 J move into Q_induct1
, I: k% ^0 [- `" S move into pickaisle.induct1
+ ]+ V1 c9 S; J6 J/ w( p8 r5 G4 G while A_i<=30 do begin- M( B3 W% `+ }/ W% W
travel to pickaisle.con(A_i)
- B) S- N+ U; I+ v/ i if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( N: ?) z7 [+ [- Z# ]( {$ y
else wait for 10 sec) G! `2 _3 s X+ z6 n5 O$ r% v" N
if A_i=A_leave then send to die
, X& [& |( L! P& P4 r$ A$ ? else inc A_i by 17 g5 \& B! d Y* H) q* [+ P5 V# h; q
end# t7 v" {* a7 z% |4 Q
end
h# a$ ]. ?# x1 Q; ~1 K- k
. Y: ^- V& m" Z' O& Sbegin P_pick2 arriving( f. { `, M$ `+ e! `8 N% a
set A_i to 11
* D* R3 s" K: {" l move into Q_induct2 s- h. d4 k% N3 z
move into pickaisle.induct2
( g5 N: w. N5 `% s/ V& s& b- ^# C while A_i<=30 do begin
9 J% Q6 [# z1 S. a' ^+ F travel to pickaisle.con(A_i)" J( [. x5 s0 f# o1 O
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ p; v/ }( a1 E/ N* ?4 L) O else wait for 10 sec! V- d" I7 X/ P: F+ m
if A_i=A_leave then send to die- e. `4 _; N0 k9 Z4 u9 v
else inc A_i by 1. U7 R) n: @7 U) M& Z3 \
end- L8 a* l" [; \7 \& [) V
end
1 u& ?6 W' N7 `+ b+ q# G! {' }* n+ D9 a
begin P_pick3 arriving
" q* }* ]# z1 ^: o v$ K4 j set A_i to 21- [, U* K# J: E/ k4 r
move into Q_induct3
% D/ N& p, y" b3 p$ | move into pickaisle.induct3
( r w& z& k! z" M3 y4 X while A_i<=30 do begin
3 H' o6 d. B8 \8 T7 h travel to pickaisle.con(A_i)
) Y: r8 ^$ D9 y3 o8 s# p) V, k6 W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' a9 B8 {! F4 O: l) |
else wait for 10 sec1 H2 _5 `& Z P& D
if A_i=A_leave then send to die* e+ @: a% F* z# M2 r. S
else inc A_i by 1( n! l+ i( n5 `9 A# q0 P: X
end
" d$ n* J8 {9 A5 y9 l5 U" _6 N/ hend |
最佳答案
查看完整内容
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,其它按你的 ...
|