|
|
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
0 ^+ D8 W* i7 _* u% G8 A
) g( r: B" F+ d; y% v9 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中的数值,不知道会不会有什么不妥。
) Z, g2 c$ U: l; [
" K8 Z6 o: w% V- ~# j( Kbegin P_read arriving
0 P/ ?# ~5 _- q5 S! p" x ]& G while 1=1 do begin
" ]1 B0 e& m, x8 \3 W2 v read A_tote from "data.txt" with delimiter "\n"8 V" Z3 P0 z. z, J' X
read A_time from "data.txt" with delimiter "\n"' Q" U `! \7 O9 L
read A_leave from "data.txt" with delimiter "\n"/ k, w1 y% V9 x) j, e8 K( F
read A_picks from "data.txt" with delimiter "\n"
# H! R, z/ V: ^! C! r; p set load type to A_tote7 |! P% M4 u( s# d
if A_tote="tote 1" then set A_induct to 1
; x3 E3 V1 j" y else if A_tote="tote 2" then set A_induct to 2
# P7 c0 r0 D" }( S' I else set A_induct to 3
- {, q4 o0 P! M4 T- E k ?! v set A_i to 0
3 H2 k+ `, W; v) O clone 1 load to P_induction
8 D0 }) J6 k: ]# H* e& d wait for A_time sec
0 Z! ]0 {% M- l2 M7 E# U# y: m4 @ end
% m; g1 C' g2 X C; zend
$ m- y. n( n, f# ^
8 ~% R* X+ J$ P/ `begin P_induction arriving
/ C; j1 i5 ~3 F- w% j/ p4 n if A_induct=1 then clone 1 load to P_pick1
7 j* G; W) q. ~6 U4 ` else if A_induct=2 then clone 1 load to P_pick2
" Y. z8 V+ M% Q" y& a' E4 c2 V( t else clone 1 load to P_pick3
3 h4 q M; G9 Y0 m! Aend7 ]% F" y1 g% G8 O0 O
/ G; u% y$ J ^/ c* Q1 Hbegin P_pick1 arriving( n5 W2 s( m4 w5 S, B. w. ~) c
set A_i to 1
6 x/ l! W7 I7 O) o7 g6 {. d) T9 z move into Q_induct13 @4 D+ R4 f4 }" O; j0 P. \: K
move into pickaisle.induct1# _- P$ f; o4 m! H9 r
while A_i<=30 do begin
6 o$ q8 N% z* } travel to pickaisle.con(A_i)9 h8 @8 X8 f$ h: G' R$ E1 c
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec/ R* U3 k" m7 M3 B- N2 M" k+ G
else wait for 10 sec
+ b( `; T+ [/ L, y if A_i=A_leave then send to die8 s6 \+ G) X# d
else inc A_i by 1
( V3 q$ q/ k+ d% E- T7 u3 y( @5 x end8 s! F0 k7 o' z! ^4 {
end
; o& a# e5 h2 X5 z* j% @. u s/ P* V0 P! X& Y" C: {! w
begin P_pick2 arriving! I3 t3 B* v2 M7 f3 C
set A_i to 115 T4 P$ e: A0 e, `9 l- q1 ~
move into Q_induct2
6 K _+ d- f* L* J8 B6 ^0 M move into pickaisle.induct20 {( c- m# @+ t& G' @1 s& W8 d
while A_i<=30 do begin
' v }* K# u9 a! ? travel to pickaisle.con(A_i)/ C# v) C0 Y+ Y9 a) E7 M# P
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* P0 ?+ t; Q3 U5 \( Z% O. z, P$ F else wait for 10 sec: _ D5 D% Y7 C
if A_i=A_leave then send to die
8 y4 d# ^( |' w3 a; u. | else inc A_i by 1" `% x) g5 y; g! k" _
end7 \3 f/ u' X3 t; P. e+ G# o. }
end f- ^1 }# l# h8 V* B6 [& f6 S
* w3 \; O6 j! C4 k3 z3 u/ ^begin P_pick3 arriving
2 S# P9 D- b% t q- k set A_i to 21; H; \. w2 Z( e) Z3 C
move into Q_induct3: x( C7 E: K# ^. [/ y
move into pickaisle.induct3
0 }! p+ l, {3 u/ ?2 D3 h4 ]# r while A_i<=30 do begin0 q6 W0 l8 `! q$ R6 M# e
travel to pickaisle.con(A_i)& m- x; D1 ~1 m
if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: V3 d, a* z, e8 |& d2 n( f else wait for 10 sec4 S# Y- q/ f# j, V( S& x% F$ j- h
if A_i=A_leave then send to die- U; h% y! V$ e: H1 m7 i/ {
else inc A_i by 1
; c7 v; C# J3 ~+ Z end
! F5 Y! ~8 {3 M. n5 P4 ]0 x) I- P) Xend |
最佳答案
查看完整内容
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,其它按你的 ...
|