|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ B8 y7 }$ X/ @- w j) R" l" ~0 N, `; S3 k$ p
我的问题是,在每个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中的数值,不知道会不会有什么不妥。
) @: [6 u# U7 f ^! T( T
" w* h; q$ Z* G3 Mbegin P_read arriving9 N, X8 Q& _& ]* q! K
while 1=1 do begin6 m9 [+ f# A* ?2 y+ [9 n& b
read A_tote from "data.txt" with delimiter "\n") h6 s; k0 V5 x' ^ N- H
read A_time from "data.txt" with delimiter "\n"
, Y* @8 k* W- b+ {" A- M7 O read A_leave from "data.txt" with delimiter "\n"% R2 [8 o' \- t' R |/ |
read A_picks from "data.txt" with delimiter "\n"; s( x. g3 I4 {# D3 z
set load type to A_tote
. |% ^: `8 F6 n( ]& G if A_tote="tote 1" then set A_induct to 1; g" `! q/ s' `: [) ~
else if A_tote="tote 2" then set A_induct to 2
( ^$ ?: m3 h. \5 e* R else set A_induct to 3
' r- H" u- D6 o1 K e$ L. p& M set A_i to 0% ~0 n+ _0 C8 q# h6 H; v
clone 1 load to P_induction) p3 F6 R' b+ X# ? B- P6 R
wait for A_time sec) c6 d( y8 ^5 z) Z- N) n9 n
end
7 o/ D# G+ x: N( P2 Z! Eend
; N9 h) V9 e% c5 J N' [, |/ a. B5 k! R
begin P_induction arriving
3 L( G# Y+ j4 D8 ~& y8 d if A_induct=1 then clone 1 load to P_pick1, o* s4 ?# o0 }, k3 w) A0 W' B+ S
else if A_induct=2 then clone 1 load to P_pick2
+ h' x+ R' D+ @3 `0 J" s else clone 1 load to P_pick3# y0 p7 n ~& o( u' _3 c
end* S7 m7 g1 b8 D; B0 M5 ^" V
4 j8 ~6 v- u" e* U, t. `begin P_pick1 arriving
7 o, q6 `% g9 m- L8 _ set A_i to 1) q$ d Z% A- r9 W) S* L3 z
move into Q_induct1
$ Y* B! v4 H4 |: q& G, y: }9 _, t move into pickaisle.induct1
% `4 u, @7 ]/ Z9 b- ^# _ while A_i<=30 do begin
: a& q" Y E1 f7 g$ s. c8 h9 ~ travel to pickaisle.con(A_i)
, T- f5 ]3 Q( [( ? if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. B) b$ Y! J4 p0 Y/ o2 L else wait for 10 sec4 X5 G5 n& r# E9 Z; Y0 ]
if A_i=A_leave then send to die
9 Y/ K7 o6 k% s2 j- J" k$ _" R0 b% Z else inc A_i by 1
. v( ~4 i" Y4 E- D2 o; W end
5 }( W* c5 _% a: A( y0 Fend
8 w& V" X: ?* c( e. _
5 C) @* e( d: \6 H6 fbegin P_pick2 arriving
6 q6 d& z$ M0 [3 j% r3 { set A_i to 11
1 D, F: ~1 Z& J( Z" g1 _! M* Z2 O move into Q_induct20 d. a0 g4 B& p% ?
move into pickaisle.induct2; u, X7 s& |6 {, c
while A_i<=30 do begin
$ m0 X J% O* r: L- W6 y+ W travel to pickaisle.con(A_i)
4 i) P+ d2 A0 G3 C3 I if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! }: i/ s* B" I else wait for 10 sec. N/ @: s" }3 ], \1 v7 d- Y. A
if A_i=A_leave then send to die
2 U5 t- _; i" |* B) w% t else inc A_i by 1
+ q& ]8 |4 z: T end0 B4 Y C ^" S$ g7 m- E
end
$ Y* }3 K5 Y- T2 `& b
4 P' r+ v) q/ t1 v3 a0 Tbegin P_pick3 arriving
2 e( ~5 L' i! c* I( l" u set A_i to 21% W5 D: p8 Y1 N
move into Q_induct3
, k2 F k+ s e$ h1 h move into pickaisle.induct3- _4 {6 R, f+ i d
while A_i<=30 do begin
! z2 B6 Y3 I1 Q$ E$ X travel to pickaisle.con(A_i)' ]$ B9 w6 I, k% y! ^, M: Z
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec, p- [; z# ^# Q! v& |( c [& T
else wait for 10 sec
1 p; c0 y; ]! t! K9 n3 ]& x1 t if A_i=A_leave then send to die. V; q: o. H5 e9 u
else inc A_i by 11 J0 ~5 L% h% b; p* ?& L
end
$ [. }8 z; y% Hend |
最佳答案
查看完整内容
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,其它按你的 ...
|