|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
# C$ H' q8 A+ Y3 U- Q( a! c6 Y$ h2 Q0 ]. D
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% X+ x3 r; A. d. d6 T/ U4 R
. N5 f) x1 f! l7 G
begin P_read arriving0 @% b% l( @2 r: i$ v
while 1=1 do begin k: U1 z. v/ I: `- p. b' U; ]
read A_tote from "data.txt" with delimiter "\n"
9 n1 Z( k3 z* U( G read A_time from "data.txt" with delimiter "\n"; i8 {1 b5 ?7 Q8 @8 A6 U
read A_leave from "data.txt" with delimiter "\n"
z* m, B/ z* q' r" {0 _ read A_picks from "data.txt" with delimiter "\n"
0 Q, u1 t: F' ^% d) I6 c& W set load type to A_tote
- x- g6 v7 u' A, f b4 W. O+ Y if A_tote="tote 1" then set A_induct to 1
! J5 m: b" }! K8 n else if A_tote="tote 2" then set A_induct to 2
. ]4 n% e4 r1 k% Q, T else set A_induct to 3
6 {7 _ d _! O% L% X& e: o |1 ` set A_i to 01 q( M0 e2 d9 g: b
clone 1 load to P_induction7 t" K6 S5 Q% C* d5 I- R: ]5 x
wait for A_time sec
$ c% s+ L1 O- n* y! A end8 @& I2 I T6 v2 D( o6 g- c
end
1 u3 @1 F' `. i( `' c" o3 W) s+ i: u* W0 Y) {) A
begin P_induction arriving
3 |' L0 j l( B, g/ q6 ~8 C! G if A_induct=1 then clone 1 load to P_pick1
0 P) H% f% y) ]# ?+ e5 c else if A_induct=2 then clone 1 load to P_pick2/ {2 p o' _' R M7 o4 M N
else clone 1 load to P_pick3' E: r. b1 V' ~
end
% j( A2 R5 E' `: d' G1 _! }7 g |3 H w7 H
begin P_pick1 arriving
+ W! r' m0 R& i2 g set A_i to 14 l! R. l! v1 \/ p2 y$ ]' n) P6 P
move into Q_induct1; `4 k0 }* w+ }" f" U% d5 m/ n
move into pickaisle.induct1
' ~9 @$ l' [* o! d9 B while A_i<=30 do begin8 ~) E* o/ x" z
travel to pickaisle.con(A_i)4 z( X) y: c) N+ y D9 M( S6 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
5 Q8 x w2 {4 i( M2 L M6 K% r else wait for 10 sec, W' ^. F. O1 j0 \; _, Y# Q
if A_i=A_leave then send to die* s) B7 D- A# T) {9 {
else inc A_i by 1! ~* Z# J( V- ^! y" p |
end0 y e3 e- O3 K9 @: K: _. R
end2 N9 t/ o4 K9 j1 d0 W
5 j! I, ?: ^! _8 |6 r2 h+ }7 R& Obegin P_pick2 arriving: F4 t9 z' P' K$ j- U2 J3 G
set A_i to 11
% k$ x! L' {6 I, ]9 P+ Y" n move into Q_induct2( h4 y4 n% v% n
move into pickaisle.induct2
: B- T0 d9 ?+ a4 ^/ p3 s while A_i<=30 do begin2 m! N$ @8 P: Y6 |! u. @
travel to pickaisle.con(A_i)
; f% Y: C- [- o if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
) v* e/ q5 }* u# L! s! k else wait for 10 sec6 i% [+ t& R1 m
if A_i=A_leave then send to die, w) u1 y4 p; z, c" C9 a
else inc A_i by 1
9 M# x$ ^" O9 | end" p _2 [# S; I% V
end( s) P1 b0 e" [8 f0 ^# C
( u! s$ G# K0 v* [9 Z1 P3 xbegin P_pick3 arriving$ ~; N* }0 M. `
set A_i to 21
4 i' c2 |: z" S9 O move into Q_induct3
9 q/ S; Q! B& ~9 B' d- F move into pickaisle.induct30 P, D$ T3 L+ L( B! l. y1 p+ C. q
while A_i<=30 do begin( e, P! f$ y! Z# W$ s
travel to pickaisle.con(A_i)
- ^9 R$ I# K# }( _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ X4 t# u7 W1 i1 Z else wait for 10 sec
& U9 m* q! J7 b1 q if A_i=A_leave then send to die
0 O/ d& B. Y$ r* _4 W' K else inc A_i by 1- L+ V" D% K6 s7 k* Y4 l0 i
end. I/ w+ J3 ^4 H" D- a e# ?
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,其它按你的 ...
|