|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢* g; r3 C. G& U$ t. Y
/ t8 Y8 a# `/ q7 x* L0 p% O
我的问题是,在每个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中的数值,不知道会不会有什么不妥。* |& H7 S+ s w" Y& C4 I m% j4 C; c
3 e9 Q" \9 U& H8 X% g- s" pbegin P_read arriving b+ r9 ?+ H+ [- ^
while 1=1 do begin% G6 |/ P- S; l, F3 b
read A_tote from "data.txt" with delimiter "\n"& l* q7 V- f2 j1 o/ w) s. K9 f5 J
read A_time from "data.txt" with delimiter "\n"
Y: c, \$ g A, g+ T% p6 z1 x3 Q& \ read A_leave from "data.txt" with delimiter "\n"
/ _, p* m( G- e& n* p read A_picks from "data.txt" with delimiter "\n"
U( j( c- Y6 C4 G- J4 I set load type to A_tote
1 B; D4 D1 ~7 [1 e, w/ T7 B6 { if A_tote="tote 1" then set A_induct to 1* |3 |8 ]4 F% v# k
else if A_tote="tote 2" then set A_induct to 2
' Q$ D q" Z" H, U1 f5 ~ else set A_induct to 3 + a/ s& {9 ^% d; O- l- o
set A_i to 0
' ]* H. V: `7 J8 K3 C clone 1 load to P_induction
U4 u5 u% p# U9 E) x wait for A_time sec
' R. x) T4 }% A- _ end
. Y0 |1 v' F& a* Y) H! k Cend! w% s$ H+ `5 b) {, s( l1 I( ^
7 v+ w* {/ R. w; @2 V1 \begin P_induction arriving2 c: I7 e$ K+ [6 c
if A_induct=1 then clone 1 load to P_pick1
3 _" s, G. \, l$ N6 M4 m else if A_induct=2 then clone 1 load to P_pick27 X ^4 z& J- q) `1 f6 W/ g$ A6 V% L/ f
else clone 1 load to P_pick3# |/ K3 I1 y4 _! w
end. l/ s% n3 t/ p- @
+ V: v8 i: e2 i1 o+ g1 Bbegin P_pick1 arriving2 X5 o8 i; ?& b5 t9 }+ P% b
set A_i to 1
- a* Z6 U8 g9 {/ b move into Q_induct14 u1 o8 p! ?4 D$ X3 {6 Y3 x' j/ o
move into pickaisle.induct1
% p2 k% }2 }0 ~ u, t* `# } while A_i<=30 do begin
# j- w/ X: n" F( b6 o+ u, i travel to pickaisle.con(A_i)
) j9 b( @ }) T8 _. t if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
+ k2 o! ~* d5 P7 s, |' E' f else wait for 10 sec
3 M0 H: _- }; P, Q: S if A_i=A_leave then send to die
% w% Y* K6 b" O else inc A_i by 1
6 M" \0 v; R- i2 v end
+ t/ H. D. B/ U5 ~8 S/ n4 X3 cend
+ R+ `) e8 D' X, D
+ V. i9 F- k& \/ Z0 P/ Dbegin P_pick2 arriving
5 _+ O$ \- d. t8 y set A_i to 11
1 U. _# w$ i5 k2 k5 B1 n$ q: n! T move into Q_induct2
/ L% X* H {# T4 I- g move into pickaisle.induct2$ K5 \0 d, j& v0 ~
while A_i<=30 do begin
6 X! C% o- D1 x4 \ travel to pickaisle.con(A_i)
- _ v3 v$ ~$ q4 I7 w if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' y# V0 U0 d9 Q# h' N1 ~6 H4 s
else wait for 10 sec# X3 T2 F6 T# W
if A_i=A_leave then send to die, I% s. ?* M7 P8 r
else inc A_i by 1$ c6 v x+ _6 X; g9 k+ [" Q
end
+ V2 ]0 T$ f: m4 w. kend5 ]" ^+ A/ N, i* c8 u, t# G, F
/ ]; |. p# c0 }/ z3 Ybegin P_pick3 arriving4 p. f8 T0 _" {4 `
set A_i to 217 q- h; I1 Y$ p. C
move into Q_induct3
, g" G" w5 q; e) j move into pickaisle.induct3- |; p! j4 U. D: v3 n" E
while A_i<=30 do begin
: f+ q+ E3 p7 y, @7 }8 z$ m1 X' ` travel to pickaisle.con(A_i)
& G4 L; e# E3 @7 X. U" G if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
' g0 v, h( W ~ else wait for 10 sec
: [0 g& k) x$ A0 Q* Z if A_i=A_leave then send to die
6 C5 g- U, V6 }7 d else inc A_i by 1
, ^# _! j( T# H4 {5 @0 F end: ~# s0 A5 i1 S) C' Z9 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,其它按你的 ...
|