|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
/ `% P# N( y- F' c/ y# ~8 {! o+ E% Z) P$ e# d$ l: [: l) k
我的问题是,在每个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中的数值,不知道会不会有什么不妥。! E8 m. H. z4 @( D. u
3 o; O7 n8 [7 K6 z* A6 t+ fbegin P_read arriving3 ^& m0 }2 v1 ]) R- m5 h0 ^$ f
while 1=1 do begin' c$ v; e( q* D: m9 ^6 ~
read A_tote from "data.txt" with delimiter "\n"4 A9 J& h5 l+ L; \$ a
read A_time from "data.txt" with delimiter "\n"
9 R( e* O' z, @- g& V/ Q read A_leave from "data.txt" with delimiter "\n"3 ~) m: } q, K4 ? P6 }
read A_picks from "data.txt" with delimiter "\n"
( g( |5 G- C7 Q# a7 l# r: S' C( P+ p set load type to A_tote
) O [8 h( q' c1 F if A_tote="tote 1" then set A_induct to 17 D' Z7 v; d7 u: J$ `( @9 [
else if A_tote="tote 2" then set A_induct to 27 @0 ^- `* W) ]7 F
else set A_induct to 3 + Z& d1 a$ k" G
set A_i to 0$ K# m. @, U2 P0 O3 [
clone 1 load to P_induction, r1 W! H+ K, n- V0 {, P& {8 S
wait for A_time sec
4 q' Q+ s5 M; K8 E end
4 t% Q. Z0 _6 ?: t) t5 s Kend
1 o" o! R3 n, O& P2 T/ p
" Q( M6 c+ D' {& tbegin P_induction arriving, }0 R) l, N% p' f8 `. \: R
if A_induct=1 then clone 1 load to P_pick1
8 `- z1 w9 B$ t+ y5 a$ c: k/ Q3 }5 o else if A_induct=2 then clone 1 load to P_pick2
4 s; r# U( i7 F' ~7 A4 j else clone 1 load to P_pick3 t L5 N5 R- Y2 t3 u
end1 T3 c0 I- F, X: Q- p/ X
- b; \3 s( C. K- T
begin P_pick1 arriving3 q+ ] B% w" e
set A_i to 1
, k, {& S+ u4 m3 P2 h" M' Z move into Q_induct1, ~: f7 {7 K; x4 B6 j# X7 K
move into pickaisle.induct1( L0 M* O! M% S% N
while A_i<=30 do begin: r8 |; T9 p4 m9 i
travel to pickaisle.con(A_i)
5 v3 |/ n1 z' K! z* }* H* i: l if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec' E: c1 T' j \5 V) d: P3 @0 W
else wait for 10 sec$ Y4 `0 V# p+ R' [ r7 _
if A_i=A_leave then send to die& r& R: V0 ]# w. }
else inc A_i by 1 v* V+ R* U9 j! e
end
7 M$ L% Y! ]( n. mend
. }. j( d- J" ]2 l% N+ }2 a1 Q: w7 ^8 ^, j) y) ?, {
begin P_pick2 arriving
8 w6 S% Z5 M- `3 Q set A_i to 11
5 x! o8 z4 F1 S, Y3 y4 X move into Q_induct28 M6 j3 M4 t4 U
move into pickaisle.induct2' E* T5 j7 `0 c0 K" W1 x# }
while A_i<=30 do begin
. M' o: Z) b; H) t( t travel to pickaisle.con(A_i)
: ]' V, Y+ M3 K- t" l s if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec1 S6 H& }+ a7 R6 g* V! F/ O u! n, i6 p
else wait for 10 sec1 {. e$ b8 R1 i, ]$ V8 O
if A_i=A_leave then send to die& W( Q" `( J; h( |# }+ O
else inc A_i by 1; I, B& g2 R/ [# P
end
% f+ w! y$ E* j) y6 w6 a( yend) C+ y( R3 h9 W- Z6 c
/ y: `+ l M- r% Hbegin P_pick3 arriving
- u t8 N6 W; U+ I set A_i to 21
6 v2 T# E' L4 q move into Q_induct3# N, N4 k: v+ n2 ^
move into pickaisle.induct3
6 V/ p' v. E# T while A_i<=30 do begin
- M* j- X" t* O% K) b travel to pickaisle.con(A_i)
! G$ M4 {4 ?4 Y. Z& i' S if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% ]9 D6 ?, {5 K$ a6 D# m
else wait for 10 sec
- P" M. n8 W$ h! v/ U7 x if A_i=A_leave then send to die
, r; Z& l3 y) @' { else inc A_i by 1
: @! O$ V1 T8 \( @; m$ c% h. u1 f9 y! x end4 w5 q) [/ Q' ]# r% O. m% O; q
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,其它按你的 ...
|