|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
( T2 d2 ]" _ z2 D' Z: F0 T) }1 w2 P& J3 X
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
& T5 |8 G2 ^ z; @& m9 d5 x' Q* \
begin P_read arriving
' N& C1 V8 m( P. D4 E while 1=1 do begin
5 I; j/ r6 w9 [( Q% m3 ` read A_tote from "data.txt" with delimiter "\n"
4 e( E; p% L1 Y' p! z, t read A_time from "data.txt" with delimiter "\n"+ D# X' u# c8 c3 M. Q3 _* X3 i
read A_leave from "data.txt" with delimiter "\n"
/ N$ y' @. r8 D! B% }! y+ g read A_picks from "data.txt" with delimiter "\n"
7 G( B! @# |# F( [9 \ set load type to A_tote& _8 J# {5 W- ^7 |0 `' _+ a/ k
if A_tote="tote 1" then set A_induct to 1* Z7 _& d* v" Y
else if A_tote="tote 2" then set A_induct to 2
8 {; w9 ^3 u3 i) I% Z else set A_induct to 3 % n3 _+ o M% D4 Q+ A x
set A_i to 0- Q" s/ x. |$ x. s# r q! C
clone 1 load to P_induction
8 J' X5 G3 X1 w( `: U8 N wait for A_time sec3 F& V% b* M7 ?, x* q
end
$ ^$ ~! B& }9 ], B/ @) o, W& Q Iend6 G: U. c& W8 G. t
: B0 X# P0 n" p3 K) e$ Y
begin P_induction arriving0 ]2 s2 }' z8 v- M* ?8 Y
if A_induct=1 then clone 1 load to P_pick1- o/ ]6 P8 ~' m: A/ M% a2 e
else if A_induct=2 then clone 1 load to P_pick2
9 N! }0 j( Y/ x m& U else clone 1 load to P_pick33 ^# E5 W& H& x3 E1 |- g3 J
end" H) W* ?+ x1 p" T7 w3 ^
: R% ]; m& L) g+ G7 ubegin P_pick1 arriving& F+ D' R/ P+ O! D5 |: B! M6 @0 l
set A_i to 1) t4 @5 [) | B6 J5 b% [) ?9 l
move into Q_induct1
$ v, q* I6 ^8 d7 ^" m move into pickaisle.induct1
. ? l6 x& Q! B/ q$ B7 i) H while A_i<=30 do begin
9 g. v9 G& R/ F travel to pickaisle.con(A_i)9 z5 m0 R& E8 U! d1 b; @& s- _0 |
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
A5 R5 G+ J7 j! g/ X$ N else wait for 10 sec# h5 G$ e) `4 e! ~, V6 y# f
if A_i=A_leave then send to die
/ ^: i, W' R5 ?2 o5 Z ~# \0 X else inc A_i by 11 K. b) H- D0 X0 H9 {4 j) @. \
end
+ c* H! T& ?. i3 qend
. ^3 C! `1 L& y% D" ^% w% C- ], [' Y4 E/ S! G" @! `6 L& T# I
begin P_pick2 arriving7 o4 |5 Z4 z+ f
set A_i to 11
6 J* H, k2 p* k% x/ K move into Q_induct21 o; K g" y/ c/ Z6 `$ c* A# N
move into pickaisle.induct2: }* {0 G$ q! e% ]
while A_i<=30 do begin( r0 M- X9 @" C3 Q0 k4 z
travel to pickaisle.con(A_i)
; q- G9 N# E% ^7 C: @ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 O* U# w: i2 S0 r: r
else wait for 10 sec
/ Y" r9 f* g* N0 s* U. R$ F if A_i=A_leave then send to die
8 c% j/ S+ |+ H, I/ e9 i else inc A_i by 1
( J- Q2 b! H T( g v7 v end
4 ]3 E2 G3 \' P q/ tend
! N5 v2 u7 ?. @$ N" s5 n( j0 }0 ]% W
begin P_pick3 arriving
: ~+ H* h- N9 t3 w set A_i to 21
3 R" J: m! ?, M4 v' y move into Q_induct3/ U. Q7 c& j2 w' E
move into pickaisle.induct30 z. M Z' v% {, D. ^
while A_i<=30 do begin- [2 ^& K$ Z8 J# O
travel to pickaisle.con(A_i)! L3 e( v: u C% Q7 \: x9 }& h
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 g' x6 O8 b9 [$ J$ L else wait for 10 sec$ q) ~; t, \* m4 o: y1 W
if A_i=A_leave then send to die
e/ A1 M$ R) _) y else inc A_i by 11 s, k, a, A6 O% Z# ?$ G
end
- q& B6 W3 w, S$ x6 aend |
最佳答案
查看完整内容
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,其它按你的 ...
|