|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢1 K7 `8 ]- C1 C/ z( p( b
) [$ p3 i- e! N6 J& @9 y2 t R6 e. 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中的数值,不知道会不会有什么不妥。- ^- ?; \2 v; h: X5 U
k7 x6 R% D/ f" Q; f1 d
begin P_read arriving
" G4 s* g6 G8 r! m3 a! ? while 1=1 do begin
- E; n) p8 R, H read A_tote from "data.txt" with delimiter "\n"
9 f6 U* E9 a+ e, H( |9 x) c% Y9 t read A_time from "data.txt" with delimiter "\n"
2 A$ t' K$ H3 {7 H! S& o- o. x5 a read A_leave from "data.txt" with delimiter "\n"
/ V+ r% m c7 m# ] i) ] read A_picks from "data.txt" with delimiter "\n"
+ _: V7 v+ l# c set load type to A_tote( j& c5 S5 g& D& z3 x
if A_tote="tote 1" then set A_induct to 10 v5 K' o( s# [
else if A_tote="tote 2" then set A_induct to 2& z) C1 K! {8 r+ g# e8 ?; y
else set A_induct to 3
& \+ u: i" L# ]3 Y- ? set A_i to 0
) _2 o* l c7 c1 } clone 1 load to P_induction
! a' {0 ^" n+ d- K wait for A_time sec% X) f) s% k2 O( g& B# V- N
end3 X7 O4 p' s" O* S3 {8 @
end* Z% \! i" B2 r3 \2 \1 E) y
) z+ A& ~: G( pbegin P_induction arriving" R& o9 S1 |. I1 {. K
if A_induct=1 then clone 1 load to P_pick1
* m: |6 l, L. G7 v1 K else if A_induct=2 then clone 1 load to P_pick2/ n" j* H; G5 \: F
else clone 1 load to P_pick3
! I% j5 l: k9 oend
( ?1 H& ^3 B) a. o4 f" Z
8 f0 s: L1 R7 S$ l w: c |begin P_pick1 arriving
4 m( s+ _ @* V* `7 ?& g set A_i to 14 p4 I: X! q: ~* z6 g: W
move into Q_induct1
* m+ O! d) L4 W6 U move into pickaisle.induct17 ^* S3 W) ? {* p8 ]& d
while A_i<=30 do begin
; e: S! z4 o" P% g, ]; Z- m* ] travel to pickaisle.con(A_i)
Z6 J; _6 X4 s/ y2 d if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
% _: o# T$ q2 R else wait for 10 sec
6 I- ?" e2 v) p) q if A_i=A_leave then send to die8 x8 {0 @6 S4 O% h c1 B
else inc A_i by 1
# B# Q0 ?/ Y' L2 v5 @2 `$ z! | end
$ m% S0 X8 n! _- r" E% r. F0 c. Z! Wend
, U7 ]1 L0 ~& h/ f8 {8 `: Q0 |* y
begin P_pick2 arriving
+ Z( X; U* o& ?9 ? set A_i to 11
" K! |$ r f% k move into Q_induct29 V7 K5 k) d1 a
move into pickaisle.induct2
8 B O6 @" V/ k* z: ^ while A_i<=30 do begin, I1 ^- H4 y1 ~: E3 n+ T
travel to pickaisle.con(A_i)
0 H! \( ?7 c" y G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 P0 y) }) P) r+ C else wait for 10 sec
- _, J8 f2 c/ Z5 F0 ? if A_i=A_leave then send to die
7 e/ ~" A4 h. \& \4 g" v else inc A_i by 1
" G4 n: ?4 a v1 L1 I0 I end
" o+ w; O9 N# Q7 K& X) Vend
1 y, g6 n( a$ p: |+ r P6 \4 P
! ?2 G. w5 f1 t- u( ^begin P_pick3 arriving
( ]- H9 {7 ^& \- _4 `) { set A_i to 21
; W3 t. o" l. l9 J5 }$ m9 P move into Q_induct3! d! U! u0 ~) `: ~1 I6 l: ^
move into pickaisle.induct3
?5 Z& ?- e" D1 r4 ` while A_i<=30 do begin; t/ ~7 ~" m4 W% I' f
travel to pickaisle.con(A_i)
8 V+ |% {$ u( i1 m' E# N( H if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
6 u. e. D2 i) A) F else wait for 10 sec8 x( y" ]7 K2 B1 W3 M( N& v
if A_i=A_leave then send to die
* a, \5 d; ^" s5 q% H6 n" r5 R else inc A_i by 16 y, X- [3 s/ H* |/ k
end) S2 |! B: M# X- d( ^
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,其它按你的 ...
|