|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# k& D0 g# L& H7 B# B* L* K) G; j& \0 u+ i5 v
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
* M8 |% O3 M D* m8 L
" Y, w. k" l8 X- n% l2 X% G' vbegin P_read arriving
P. t8 o5 b6 N( S* ]; V3 ?( P+ `& ^ while 1=1 do begin
2 I9 @7 M) u* `4 _- Y read A_tote from "data.txt" with delimiter "\n"
( \$ h) ?1 K9 l9 Z- B8 B read A_time from "data.txt" with delimiter "\n"8 L) V5 S( ?* {5 ?6 K- S+ {) f
read A_leave from "data.txt" with delimiter "\n"
3 ^+ Q% B e7 Y( {, J" ^' V read A_picks from "data.txt" with delimiter "\n"% M, ~% K% I h) P
set load type to A_tote5 ~& a" F) P$ r5 y! ~7 @- r/ [
if A_tote="tote 1" then set A_induct to 1% ~* O C& m7 I& l! U
else if A_tote="tote 2" then set A_induct to 2
; V( m$ g" J5 s0 s else set A_induct to 3
/ a4 u' H9 x0 x: u. W. L! w3 S set A_i to 0
m: Y( V. a0 l' I/ `* i. J; d' t+ T clone 1 load to P_induction
6 [8 G# A- j2 \+ | wait for A_time sec+ [3 u/ l0 D5 m3 p
end
* L7 _1 A& Q2 r% C8 eend2 H" S0 t. e# S/ ?1 a0 t. Y
3 h; n8 u$ h, q; N, Pbegin P_induction arriving
. L' A4 ]; p# ?2 w! D2 C" ?- A& X* n. C if A_induct=1 then clone 1 load to P_pick1, I- t: Y& O: V
else if A_induct=2 then clone 1 load to P_pick2
8 u1 X6 T; w+ U else clone 1 load to P_pick3
8 j* {( N2 l% W5 tend
( t$ y* W8 o# t) a- p# W2 Q( C* m, V: V1 C. k1 K% o
begin P_pick1 arriving
, Q! V5 k+ S, Q. Z. d- n o6 E" z set A_i to 13 X5 q! o- L/ Q) D( `% @
move into Q_induct1# D: G- [4 k; z5 v5 j
move into pickaisle.induct11 a. |, F1 Z5 D- R+ d6 R2 t
while A_i<=30 do begin
, e1 \- Q9 L% r; J travel to pickaisle.con(A_i)$ e3 ?: q+ s. i0 f* [; I6 z# O. F# o; Q( t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ _7 G, C( J: {: o" o) b* s3 u else wait for 10 sec
. }1 J9 Q7 j0 p i2 P- i! E) L if A_i=A_leave then send to die$ l" G) O$ f4 i9 @- g, m# ?# j
else inc A_i by 1* r5 U+ }9 m0 v5 P$ F- c
end$ M' u) x: d0 x7 |
end
0 f j$ d& c5 Y$ T$ m
& z: \' v9 `5 a9 ?& Ibegin P_pick2 arriving
( o* E+ Z6 z( {4 e0 z set A_i to 11
. n, C8 F, C% [1 n' H. B/ ~ move into Q_induct2 i! k+ P4 o, O. K2 [. W
move into pickaisle.induct2, N t' o9 [# N" ~ |( i
while A_i<=30 do begin
3 f* N( D* Y3 ~5 l Z- n" L travel to pickaisle.con(A_i)
1 q" c6 g s) Z/ J3 H( \ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" W) ]/ x8 r8 ]9 Q else wait for 10 sec
- K" {0 n5 y! ?( o2 e. }' s! v3 P if A_i=A_leave then send to die
! X/ @5 q' _/ E$ t; @ else inc A_i by 1
% s+ L$ e# i9 V$ k& A end& x( H2 V+ e# ]* z
end
% G1 n# @/ S0 n3 W' [2 J3 e
4 j3 o1 a# G! g3 Q4 b7 Rbegin P_pick3 arriving1 {: U) ?& i3 _5 D" Y& U4 a- `
set A_i to 21' } k+ h6 t' \8 a
move into Q_induct3
# |* R, d3 `. l7 |: a move into pickaisle.induct3$ ?/ ?4 e* f: N7 ^
while A_i<=30 do begin' l' H/ q/ N( \* P1 q
travel to pickaisle.con(A_i)4 ~+ M; e( K" ]. f9 X+ g( h+ j
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 O) n0 g0 @* c' ]( F( M
else wait for 10 sec* x/ ?' {& U0 C) [) n* T6 p
if A_i=A_leave then send to die" [* u- h. Q" B
else inc A_i by 13 K% X4 J" A% w7 P$ e: P
end2 Z- o8 p! A8 N5 m
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,其它按你的 ...
|