|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
9 ^( `3 w9 i0 w) \. D3 ?$ V
$ d$ |; N: U: E& s5 {5 v4 \我的问题是,在每个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中的数值,不知道会不会有什么不妥。! _" G4 B. Q$ j& ]. f* k$ ?8 N. Z
0 B) i# A) K- o; i* O
begin P_read arriving6 s6 [, N0 n: F) i* |& k
while 1=1 do begin
: j, u6 C- _9 d' D9 L9 u read A_tote from "data.txt" with delimiter "\n"
1 X+ j' d' M. U& B5 ? read A_time from "data.txt" with delimiter "\n"
7 g3 R' |4 ^+ N% o+ P read A_leave from "data.txt" with delimiter "\n"" d; n' m) |0 ~# K4 ?
read A_picks from "data.txt" with delimiter "\n"/ F, @/ g3 \3 M+ `' N6 |& `# b# H
set load type to A_tote
' c: A1 c8 o' K if A_tote="tote 1" then set A_induct to 1% l: X5 i% ~: V1 G' y
else if A_tote="tote 2" then set A_induct to 2
6 a! X- }% r+ p2 q else set A_induct to 3 : E7 k* B1 L1 _2 Q$ S6 Z6 ^
set A_i to 0/ o1 g) h1 |9 U& w s6 S0 W0 }
clone 1 load to P_induction
: |# d- V3 I, l/ \ wait for A_time sec
* Z* e: x" F( Q2 v p2 H% V end
) }+ n/ @4 c, B* _0 Q2 C8 {end% D4 J6 }' A4 H4 S# A
1 Q3 Q+ t$ G! U0 ^ O
begin P_induction arriving
; e' Z' ?$ a2 ], N# h5 w3 z if A_induct=1 then clone 1 load to P_pick1) ?* R- F6 A9 T% p6 m
else if A_induct=2 then clone 1 load to P_pick2
9 X; z$ p( e; w5 d. R0 A else clone 1 load to P_pick3( I' h' q e! {: o; W
end4 [# t5 Q' f( ?2 y5 x
8 D% o' N+ J$ e' sbegin P_pick1 arriving: Z$ W3 ]* Q6 W! e( M
set A_i to 1
+ } y T9 i) o6 d0 I4 Z9 s5 v move into Q_induct1( m1 k* U/ ~$ v
move into pickaisle.induct17 X# i2 X" K: ?: U4 {( d2 Y
while A_i<=30 do begin
# p u; W, Y+ J5 \4 Z travel to pickaisle.con(A_i)- n! c. M+ C" B; e- F& b
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* x# R, D( J3 Q% r else wait for 10 sec
4 G, S" f8 s' q: Z) s) |4 k+ o7 g6 p) v if A_i=A_leave then send to die& F: e3 l3 a: \" K5 n0 m, c
else inc A_i by 13 ^0 _, t6 V4 V) t6 ~ B* t, I
end, V' E( q! E { w5 c. r/ [+ D
end8 d$ X0 E% ~# k6 r( m
% ?8 s7 _9 W) d9 g& h& kbegin P_pick2 arriving
! g! q$ |: y% a0 a set A_i to 11
; F& U) a* f6 [+ W ]2 I move into Q_induct2; A; M S# o' i& f2 z' c# Y
move into pickaisle.induct23 J( l+ k. }- c9 `% f7 B
while A_i<=30 do begin4 \7 Z$ i& d- d! K6 \
travel to pickaisle.con(A_i)0 E7 z9 U3 N; o4 A% H [+ _
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 Y# H- \( N4 P; }; ~ d; L
else wait for 10 sec
( s7 p/ {0 d9 D0 k if A_i=A_leave then send to die
1 N% w8 V5 I4 D1 y2 y else inc A_i by 10 N1 B, ~5 y! W& o9 @
end
. g+ Y# L5 w8 T/ Hend5 G2 t2 c( E9 `& r9 l P
, K- e, L5 p1 `: Z! O9 }
begin P_pick3 arriving
4 } H. P, B* y) l' x. B/ R/ k0 q set A_i to 21
l3 w( Y% ~2 _" S! ]1 D' M. J move into Q_induct3
6 H$ _2 x/ v! O; N0 q- t; l! } move into pickaisle.induct3
) k6 T# q! ^0 Q* _' g while A_i<=30 do begin
0 A2 P- N3 Y7 E# {7 w) H# W, ^ travel to pickaisle.con(A_i): l7 w( `) I! H( |' {8 |& G$ B9 e
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 C. W! q3 m% L( _
else wait for 10 sec
$ @7 j% G1 P5 @$ _5 g$ @4 \3 s if A_i=A_leave then send to die4 o; A6 @+ H- d) h ^1 j" b
else inc A_i by 1; U A& g. L# E5 O8 y) R `
end
1 N) r* z& J" `: ~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,其它按你的 ...
|