|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& g# T' r' Q% u0 Y! E6 Q7 R
" Q+ ~1 b; O- k; o我的问题是,在每个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中的数值,不知道会不会有什么不妥。
" R! _+ F0 \2 j0 b
1 g1 {+ M$ L& e5 N* Tbegin P_read arriving4 O' y* ~1 b+ v/ _2 e
while 1=1 do begin* f7 L) `& O0 s, F3 k& ], C% {
read A_tote from "data.txt" with delimiter "\n"& h5 y9 t E- W' K0 G1 v+ ?
read A_time from "data.txt" with delimiter "\n"+ U+ G9 B# l) d$ v
read A_leave from "data.txt" with delimiter "\n"; }% L" n% t, v& v' w
read A_picks from "data.txt" with delimiter "\n"( ~& U7 V3 n( d; O# ?" x
set load type to A_tote
3 x$ a9 ` X$ u5 q, D0 N if A_tote="tote 1" then set A_induct to 1
4 a; h2 o4 Y; ?8 m- W else if A_tote="tote 2" then set A_induct to 2! Y3 [8 N+ S5 `0 ?; S% @
else set A_induct to 3
3 \1 n) O* ~; B set A_i to 06 g& r0 E$ q6 I+ x) K/ m
clone 1 load to P_induction
( F5 ?! B2 E7 A1 r7 Z wait for A_time sec" v& F0 C) A: e s. [3 a3 |8 I7 c
end* h/ j E( z% z# Z. ]
end
0 A: W6 Y7 e+ j% F0 n6 e; c) A0 }* h% C$ `" H
begin P_induction arriving0 K6 L. R/ _4 F7 u+ l3 l+ r( l
if A_induct=1 then clone 1 load to P_pick1- ^7 m0 B- y# _$ e3 O' i- B
else if A_induct=2 then clone 1 load to P_pick25 J( C/ I. }' B& W' H4 C5 Q1 J
else clone 1 load to P_pick3
9 D' a1 E, n+ pend
[# ~. K5 F3 J& @$ F( ^3 g6 U# ]# I, h7 Y
begin P_pick1 arriving+ i0 O8 {6 G- N( f: |/ u$ r
set A_i to 1& E4 {$ s) F% l2 {; i
move into Q_induct1
; i% y9 ? N7 Q% X( u move into pickaisle.induct1( F2 n) [& \7 W2 I
while A_i<=30 do begin
$ `6 Z5 \4 Q$ [! Y( c4 C travel to pickaisle.con(A_i)8 Q. j& O& Q# Z1 T/ A/ \
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: }: t1 B& u" s; @" ^& `0 [ else wait for 10 sec
- z8 ]5 g* P" L0 N0 d/ e if A_i=A_leave then send to die
4 Z- s( I% n, @- h/ N K else inc A_i by 1; n) V- R2 ~$ Z4 T- t* G' E5 W
end
. E, s+ K5 C0 H' J/ J9 E; Oend( v4 f+ ~; _' K, ~7 E
4 z; K. f# l3 O T6 ~. ^$ fbegin P_pick2 arriving
( @6 E/ ~ r' _ h% F set A_i to 11
6 k1 r/ _/ [3 E0 d move into Q_induct2! Y3 F6 r T7 D% `: A
move into pickaisle.induct2
9 O+ H7 m, p, W m4 |, x- r& b while A_i<=30 do begin
& p9 ^+ m# Q( z* W; c. M) | travel to pickaisle.con(A_i)8 N, M7 C, ^9 m" i6 ?( `" K
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 U |1 S$ m+ P9 r) N else wait for 10 sec
, u: k6 i6 F3 @; S if A_i=A_leave then send to die+ N- Y1 W' ^8 n( u1 j. W" ]
else inc A_i by 1" Q7 `& v1 o5 T. R" F
end
' n1 z4 c. J$ f, ^, `- M6 W7 |% rend1 U9 I. z) { {" s# }0 M, m+ u# a
; Z8 r }/ G3 z8 b& Bbegin P_pick3 arriving
7 s7 Z6 L! \- W+ D set A_i to 21
( O7 |! H- Q5 f move into Q_induct3 R- R; o. C* n5 {9 V' d) y. u$ c
move into pickaisle.induct3
+ Y( Z1 A; r; {& b5 Z" {. j while A_i<=30 do begin
1 P1 H1 W+ h% K3 D! Z travel to pickaisle.con(A_i)- @8 u* f' ~/ s3 K C' S
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 a% U( i% M" f5 j8 s- ^( {
else wait for 10 sec( r5 L% E! h) G
if A_i=A_leave then send to die
) a {% D- F4 C2 _& b9 c" }0 E$ \ else inc A_i by 1; n w& m7 V( b0 S$ ~6 A+ N% ^
end# ^( q( s8 s1 c% {
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,其它按你的 ...
|