|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢$ w" o. y! r8 s# T7 @! q. o4 f
) s8 T2 [) {1 b+ y' W0 F& `0 I% M2 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中的数值,不知道会不会有什么不妥。
' Z: d0 r7 ? G3 j4 e. l+ ]& m8 [ f- N! A7 S) b N4 q
begin P_read arriving
5 t/ e' t5 `! `+ ^2 @) x6 j( q while 1=1 do begin
6 I7 n! h# M/ w; ]- ] read A_tote from "data.txt" with delimiter "\n"! B2 C5 {+ n+ g& a* ? a
read A_time from "data.txt" with delimiter "\n"& @: x% s) a) e
read A_leave from "data.txt" with delimiter "\n"
' x3 {3 Z2 O3 W% U# V read A_picks from "data.txt" with delimiter "\n") w3 s( D" v; @* X( h4 W
set load type to A_tote: K0 E$ c9 E$ M( v5 o+ k( X# [
if A_tote="tote 1" then set A_induct to 1/ D" p5 [6 @$ |$ G4 x
else if A_tote="tote 2" then set A_induct to 2
- h3 [( ^7 e/ A3 ] else set A_induct to 3 " g; k4 b& ?& X+ y
set A_i to 0
) |+ D* Z# @# Q: K- Z, C clone 1 load to P_induction g: i# q: s) z; I
wait for A_time sec: ?3 @' z2 r& k% k
end
/ E5 z: c8 ?3 [3 iend
3 ^6 A3 [8 z: w8 _/ c
. z/ P! v* _) u; z( rbegin P_induction arriving
p$ W5 j0 Q4 r" ^ if A_induct=1 then clone 1 load to P_pick1
9 n# R6 K8 r9 r; f) `- ^' G else if A_induct=2 then clone 1 load to P_pick2
2 G: z7 ]% x3 j$ f8 O' c, x else clone 1 load to P_pick3
r" v4 V: H N' v4 jend
6 E& P- Y7 w- O2 J' A1 c
! R9 u! v! B) @6 r/ S5 n! a# bbegin P_pick1 arriving& Q0 ^1 i3 S" p7 g
set A_i to 1
3 q* u7 Q3 O. x0 ~5 c8 m2 R move into Q_induct1/ h% I) [7 v+ p# o! p' U! V
move into pickaisle.induct1
: e0 l6 e0 _5 l$ t while A_i<=30 do begin
' i' P: R7 r4 C$ b travel to pickaisle.con(A_i)
7 v* G% w& S( E3 Z+ R1 U if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
1 m/ e( x( j) d* r, X& H else wait for 10 sec6 Y: D: s3 U; O8 B. C
if A_i=A_leave then send to die1 K8 J) ~& N& {4 g" |
else inc A_i by 14 q7 b" g+ w; _0 I- @
end
$ v. K# N9 a& H, aend) P& r- b( g# q( Z8 |- l. _
' T; E- t2 ~) W) L6 g4 C, |
begin P_pick2 arriving
0 S; ~% C& @0 n set A_i to 11
/ ^1 b; k3 X9 f8 C- F0 x6 W' N move into Q_induct2) g# r8 ~! }5 g$ G0 Z0 Y0 ^
move into pickaisle.induct25 ]& T' z9 ~' J( X& F
while A_i<=30 do begin
8 R( f% K. U5 y. s4 r7 ` travel to pickaisle.con(A_i): C$ B, {- a# }6 p8 q
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec3 f: w5 q3 p# U# e* ^
else wait for 10 sec
( ]1 R3 O5 I# M* U. _ k- m if A_i=A_leave then send to die: b0 L! x5 e, t0 [& J( ~
else inc A_i by 1
9 N1 s8 m" o: {0 J+ C end
- j3 Y& A9 \: C$ P' w' qend
1 W' J" Q/ b: L2 ^
/ r B$ H2 }8 N9 z7 hbegin P_pick3 arriving& c4 p8 K- x; o
set A_i to 21
. O6 G: q9 y7 s5 q0 c, H( n move into Q_induct3
4 y" v3 U* Y: w% h4 \# R$ O move into pickaisle.induct33 b/ y2 O2 q' v0 |& y9 s6 \
while A_i<=30 do begin4 t" A2 q+ \6 m6 J6 h# V
travel to pickaisle.con(A_i)
3 B! F+ ~4 l0 s% [ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec& z: k4 o, h( b
else wait for 10 sec
6 ^8 f; P6 C; [' F& I5 T$ a if A_i=A_leave then send to die
6 j1 J0 N R4 V7 T R7 P else inc A_i by 1
" g" [1 |' L1 b7 h end6 k0 J! a9 g y2 b- C* Z5 x" u( M
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,其它按你的 ...
|