|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
2 l5 l( p2 `& { l- Q+ v5 ]! R- l; |$ S8 B6 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中的数值,不知道会不会有什么不妥。, l: ^5 d" ~4 ^5 p5 e
5 H( T( m$ ?. c- y2 @5 {
begin P_read arriving
: F7 s" d2 C2 w; _+ i while 1=1 do begin3 U5 Y" }+ K$ m" l1 P1 H) d
read A_tote from "data.txt" with delimiter "\n"( F4 C/ J0 C+ Y( t- O; ~4 `- S
read A_time from "data.txt" with delimiter "\n"
1 d) s# d$ Q7 m& ?+ _' q- B( T$ j read A_leave from "data.txt" with delimiter "\n"
) u. ^4 p/ L' f+ e+ E% D, a4 I read A_picks from "data.txt" with delimiter "\n"
" u, V! R9 M7 i set load type to A_tote5 k8 z$ O2 ~& X* B
if A_tote="tote 1" then set A_induct to 1
+ k# d W7 T. Z8 ]4 h2 A8 r# ] else if A_tote="tote 2" then set A_induct to 2
9 X4 z/ v' j! c4 q else set A_induct to 3 1 w6 ]$ d7 f# h9 B0 U! x" l
set A_i to 0$ N2 K) G& o5 @
clone 1 load to P_induction8 J9 ]- L& Y' K1 F; i
wait for A_time sec
/ a/ x1 i" [, T( I# s end
2 ?0 Z" x' l1 j* xend2 [& q) [) D7 U# O6 D+ Q- Q6 L
: X0 i/ H! x, S4 c! i, H) p7 Kbegin P_induction arriving: {6 j- l1 \: M. L; q" a
if A_induct=1 then clone 1 load to P_pick1
. j, e/ N5 `+ ?: N% ? else if A_induct=2 then clone 1 load to P_pick2
+ {7 p( G3 I, K- R) _ else clone 1 load to P_pick3
1 P9 y; x: p8 S3 @7 s% i( f% U) Tend
; C0 H2 s' q% ~9 f1 w0 |; l9 W9 e7 F/ a2 I7 J& x
begin P_pick1 arriving. [" a' ]; M$ Z \6 K8 O- a1 J
set A_i to 1, h2 e' S5 R- \: w5 o1 Q
move into Q_induct1
! L; D3 O! ^* m: N$ l/ N- U R' k9 C move into pickaisle.induct1
. Y) T$ w5 M2 x2 f while A_i<=30 do begin$ ]% e1 t( H4 Y: b @+ B
travel to pickaisle.con(A_i)
. K& ]$ w3 `$ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
/ w) g2 e* b. H: O3 Z' N8 s else wait for 10 sec- U3 y6 Y6 j: S4 H! Z, z5 D6 J+ d
if A_i=A_leave then send to die7 m& ~4 q. }& G/ P& N8 ~: [' K J
else inc A_i by 1( E5 [1 e# a) |
end4 S$ w% ^6 ]" q9 F/ n
end
, F* M$ f3 k6 n3 d8 p3 ]& m
/ f9 X6 S; _( f6 k5 q! `7 O9 ]begin P_pick2 arriving( \* C2 p: F; c1 y4 r; V- ~! W
set A_i to 11
& k- Y% r4 U) x/ l move into Q_induct2
' Q( Y- d6 x+ Y6 m9 u1 E move into pickaisle.induct2
6 L* [" \3 z- _' K& ?% r) w while A_i<=30 do begin2 C- g/ E8 {7 q# M1 @! i
travel to pickaisle.con(A_i)
2 I5 k& l' r- ` Y) D Q& N: o3 l4 l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 Z; W5 U; n/ [! O
else wait for 10 sec
& ^- l, @+ [5 d& ]& L if A_i=A_leave then send to die
+ G: O9 w& y9 @# @ else inc A_i by 1
& M5 \: G# l; o, o; C3 u* ] end p6 l! F7 v: ^/ S) }: C7 _
end" `1 S- }3 ?# E3 o( ~6 V! |
& c8 a# u5 F# f$ B$ i7 s" {
begin P_pick3 arriving
1 Q% r' ?& \6 i+ S! m1 t8 p set A_i to 21) x. B3 n; Y% o# t+ [4 h- P
move into Q_induct37 G* |9 |% H! x
move into pickaisle.induct3
$ _6 D g) J1 S- ~ while A_i<=30 do begin
8 t# B) D3 ^$ r6 y travel to pickaisle.con(A_i)9 _$ d$ @. R" X5 k0 D) o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 i' B. X; ^/ |' w7 j d' I' r, Y
else wait for 10 sec" u. _2 _# t# [% y6 q( ^/ O3 A
if A_i=A_leave then send to die/ O3 a# m7 E i; s) }
else inc A_i by 10 N3 O; k b. g) N6 W
end
- B, A" S. X' a" H+ 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,其它按你的 ...
|