|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ Z8 f2 K: d4 g j
0 \: Q, m6 R1 J2 ]5 M我的问题是,在每个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中的数值,不知道会不会有什么不妥。
+ [" F w0 v4 |0 d
+ D* `% ]! T# Lbegin P_read arriving0 v) I7 D4 R4 |3 [$ r Z
while 1=1 do begin
$ |8 D) W3 j) _ read A_tote from "data.txt" with delimiter "\n"
6 k" P: ^4 n7 a+ o( W% \. m read A_time from "data.txt" with delimiter "\n"
5 O( V/ P! T# z. Z( c, v y: G; a9 @/ A read A_leave from "data.txt" with delimiter "\n"% @ Y( ~* b5 o/ L
read A_picks from "data.txt" with delimiter "\n") I# \) t- D: a" a9 `
set load type to A_tote& i$ M1 Q! E8 l0 ^/ _+ r
if A_tote="tote 1" then set A_induct to 1; j8 V' u) N7 X. G" \6 D; K4 t
else if A_tote="tote 2" then set A_induct to 29 i: a6 B$ j- m8 l
else set A_induct to 3 0 ^6 y9 e1 w( S0 |5 {* e1 ^
set A_i to 0
! L$ C2 y1 [1 W* t9 t clone 1 load to P_induction8 k; ^3 d2 N$ ^. ]0 n
wait for A_time sec
! y8 S$ k; q1 ^6 ?' q9 o" C( w% R' Q5 M end
/ j" l7 b6 N5 S7 r2 Jend6 P' y+ S$ {+ `5 ]; q! \ S
7 t" l3 ^# K- q/ X! G1 ]
begin P_induction arriving
2 p- I' V9 O" c& z3 _8 K if A_induct=1 then clone 1 load to P_pick1
& R' @3 [2 n6 V else if A_induct=2 then clone 1 load to P_pick2$ s7 S# b; b6 p* S, o* x! f
else clone 1 load to P_pick3% X% Y' J* P: J
end5 b3 ^0 q& r+ [4 S' Z2 K. M" i
( l2 f1 w' ?7 i
begin P_pick1 arriving2 H% `$ L$ E+ j+ O5 i% @
set A_i to 16 ?# _6 C; ]9 p2 \* S6 T
move into Q_induct1
1 I% \2 |. G H; t9 d( H! p move into pickaisle.induct1" Y5 G' w! @) M3 u8 |& g) F
while A_i<=30 do begin2 H( H' \- B6 @, { F8 C: d) s
travel to pickaisle.con(A_i)
: [5 b. e2 ^: L! N) `7 ^% ^ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec9 c6 ^# e. ^% U+ T
else wait for 10 sec
1 I+ U& [- F) A% w! E if A_i=A_leave then send to die
. s. j8 O% l/ x" K* X* W5 m else inc A_i by 1
. x: T3 v3 i7 X0 V" A' U. |/ t end4 H8 ^* ^( Q+ v% w
end
' r3 ? `; u5 \7 I% i2 e
& m2 J1 \% G8 Rbegin P_pick2 arriving
% z9 v4 J2 @( t& {+ E7 G set A_i to 11
$ u( P! s0 h1 D" g move into Q_induct2+ [0 q5 k# B1 a8 r1 }+ m! a
move into pickaisle.induct26 d" p6 c6 o. A7 t8 c+ w0 b
while A_i<=30 do begin7 ~+ i: c0 O" F T& n
travel to pickaisle.con(A_i)
# S% L: x0 R7 k" e4 q1 r. P if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 y4 R. V9 b8 U" d" f* n: s& h
else wait for 10 sec+ E" N, Y. B' b( U* o2 s
if A_i=A_leave then send to die6 ]7 K8 D8 J8 {
else inc A_i by 1
! y: F# \/ L$ E8 X7 l2 N6 |' F end
/ t9 x1 o2 A4 C6 Q7 f& i6 c5 Rend" N$ j8 s% Q/ M
0 j( v% \( |8 y. U" {- P9 G* e1 ^
begin P_pick3 arriving
2 S8 i( E, X$ N/ C F! Z9 Y set A_i to 21+ C; ^& |1 Z# y6 D( z
move into Q_induct3- j n) Y; \1 j4 M
move into pickaisle.induct3
* A; Q' N7 z3 x while A_i<=30 do begin" `( K( G. N. E8 ^; t
travel to pickaisle.con(A_i)
O3 ]6 M- m- _4 S2 b6 x$ W if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& |8 D! B; v' V5 v! Y else wait for 10 sec
& i( f7 V0 i% V7 N if A_i=A_leave then send to die) M) f5 h$ r7 [/ t+ Q
else inc A_i by 1
& ?+ { ~7 a, \9 }$ f b end
9 b; ?! G" R8 f3 \) w5 k% Dend |
最佳答案
查看完整内容
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,其它按你的 ...
|