|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢- d0 b) l6 N# f U: U! @5 x" z, h
" D/ V2 T: I- d/ i( E# |我的问题是,在每个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中的数值,不知道会不会有什么不妥。- h1 Q$ } L2 y. H' V! ]! |
# s r8 O6 G4 O t/ U/ w
begin P_read arriving3 V) e R% @: n3 V8 W# H6 K
while 1=1 do begin
# r! T0 G- ?' L& N0 A, b1 N read A_tote from "data.txt" with delimiter "\n"( {* @" x4 _6 ~7 K
read A_time from "data.txt" with delimiter "\n"
# X6 d3 z0 c' U read A_leave from "data.txt" with delimiter "\n"
7 c3 \6 E3 i: P read A_picks from "data.txt" with delimiter "\n"
+ A. u ]; \" _8 F( e& `4 P9 d; u! | set load type to A_tote) P2 F7 R' d Z$ A0 |
if A_tote="tote 1" then set A_induct to 1( r/ F% x) v# [& b4 L" N
else if A_tote="tote 2" then set A_induct to 2% ^( e. T. P$ A' C4 F9 Y
else set A_induct to 3
+ J9 K8 t( ^' t( H. ?" f* ?. d9 F set A_i to 0. s2 h4 r; q; _, J2 ]4 N6 G7 l2 r
clone 1 load to P_induction$ z# i4 G0 V, N6 ^) B% | G5 a) C
wait for A_time sec
3 u7 U, \2 J) b$ ~ end+ @: ~% P+ U7 `3 `
end* I, q' ^2 x5 p% X- [$ N" |$ s7 x
% N3 j7 a7 u, \+ s! H' I* f$ e/ cbegin P_induction arriving
& N, K; N* p, x if A_induct=1 then clone 1 load to P_pick1
' O' G' |: ~1 O. ?3 Q else if A_induct=2 then clone 1 load to P_pick2
, q. G' g% S0 f2 o$ Z7 G else clone 1 load to P_pick3
% z2 b2 B! x. r( c% O# send. G$ A7 i" S3 t5 Q
6 O9 g: D. x$ c K. U: K1 S
begin P_pick1 arriving
' \! I8 f2 H/ |. w+ u* [ set A_i to 14 w1 r7 `& I& r$ p$ L" b' b: J
move into Q_induct1; X& \- W5 Q+ a6 u8 j+ N; k
move into pickaisle.induct1& A; N/ p' k, A m" y5 g) \
while A_i<=30 do begin
$ r9 \5 \& W1 ~, N, L7 ] travel to pickaisle.con(A_i); w" v' t! i, Z; W$ v# r
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ q' ]! T! ?, R; H6 k' m else wait for 10 sec
. H$ h! h% D' u if A_i=A_leave then send to die- e$ B& b8 r9 k8 z; v2 g, o
else inc A_i by 1" B, a6 L8 u+ S$ q
end" p2 N- P, ?' P" c# ^! l# L8 N4 L
end: p8 @! r4 w8 X& A. V9 S
5 S8 j0 J% p: H* {begin P_pick2 arriving0 M4 l1 A' x, s! _- O* `
set A_i to 11
0 T* E1 |7 j1 R$ s$ @# i! T; k3 f move into Q_induct2
, g3 T3 f0 |+ r" \# u move into pickaisle.induct2
8 ?+ p$ I' _ o$ a" I while A_i<=30 do begin
/ v4 w* o" D2 N/ ?# R) M2 s travel to pickaisle.con(A_i)1 B; U, a' R8 d8 w2 R7 A
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 y5 N$ m% K7 S Q- f9 ^ else wait for 10 sec z. s5 w0 U. u1 v) n+ X5 M, a
if A_i=A_leave then send to die P. H4 h4 ^: `, O2 N. X) V
else inc A_i by 1
0 {0 o1 k$ \3 F/ u: c end
. ~, c: \0 h: k6 Tend" }7 I0 w( g7 t0 K* p
1 Z# s | o, K" ?/ Y5 l
begin P_pick3 arriving) O8 R2 \$ r d9 B! [% F9 X& ]
set A_i to 21) e: _, M+ O5 i( b; T
move into Q_induct3
9 p( C5 @( i& J6 ^, a( k; h move into pickaisle.induct38 V+ L: u0 f6 ` i
while A_i<=30 do begin. s# \( z) G3 f! q
travel to pickaisle.con(A_i)1 d2 \* g9 `" Z `
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: E1 V; {: x* z( v# H* b else wait for 10 sec
8 ^0 B" u1 {- q+ D6 e% z. E! y3 Y if A_i=A_leave then send to die
" v9 g6 [; ^1 y else inc A_i by 1
2 N* x; ~2 X F/ z end
" a7 K. d. f( Eend |
最佳答案
查看完整内容
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,其它按你的 ...
|