|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: r7 Q) V$ ?: a. z5 q+ R
' q( y) p/ \( n$ D2 L8 H我的问题是,在每个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中的数值,不知道会不会有什么不妥。
4 E. Z3 M1 [' O' }) r1 \ U" _" `2 @& i1 b
begin P_read arriving
( s+ w4 }) q6 _! I6 A; @9 K& d: U while 1=1 do begin
& j3 G* N. n% M1 ^3 h% s; F read A_tote from "data.txt" with delimiter "\n"
" d$ b* P2 z; D6 M read A_time from "data.txt" with delimiter "\n") [8 K$ y& A& e1 s* r- f
read A_leave from "data.txt" with delimiter "\n"
7 A/ T1 o5 y/ o read A_picks from "data.txt" with delimiter "\n"
t. r8 C' u6 _8 ^) G- x- P set load type to A_tote
! [/ w, u! P8 L9 ?+ z: J- k; i if A_tote="tote 1" then set A_induct to 1/ U$ N1 ]: p# l3 w9 `
else if A_tote="tote 2" then set A_induct to 2
& ?, r8 z$ e$ Q; j( P else set A_induct to 3 ; x7 K3 ^7 ?. V/ e6 k% y L0 p
set A_i to 0
. a' A, _& e- D/ s( h% O2 V0 w clone 1 load to P_induction
9 `5 Q7 G- s! Z! G, p8 o wait for A_time sec- C% k" @1 F6 p- r
end' P& ?3 I0 H9 e% G6 ]+ J/ F
end
, ]* C, B" Q1 f' |' X( l% R- }# R! O i
begin P_induction arriving
5 J, G+ e8 i f0 m9 v if A_induct=1 then clone 1 load to P_pick1& N% B, B& i7 Y* O
else if A_induct=2 then clone 1 load to P_pick2
9 W" L& |( G& e- U6 Z* y J- `: _ else clone 1 load to P_pick3( x; q1 i- [3 ^5 j
end
5 y% |" ^; t% \) a1 C
+ C: a* C" i1 v, ^begin P_pick1 arriving
1 k2 K' c5 V3 p+ z( ] set A_i to 1+ U& n U. G6 `8 _" C
move into Q_induct10 v, y( e$ @/ `& `/ j; T1 k8 p# h, E
move into pickaisle.induct1$ m7 C* I/ b, R& d- Q. p& L
while A_i<=30 do begin
3 ]# E6 b/ }+ D$ s' o1 Y travel to pickaisle.con(A_i)+ K8 P& p! p4 J* M1 Y0 M
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 ~- r4 T" Q4 [- \ }' L [. T
else wait for 10 sec9 B3 a5 b# {0 P4 q. b
if A_i=A_leave then send to die
: j) `. s" ~! ] else inc A_i by 1
$ {: r! T/ `! z3 y8 ?9 [; t end
$ h, Q, L, q+ j( R; r! J' vend+ j0 N3 e* d6 ?. ^5 u/ n) a
- U/ |- {8 f* a/ J& {3 |/ {
begin P_pick2 arriving
4 \( d9 ^3 ]: l) {( [ set A_i to 11
+ N3 k2 N* Q9 f7 i! Q$ Q u move into Q_induct2
- g+ c5 _/ G" g1 T move into pickaisle.induct2& q7 g/ U0 P+ J$ c* B S& \
while A_i<=30 do begin
5 l: ?+ E2 n# ` travel to pickaisle.con(A_i)) T( S, h+ \* b) X! C9 t
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ l: I/ W& l- K1 W4 Z else wait for 10 sec
% r* V7 c2 {; m. f% _/ J if A_i=A_leave then send to die
/ T$ f" h+ |% G7 H6 @! g1 q else inc A_i by 1
8 O. b( C! ~8 ?' d# z& r end9 P9 n! T6 R* ~. a# o8 r1 {5 j& m! h
end
7 j" Y ~5 E% i1 f. [; N, J% V( E* h3 B1 J/ f! D9 q
begin P_pick3 arriving- L' z6 m$ u# @5 f
set A_i to 21, C6 h( a3 }9 N& N: Z
move into Q_induct39 b) d5 @/ @, b/ @8 M) ~! B5 t
move into pickaisle.induct3& h2 f; O& ^( a4 \5 Q& K
while A_i<=30 do begin
8 j0 |& r( O0 W travel to pickaisle.con(A_i)% I0 S2 |/ z8 y9 q" w2 z+ y# o
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
2 p6 |2 \8 X: {5 N" |; A1 E/ M5 V else wait for 10 sec
6 k6 z% ~$ [8 p3 r! W: M5 d( Z# e if A_i=A_leave then send to die# |$ Z5 w; Z: {! W
else inc A_i by 1' |6 {4 K2 c8 Q, t. _3 [! n z. [
end
, I/ a6 V' e) W* Wend |
最佳答案
查看完整内容
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,其它按你的 ...
|