|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
3 T; h6 ?& o6 f H- g
" i+ Q Y$ Y# t1 }我的问题是,在每个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中的数值,不知道会不会有什么不妥。9 x7 f1 i' P5 g) I
% `4 p4 l+ f8 |9 E6 h' M- N6 C' \
begin P_read arriving
1 n$ H0 D, t) q( v3 w7 `6 f while 1=1 do begin
2 }$ u7 m! T/ P( G3 E( Q" j read A_tote from "data.txt" with delimiter "\n"
3 ?; V; i# d. i2 l8 W, o; e8 _: y read A_time from "data.txt" with delimiter "\n": b- D8 ~3 [/ W0 N
read A_leave from "data.txt" with delimiter "\n"
- ], I4 q. q: K- @: d+ v" z8 C read A_picks from "data.txt" with delimiter "\n"4 Y0 ], c% Q) V1 E9 L7 C
set load type to A_tote
9 s @; t: M6 Q4 i) S3 b; u if A_tote="tote 1" then set A_induct to 1
4 }) i3 u$ M3 ^ else if A_tote="tote 2" then set A_induct to 2
# o6 e/ I: @. Z0 Z else set A_induct to 3 " W2 |( P5 P+ a1 [$ N$ X
set A_i to 0
9 ]! m' }" t4 O# ~) n- P1 ]; | clone 1 load to P_induction" z! R# t: r/ V5 v- D9 h
wait for A_time sec
% w6 y) H! F" T end& f3 X8 K+ B# y1 l. x( S
end
, `5 R5 H( J& ~7 W- |1 x6 Q+ t1 Z( O
begin P_induction arriving" }0 {( [; f# j. ~. W
if A_induct=1 then clone 1 load to P_pick1; r# R. T+ C$ k. d1 m, A- T& l D
else if A_induct=2 then clone 1 load to P_pick2
4 r9 U' R& J: P' t else clone 1 load to P_pick3
# Q# h- I% r, N! o# t. k vend
3 q a! H$ C, e! Y7 r. p/ x0 V# E5 V
begin P_pick1 arriving
' |4 H9 ]' l7 v$ ^ set A_i to 12 x7 \% Y6 N7 S" A6 d9 w
move into Q_induct1
1 N; M. |# {* r$ t9 p1 B move into pickaisle.induct1* |* K' `) h/ e$ C: k
while A_i<=30 do begin
- j% X9 Q0 ^, ]/ [ travel to pickaisle.con(A_i)' E3 {3 E* B3 H2 j! |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
, s8 y: _# R6 c; E0 ~7 I$ H& j else wait for 10 sec
I: C0 V$ }- j9 u if A_i=A_leave then send to die1 C+ d3 s q: T7 }
else inc A_i by 1! G7 c x: F/ ~% k
end
6 |+ Q1 b4 D- G8 G$ l2 k# xend
+ Q: G D7 R* S; ^& P
7 c5 q& M3 \1 G6 Y7 o6 B+ Cbegin P_pick2 arriving
; A& r& F' {8 V5 {/ P% z set A_i to 11 C4 y( m$ d! Z) t- m7 g7 Y
move into Q_induct29 W' H# G. W2 K4 q! }8 {7 v7 E
move into pickaisle.induct2: x7 w4 _% o+ s
while A_i<=30 do begin8 a) b0 [7 W r: I( M! d
travel to pickaisle.con(A_i)
8 Z# i0 S4 O6 S% _9 V' j0 ^4 f if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 j* h4 ]5 k; U' `. k
else wait for 10 sec
" G) }) @# T" S) _ if A_i=A_leave then send to die
5 @) _% _. E5 D( r- j% B8 G else inc A_i by 1
: ^4 G. |0 ^# r* ]1 W% s end
6 T6 _8 J: {4 a4 Iend
! s. l0 @- |1 K/ n
+ q! X1 p6 v1 ?& j( fbegin P_pick3 arriving
% @% y; K* F( J set A_i to 21
g0 z6 ~; o7 p0 i4 `8 g move into Q_induct3
: L7 s/ T" K5 R" V6 m1 |, m: c move into pickaisle.induct3
: H+ x% v9 u3 q5 K8 j, j while A_i<=30 do begin
8 ~. Y2 r6 s( ]/ \; y travel to pickaisle.con(A_i)
' {* s; g/ k5 Y, X: |* P; R+ X2 J if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 I8 M9 ?# l1 o. _. `1 R6 h
else wait for 10 sec
0 ?% }9 s1 D8 v; b6 I6 f* d7 | if A_i=A_leave then send to die8 X. R, Y" p8 \3 ?0 Q$ ~
else inc A_i by 1
$ U1 C0 b6 v# X: J end5 S3 D1 A8 V N
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,其它按你的 ...
|