|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
+ a1 \6 }( O( v% S
2 k& }5 X* y- I5 t" F3 |/ n我的问题是,在每个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中的数值,不知道会不会有什么不妥。
8 c0 N2 G$ E5 N9 [- y$ W9 t$ H
9 \9 @/ a, ~2 u* v8 Nbegin P_read arriving
$ \. R9 O5 H% m3 v2 y while 1=1 do begin
0 v3 Y2 T6 ^% b8 |5 P read A_tote from "data.txt" with delimiter "\n"- R- B: G; Z3 L3 S
read A_time from "data.txt" with delimiter "\n"
" N0 U+ [! [7 y3 Z) y, T7 F read A_leave from "data.txt" with delimiter "\n"
; _) S5 d/ \$ k: S( G6 [ read A_picks from "data.txt" with delimiter "\n"
; K; A5 ^& f0 J0 \4 N, E set load type to A_tote) w# P' m; O, Q$ V; ]
if A_tote="tote 1" then set A_induct to 1
: u2 q4 z/ |3 g7 t, l else if A_tote="tote 2" then set A_induct to 2$ f; S U- j: T: P
else set A_induct to 3 % ^& S' c( S6 t2 s$ }) ]
set A_i to 01 k. B& S1 q, \$ F/ ~6 C8 U" P
clone 1 load to P_induction2 B) e B, r7 }$ F% y
wait for A_time sec
, j6 K B0 b1 |6 i6 S2 K3 D) s- \/ x end0 z* K0 B* A9 q& m1 a S
end4 ^. e; h9 m# M) R3 Z) ~
- M6 E) U6 E4 S- Z# sbegin P_induction arriving! a q* W# k: [2 x5 j' d
if A_induct=1 then clone 1 load to P_pick1
5 H" O! P4 ]( |# R. j! u+ Y else if A_induct=2 then clone 1 load to P_pick2
* W1 H* t* h+ H* m: Z" I% I else clone 1 load to P_pick3( C5 u) e; k+ g
end
+ W2 w% s2 R- P% Z g9 j) u8 t# W2 w }( B
begin P_pick1 arriving
( ?8 ~8 I! `. u1 m0 V set A_i to 1
. F0 e+ v4 N, S- n. l move into Q_induct1, N) ]/ z# Q# ?( G/ Z+ P
move into pickaisle.induct11 B- Q( v/ I. M: y4 I
while A_i<=30 do begin
' m5 [, U/ w$ S! I+ h% u* Y travel to pickaisle.con(A_i)
+ `! u( W1 H$ X3 K+ q# | if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec4 X, ]( {. \" H1 o1 h
else wait for 10 sec
, n# w( g4 u3 d9 ^ if A_i=A_leave then send to die
! \1 _# _& I1 t1 m5 s else inc A_i by 1
( T Y. I2 }% R; Q/ W* d; m% s2 c, z end/ Y1 w) G z2 |
end0 f( |' G; B0 v- i& ~
" F. L: J% \! V. p$ x( f$ h9 ?/ i* bbegin P_pick2 arriving0 O6 |, v _5 Q- o
set A_i to 117 x9 X* h4 V; w9 V" S6 R# O5 w2 [
move into Q_induct2
1 Q& {1 O' o, V% |* E" z move into pickaisle.induct2
# ?9 \, G, {6 { while A_i<=30 do begin
7 [, |' T5 x% R% R& n travel to pickaisle.con(A_i)
6 O. {9 {; a# _ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
7 d e0 Y2 q, R- w% Z# J else wait for 10 sec
! P& ], v6 m1 g* u8 L if A_i=A_leave then send to die Z* Z a0 B% s& d* o% ^ P, |# o
else inc A_i by 1
; w: w/ ]+ l: @/ Q& D end
0 e m/ f4 w' nend
+ d% b7 k E' E" A! h
1 d: x g1 \. I& P) zbegin P_pick3 arriving
6 ], J' ]: h5 J7 D+ i: U set A_i to 21
6 S7 _# q# L$ C: @+ J# m8 ~4 h move into Q_induct3/ [# S6 b5 X7 S$ a: q( j+ }; U
move into pickaisle.induct3
; ?2 [9 o) t& |/ s( w- y while A_i<=30 do begin$ ?" u. r8 R$ M2 o
travel to pickaisle.con(A_i)
: F0 G: z- u- x }5 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec$ x e0 r: a# L# O1 l
else wait for 10 sec
$ h5 B/ P6 Q% O( Y) ?; ~ if A_i=A_leave then send to die
: l) S& G9 @3 }3 S0 h else inc A_i by 1
3 q* @0 v# z( ^8 {3 j* n' E end7 r8 ~! O* W1 X6 n
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,其它按你的 ...
|