|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢( l6 `" X3 f% V; R
0 K" |( a. m1 @$ n
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
% _: j# E/ l. m' Y5 L/ ]+ \4 s
. O* a1 U) ^1 m. e5 @begin P_read arriving' z* }! H' ]$ {& j: C
while 1=1 do begin
7 g+ X3 F$ r& p7 }* W5 U read A_tote from "data.txt" with delimiter "\n"
( o9 u) ?+ L! ^- k1 l2 O" R$ ^ read A_time from "data.txt" with delimiter "\n"
! s- E8 n3 E, I. e$ l read A_leave from "data.txt" with delimiter "\n"
0 G g' @, @* e; x) v read A_picks from "data.txt" with delimiter "\n": W+ ?' F! T. U
set load type to A_tote
! n" F& T. ]6 i7 U# i/ e u7 ^5 C& k if A_tote="tote 1" then set A_induct to 15 I6 Z3 A8 |' a( [" t7 a# [
else if A_tote="tote 2" then set A_induct to 2# A0 w# R6 ^/ N
else set A_induct to 3
* v' T# X, `, ?6 B2 U set A_i to 0" B8 G# y3 c( J; w" M5 `
clone 1 load to P_induction* D. R& g% z$ K( X: [3 p
wait for A_time sec7 H2 S: h0 Y0 H& o
end
$ @7 b% g3 Q* o3 {7 b: @. Pend
W8 g8 z& Q( O' O/ h4 @3 u6 B: S3 Y
begin P_induction arriving7 v0 n& J1 b' k0 X
if A_induct=1 then clone 1 load to P_pick1# Y N1 R- ?5 n" |4 C8 P3 y
else if A_induct=2 then clone 1 load to P_pick23 i& u. m- C; B' i5 {
else clone 1 load to P_pick39 {% r; f8 G" W
end
; R. I- `& g t5 h' N2 ^) L: i2 W# J* E$ L% _4 I. w
begin P_pick1 arriving
% G; ^: Q8 A$ q( k G" Z g set A_i to 1
P( u8 d5 s# V move into Q_induct1
; _' o/ n6 M( R6 F! h* C move into pickaisle.induct1* ~# S. w2 | \% v; c
while A_i<=30 do begin
0 v3 U- {% N6 ], U3 `% K travel to pickaisle.con(A_i)
( \2 u- X; Y. d4 o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* a/ `) I1 \' j6 f. r2 } else wait for 10 sec1 h, |, d. u; X8 s+ C5 L- R. V
if A_i=A_leave then send to die9 K' X5 Q4 {2 J3 }, f
else inc A_i by 1
1 W8 @0 Y( [1 H) k r6 W5 }2 h# [4 F end, L, W- K r: V6 P- ?7 O
end
J; |& [1 R% s% h M$ r% J0 o# J7 s# M2 P5 o6 @* D
begin P_pick2 arriving
4 J9 R+ O' K6 k y! U set A_i to 11, B3 u9 y# O4 P o8 ]7 k1 y/ m
move into Q_induct28 Y* B: v0 T& Z6 a
move into pickaisle.induct2; @# L+ D+ P. G, ]+ `
while A_i<=30 do begin! g" H3 F& b" n# i$ u$ m5 Q
travel to pickaisle.con(A_i)
) Y+ a* g' ~. ? ?2 W, {5 }2 s# P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec( ?5 V5 h) z" v7 g- q! C% {+ x3 x3 z1 H
else wait for 10 sec
$ T# u. W1 y! M& m3 {+ ^ if A_i=A_leave then send to die
8 W( G5 y) q& T8 I/ ?6 l% r else inc A_i by 1
# `0 S) U! M4 L end0 X& u* n! Q9 H& B% B0 C" I8 M `% h
end' q0 H& z$ m' z- j, @$ m& n
* w* M! u0 M/ B) G( S8 c* a7 q0 U
begin P_pick3 arriving
* Y$ C; i- F& G/ M: J set A_i to 21
- e! W0 s% ?8 C& [5 y, w6 U& I move into Q_induct35 w; N: X' K4 s* o- c2 l$ b
move into pickaisle.induct3
$ n2 H* l: k5 F- F/ @6 s" E8 C% v while A_i<=30 do begin
# x+ N4 J$ ?3 C1 t3 o6 P0 D travel to pickaisle.con(A_i)
$ r6 P. m; R- B3 {9 Z" o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
0 ?% U9 w8 M9 _+ V( s7 j' g else wait for 10 sec
/ e$ B4 k0 _! P5 Y2 H if A_i=A_leave then send to die
r Y2 g9 U, N$ u( i& O else inc A_i by 1$ p! ?$ q: G, Y& z3 F2 }
end
! ^6 G C# ]5 q$ b' h% _+ \1 Jend |
最佳答案
查看完整内容
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,其它按你的 ...
|