|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
6 u0 x7 ]0 R; F# f$ ], [% m* ^7 y* F. G; s0 x( l. 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中的数值,不知道会不会有什么不妥。
& U/ X+ a( Y; ~6 s" |* \' o- _0 m& V
! h9 M2 s& V1 h2 @$ Ibegin P_read arriving
8 z) L3 w7 K8 e1 k" w while 1=1 do begin
5 Z2 }& U5 @- x read A_tote from "data.txt" with delimiter "\n"
6 ^# y, {8 o6 t- `: } read A_time from "data.txt" with delimiter "\n"
+ ~5 U5 i* l% d4 A read A_leave from "data.txt" with delimiter "\n"
, a( F8 {3 s$ {' N- v read A_picks from "data.txt" with delimiter "\n"" r' h1 Y% j% U: M- l
set load type to A_tote1 A ~# f6 a1 [: W
if A_tote="tote 1" then set A_induct to 1
* Z& e5 m# [) `% X5 q% w else if A_tote="tote 2" then set A_induct to 2
$ M5 Q: F( y5 R else set A_induct to 3
4 v: P0 x# K: P0 s1 r set A_i to 0
) m0 F" N+ o& v. D$ f2 g clone 1 load to P_induction
, L# d+ a( w7 ?+ @) ^ wait for A_time sec$ r" n& {7 @3 f1 |
end
; L |% B. y! Jend
+ w7 D: g/ V" O
( z5 J: n# [8 o! r$ Xbegin P_induction arriving C' \8 \) O' g1 f- C' J8 T! k
if A_induct=1 then clone 1 load to P_pick12 K s. N+ c z& N7 [ T' Z
else if A_induct=2 then clone 1 load to P_pick2
% i$ n$ l% ?$ p else clone 1 load to P_pick3
( b2 r- t; _, j; R4 H; {: K& Aend
b2 r5 m* L/ U3 N! o" I+ }, R5 Q; X
begin P_pick1 arriving$ m; Q; f0 E( x
set A_i to 1
' a. Q+ w9 k7 D1 U" f9 f move into Q_induct1* o6 ^: `( l7 m3 |7 p Q* e
move into pickaisle.induct1% R) b; Q1 S# Y7 N ?" ] X
while A_i<=30 do begin; R5 v4 x* ]& |0 n+ j: p/ k% e
travel to pickaisle.con(A_i)
/ z( C* S! U% Z$ A% W1 h2 b if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" j. \* m/ a# X7 }, |
else wait for 10 sec
) s \$ M) d0 M1 F ? if A_i=A_leave then send to die
3 q) x" R' `% [& v* T1 o else inc A_i by 17 {, k x/ v" [/ |1 x6 b' R
end: ~, `3 W# E% |7 Q6 |$ y/ G t
end* i0 b- V3 J; O
9 }# D# J$ o2 W D l+ y6 W% Jbegin P_pick2 arriving
: ~2 c/ C% X9 p( } r9 j8 f: W set A_i to 119 c, y8 l+ \2 L' r" L
move into Q_induct2" A9 [# m2 Y9 T2 _5 j/ O. J/ D* z
move into pickaisle.induct2
* e. x$ f5 w1 ]+ z; [ while A_i<=30 do begin3 P( x) {8 D+ {; I3 t1 @7 _
travel to pickaisle.con(A_i)7 u N1 N) V% y+ [2 r; h7 T
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec2 ^$ U7 {- S" j% q) p, e% @0 @
else wait for 10 sec: z, `3 D$ [. D% ]: x; V0 M
if A_i=A_leave then send to die" o! R+ C* E( k
else inc A_i by 1
) b y2 U( r! F" }; _) J end
* |" e+ O1 c. d; P% Jend: T5 \) l" c3 u7 Y4 T0 B+ e& S
5 o- s6 N3 {- M8 z' u) d7 {begin P_pick3 arriving s: K. k9 ?. K$ n
set A_i to 21" M! R4 K2 O. N/ G
move into Q_induct3( M1 z$ k2 n5 m. i6 {
move into pickaisle.induct3
: H" j0 E! w) h% u e! m while A_i<=30 do begin
, b# j# i' l( ^1 C) x travel to pickaisle.con(A_i)4 {$ I8 f% B3 ]& M& V5 @
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" O. p: Y2 A/ C9 v/ d
else wait for 10 sec, \2 L8 |, {: M8 _" R( p
if A_i=A_leave then send to die+ y6 b6 C8 i( H+ G3 w
else inc A_i by 1. W% t/ p9 E0 Y& y1 {
end
" q, N0 n3 b0 S% F! yend |
最佳答案
查看完整内容
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,其它按你的 ...
|