|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢: A) @& ^$ V4 _5 O3 ?) ~$ G
# Q$ I# d8 s- Q( z$ D& m3 {7 [9 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中的数值,不知道会不会有什么不妥。
: l: U5 k8 r# K* g
3 l$ N( V5 H' N$ jbegin P_read arriving" W" V: R! y% I( S9 f
while 1=1 do begin
, E7 F+ V6 B x& F. c; Q" L read A_tote from "data.txt" with delimiter "\n"- T( d+ d1 f7 h5 N* ]
read A_time from "data.txt" with delimiter "\n"4 J8 |# m( }! {
read A_leave from "data.txt" with delimiter "\n"
% {- h5 a6 N6 l+ s, J read A_picks from "data.txt" with delimiter "\n"
q: V. Q9 j( G/ D) ~ set load type to A_tote) K5 ?2 A% _1 t8 d5 v, i
if A_tote="tote 1" then set A_induct to 1
) \6 p& y0 V! s8 J) n else if A_tote="tote 2" then set A_induct to 2& O* x }" b! A8 l7 N/ u) j* k
else set A_induct to 3
( `5 c- A8 ?, V5 j set A_i to 0( z+ r* k$ h: P/ t8 K; ?) Z1 a+ y
clone 1 load to P_induction
& _: ~, e6 ?) o* e7 ^ wait for A_time sec( H5 [: V# R w
end
+ g) W& \2 f- N5 b0 Aend. K& q* @3 p1 q9 u
! G. X" N5 Y9 c! d. j: p rbegin P_induction arriving
$ O: H$ u5 G+ I1 s& I if A_induct=1 then clone 1 load to P_pick11 ^( D% c" e& e2 N% e
else if A_induct=2 then clone 1 load to P_pick27 I1 O2 y- C; ^* T) p3 Z
else clone 1 load to P_pick3. |8 E* X, b: g6 \+ O; k
end4 b7 f) @9 M- n
% V: l% H+ ]+ ^3 V
begin P_pick1 arriving
- ^1 o& N$ i# j set A_i to 1
2 w) g4 p* ^" ?5 P move into Q_induct1
! y% G3 m: e; j4 I! x move into pickaisle.induct1! I" ]# p% O8 K" Z. N* A1 K* S
while A_i<=30 do begin
3 _0 ]- t, s# s: P travel to pickaisle.con(A_i)
9 R! Z1 Q( j+ X3 ~ if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ `- D0 |+ b. P2 }
else wait for 10 sec5 Y/ y& U' T7 v
if A_i=A_leave then send to die' s" H$ H2 [) s1 d4 z
else inc A_i by 19 H! s! w! o5 ^5 O
end# R) K/ p, ~& F8 I% F, y6 k
end; S9 Q7 J9 T# }8 `
0 ^4 S/ K" c, P' f
begin P_pick2 arriving- B0 q$ ]% C) a: a% A
set A_i to 11
* u( g- m+ q% r' \( T2 E move into Q_induct2; E( _9 e5 h; L7 q# s, h
move into pickaisle.induct2
5 u3 A7 |3 T, |! T: G while A_i<=30 do begin7 u. E+ P, f) t: A3 ~8 M. I
travel to pickaisle.con(A_i)$ U/ Y/ _: h) t$ p+ X: V4 a5 ^
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
! n$ y: C6 \: o" V, T- S7 A else wait for 10 sec
/ S; M! A! s7 D) s& X/ U if A_i=A_leave then send to die
\( e" [6 V' E- L5 M3 q else inc A_i by 1& j5 ~8 }7 z! O! ]$ R6 e
end
) G" [: L, M! v7 C7 I" Q5 Zend( n9 C' z2 K% {4 R! {
* J) g* p' x4 e& v) dbegin P_pick3 arriving
1 h. l \/ ~) f! G: p5 ^ set A_i to 21
1 G. X- Q( Q; [8 B+ Z2 s0 n move into Q_induct3
/ G! G# ?" M9 N$ o) q9 r move into pickaisle.induct3( @0 C6 C* c6 V) s( y
while A_i<=30 do begin4 i. P1 N# h5 g
travel to pickaisle.con(A_i)
) A5 h, G4 D! r9 E. n# P; e7 ] if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% B6 @" P5 I4 \' j& ~% [9 M else wait for 10 sec
( K- F. g6 Y1 J3 h, o if A_i=A_leave then send to die3 x" r- c0 Q" z
else inc A_i by 1
+ @& P- F# H+ i% o9 V8 P end4 X6 a, a, |+ o; V; z) u' K
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,其它按你的 ...
|