|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 l/ N8 G5 W9 r7 f+ P1 f5 o1 i/ g+ a' B6 a/ |/ y& u& O1 X* |$ E8 o
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
, Y$ j7 N. _# z9 z6 A1 T' p
6 x8 I9 E* ~5 c" Ibegin P_read arriving4 H* x% q1 N. s& M1 w
while 1=1 do begin
# y) f/ J+ O# P, W+ l read A_tote from "data.txt" with delimiter "\n"! k8 h. t4 A. F6 |" G8 Z
read A_time from "data.txt" with delimiter "\n"
4 f- X) F3 Q" }& n3 m read A_leave from "data.txt" with delimiter "\n"
! M& x. _3 P0 Q! M read A_picks from "data.txt" with delimiter "\n"
+ ^& U! t. m( z" }" z: Y2 Q$ N6 n set load type to A_tote T. R+ F1 x" s
if A_tote="tote 1" then set A_induct to 1
; F( o" H) \6 n* r/ o8 P else if A_tote="tote 2" then set A_induct to 2& U3 c- |. h8 }2 ^
else set A_induct to 3
1 z$ c" V( Q4 ] set A_i to 0
4 T& @8 A; `/ ~2 W( d- U' X8 [- K clone 1 load to P_induction
( l/ M( [3 M$ V wait for A_time sec
0 F8 \6 r6 D6 x) E. ~ end
; t0 v! j2 p5 p! Z3 W- aend
w# N) w' v' h, e H, A. X% y' v% n `7 @& H! C. P
begin P_induction arriving5 k) k# X2 q$ z( v
if A_induct=1 then clone 1 load to P_pick1
& o/ g5 I4 ?0 j* s6 u q3 d else if A_induct=2 then clone 1 load to P_pick2+ X9 O% c) b1 R! c3 X
else clone 1 load to P_pick3
9 q" {, l' O7 C5 aend
: T2 X A! }, R0 D3 h- L' w3 F# E! f& b
begin P_pick1 arriving7 F# G* E' _* K( Z
set A_i to 1! s A6 l" G" l/ G
move into Q_induct1
& F( w/ K: I7 q/ G move into pickaisle.induct17 Q0 B! A: e2 Z5 o
while A_i<=30 do begin
z; U% X" I, g% [ travel to pickaisle.con(A_i)2 T% L( v1 P7 B
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: m: `6 g2 o' _/ c7 t# H8 }8 d else wait for 10 sec% N2 v" v7 T$ |: h
if A_i=A_leave then send to die0 b! Z- I! C) B% M+ `2 k
else inc A_i by 1
2 R: E C$ B; }* m3 M0 F end5 P) F9 Z" r8 F
end
9 W9 s6 v5 U X* p# W9 X2 [% \ D3 L
begin P_pick2 arriving6 H9 q: h4 p, t
set A_i to 11
: k0 s5 b6 Q5 |) T( g. t3 l move into Q_induct2
3 R: E- i( R& j: u& J move into pickaisle.induct25 E, G. r% S2 b& H6 t {& D [! Q$ @
while A_i<=30 do begin1 R8 C- q' P8 _* p. ^/ A2 y2 R
travel to pickaisle.con(A_i)
% u/ k, ` N" A. X$ U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
# W5 f" y( |8 R0 Y else wait for 10 sec( u" g" v# N7 w$ |; E1 Q: R. q( I
if A_i=A_leave then send to die
' K/ O9 T8 N% i( \ else inc A_i by 1. ^. q. |7 f- Q( B) \7 S4 W9 j
end
5 a* Y6 {$ L/ n6 l) z7 Xend
8 O {0 q, O$ {' ?, ~+ e1 S: A( ~+ n5 Q; ?/ C' F% L" e. _
begin P_pick3 arriving
5 f s* r. v8 K2 { set A_i to 21
7 s5 o$ K4 f$ |! N; m" R4 [ move into Q_induct38 N$ g9 I& k5 f5 m
move into pickaisle.induct3
0 M! P" i' ?* d3 O' v9 ^ while A_i<=30 do begin
+ N b' |0 n2 j( ~4 b% W2 x travel to pickaisle.con(A_i)
' ~; G* {( J: K( `! t& z" E if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 o' ?7 H3 j8 }( n3 s+ n else wait for 10 sec. ^% P" g) Z* W }3 C
if A_i=A_leave then send to die* j% t* D( y6 _: Y2 I
else inc A_i by 1, A7 @# f& @8 _0 N( i
end3 p9 A2 [; n2 c8 ~
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,其它按你的 ...
|